![]() This isn’t a starters guide for ftrace, so I will assume you know its basics from this point onward. That call graph can provide great aid in understanding flow, alongside reading the code. In case you’ve never used it (or just as a slight reminder) - here’s how it looks when tracing the kernel path for a vfs_read call on /proc/version: ![]() Providing both in-kernel API and usermode control interface via tracefs, it’s arguably one of the most comprehensive tracing tools in Linux.įtrace has many modes of operation, in this post I’ll focus on the function_graph mode: It allows you to record the call graph originating from a given function, recursively. It’s a powerful tool for tracing flows and events in the kernel. It is available in most modern Linux distributions. It can be used to set dynamic traces on virtually all kernel functions, and also supports a large set of static tracepoints, used to record core kernel events. ftraceĪt its base, ftrace (Function Tracer) is a dynamic function instrumentation infrastructure. In this post, I’ll focus on one of these tools, ftrace, and present a modification I made to make its filtering capabilities more versatile. Linux, besides being open source, provides tons of dynamic tools for debugging, and they are a great supplement to static reading of the code. Recently, while conducting research, I wanted to follow a specific kernel code flow: I was about to modify the behavior of an existing kernel mechanism, and I needed to understand the flow of data between different functions.Īs with any open source project you’re trying to analyze, your go-to assistant is the source code. It’s an amazing tool for tracing flows and events in the kernel, and it is very versatile - but what if it doesn’t fully support your use-case? If you’ve ever inspected a running Linux kernel, you probably heard of ftrace. Before joining Granulate, Yonatan served for nearly six years in the Israel Defense Forces as a Team Lead and R&D Specialist. Yonatan Goldschmidt is a senior software engineer at Granulate, overseeing the development and deployment of their real-time continuous optimization solution as an expert in low-level programming.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |