Linux

GPIO

Export pin

1
  echo 2 > /sys/class/gpio/export

Set pin

1
2
3
  echo "out" > /sys/class/gpio/gpio2/direction
  echo 1 > /sys/class/gpio/gpio2/value
  echo 0 > /sys/class/gpio/gpio2/value

Read pin

1
2
  echo "in" > /sys/class/gpio/gpio2/direction
  cat /sys/class/gpio/gpio2/value

Verify using debugfs

1
2
  mount -t debugfs none /sys/kernel/debug
  cat /sys/kernel/debug/gpio

Performance Tools

https://d33wubrfki0l68.cloudfront.net/4600880bb3d7436eab9deff21e3c964aa92b5840/55102/media/notes/linux-performance-tools.png

BPF Performance Tools

https://d33wubrfki0l68.cloudfront.net/60c76749ea96bd7e0c2f74ef244525ba5e106374/8bb35/media/notes/bpf-performance-tools.png

Links:

Performance Analysis

https://d33wubrfki0l68.cloudfront.net/0e95609a8b210aa778d639a8d6d2488b371ff5d3/f882d/media/notes/linux-performance-analysis.jpeg