Linux: Enable i2c kernel tracing


when you want to see whats happened on the i2c bus on an raspberry pi you can enable tracing with debugfs.

Get root and mount debugfs. This is usually already mounted in raspbian

michael@debdev ~ # sudo su
root@debdev ~ # mount -t debugfs none /sys/kernel/debug

Enable tracing

root@debdev ~ # echo nop > /sys/kernel/debug/tracing/current_tracer
root@debdev ~ # echo 1 > /sys/kernel/debug/tracing/events/i2c/enable
root@debdev ~ # echo 1 > /sys/kernel/debug/tracing/tracing_on

Generate some traffic on your i2c bus and view the trace

root@debdev ~ # cat /sys/kernel/debug/tracing/trace

To clear the current trace log

root@debdev ~ # echo > /sys/kernel/debug/tracing/trace


Advertisment to support

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.