<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tracing on Chris J Arges</title><link>https://chrisarges.net/tags/tracing/</link><description>Recent content in Tracing on Chris J Arges</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 11 Dec 2020 12:31:49 -0600</lastBuildDate><atom:link href="https://chrisarges.net/tags/tracing/index.xml" rel="self" type="application/rss+xml"/><item><title>tracing linux</title><link>https://chrisarges.net/posts/2020-12-11-tracing-on-linux/</link><pubDate>Fri, 11 Dec 2020 12:31:49 -0600</pubDate><guid>https://chrisarges.net/posts/2020-12-11-tracing-on-linux/</guid><description>&lt;p&gt;I&amp;rsquo;ve written up about some of my work at Confluera here:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://medium.com/confluera-engineering/tracing-linux-fast-compatible-complete-19cee89b3cf6"&gt;medium&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://www.confluera.com/post/tracing-linux-fast-compatible-complete"&gt;confluera&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>bpf for linux tracing</title><link>https://chrisarges.net/posts/2019-03-21-bpf-for-tracing/</link><pubDate>Thu, 21 Mar 2019 11:54:37 -0500</pubDate><guid>https://chrisarges.net/posts/2019-03-21-bpf-for-tracing/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;Originally called eBPF for extended Berkeley Packet Filter, BPF is an in-kernel&#10;bytecode interpreter that is very multi-purpose. In this post, I&amp;rsquo;m going to&#10;focus on its tracing capabilities.&lt;/p&gt;&#10;&lt;p&gt;To use BPF one can use the bpf &lt;a href="http://man7.org/linux/man-pages/man2/bpf.2.html"&gt;syscall&lt;/a&gt;. This provides a way to both load&#10;BPF bytecode programs and also create memory maps for sharing data between&#10;kernel and user space.&lt;/p&gt;&#10;&lt;p&gt;Because of the complexity, using bpf in a DIY method becomes a bit complex.&#10;There are many ready to use tools such as &lt;a href="https://github.com/iovisor/bcc"&gt;BCC&lt;/a&gt; and libbpf that make usage&#10;way easier.&lt;/p&gt;</description></item><item><title>tracing in linux</title><link>https://chrisarges.net/posts/2018-10-04-tracing-in-linux/</link><pubDate>Thu, 04 Oct 2018 09:39:10 -0500</pubDate><guid>https://chrisarges.net/posts/2018-10-04-tracing-in-linux/</guid><description>&lt;p&gt;Tracing in Linux is robust, flexible and has many options. So what mechanisms&#10;exist both in kernel and user space for instrumenting the kernel? In addition&#10;what is available in which kernel version, and what requirements does each&#10;technology require? Here we&amp;rsquo;ll mostly focus on syscall tracing.&lt;/p&gt;&#10;&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;A great overview on Linux tracing systems can be found &lt;a href="https://jvns.ca/blog/2017/07/05/linux-tracing-systems/"&gt;here&lt;/a&gt;. Overall&#10;thinking about tracing systems as data sources (in kernel), and frontends help&#10;explain why there are so many tools. Some data sources are &amp;rsquo;tracepoints&amp;rsquo; while&#10;other are &amp;lsquo;probes&amp;rsquo;. Tracepoints are low-overhead and can be activated or&#10;deactivated, they are compiled into the kernel so they cannot be dynamically&#10;instrumented. Probes are very flexible, but require larger overhead as you are&#10;replacing a &amp;rsquo;nop&amp;rsquo; instruction with a branch in order to redirect execution of&#10;probed function. In addition you must know the function name and can only&#10;instrument &amp;lsquo;real&amp;rsquo; (non-inlined) functions. Some good slides describing this are&#10;&lt;a href="https://blog.linuxplumbersconf.org/2014/ocw/system/presentations/1773/original/ftrace-kernel-hooks-2014.pdf"&gt;here&lt;/a&gt;. Other overviews of tracing technologies can be found &lt;a href="http://www.brendangregg.com/blog/2015-07-08/choosing-a-linux-tracer.html"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>