{"id":7581,"date":"2021-04-07T15:37:21","date_gmt":"2021-04-07T13:37:21","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=7581"},"modified":"2021-04-08T10:40:48","modified_gmt":"2021-04-08T08:40:48","slug":"linux-enable-i2c-kernel-tracing","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/linux-enable-i2c-kernel-tracing\/","title":{"rendered":"Linux: Enable i2c kernel tracing"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_7581 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_7581')){$('.twoclick_social_bookmarks_post_7581').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Linux%3A%20Enable%20i2c%20kernel%20tracing\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Awhen%20you%20want%20to%20see%20whats%20happened%20on%20the%20i2c%20bus%20on%20an%20raspberry%20pi%20you%20can%20enable%20tracing%20with%20debugfs.%0D%0A%0D%0AGet%20root%20and%20mount%20debugfs.%20This%20is%20usually%20already%20mounted%20in%20raspbian%0D%0A%5Bshell%5D%0D%0Amichael%40debdev%20~%20%23%20sudo%20su%0D%0Aroot%40debdev%20~%20%23%20mount%20-t%20debugfs%20none%20%2Fsys%2Fkernel%2Fdebug%0D%0A%5B%2Fshell%5D%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/linux-enable-i2c-kernel-tracing\\\/\",\"post_id\":7581,\"post_title_referrer_track\":\"Linux%3A+Enable+i2c+kernel+tracing\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>when you want to see whats happened on the i2c bus on an raspberry pi you can enable tracing with debugfs.<\/p>\n<p>Get root and mount debugfs. This is usually already mounted in raspbian<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # sudo su\r\nroot@debdev ~ # mount -t debugfs none \/sys\/kernel\/debug\r\n<\/pre>\n<p><!--more--><br \/>\nEnable tracing<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # echo nop &gt; \/sys\/kernel\/debug\/tracing\/current_tracer\r\nroot@debdev ~ # echo 1 &gt; \/sys\/kernel\/debug\/tracing\/events\/i2c\/enable\r\nroot@debdev ~ # echo 1 &gt; \/sys\/kernel\/debug\/tracing\/tracing_on\r\n<\/pre>\n<p>Generate some traffic on your i2c bus and view the trace<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # cat \/sys\/kernel\/debug\/tracing\/trace\r\n<\/pre>\n<p>To clear the current trace log<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # echo &gt; \/sys\/kernel\/debug\/tracing\/trace\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, 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<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1574,47,378,224,1534],"class_list":["post-7581","post","type-post","status-publish","format-standard","hentry","category-linux","tag-debugging","tag-enable","tag-i2c","tag-linux-2","tag-trace"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=7581"}],"version-history":[{"count":2,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7581\/revisions"}],"predecessor-version":[{"id":7584,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7581\/revisions\/7584"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=7581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=7581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=7581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}