Loading…
Wednesday, June 28 • 15:05 - 15:45
Leveraging Compiler Code Instrumentation for Zephyr Tracing & Profiling Tools - Gustavo Romero & Kevin Townsend, Linaro

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
Most profiling and tracing features in Zephyr today either depend on proprietary and expensive tooling, or have significant platform limitations. For instance, Segger's SystemView, which requires J-Link, or gprof, which only supports a few platforms -- often emulated -- like native_posix, and native_posix_64 platforms, with no timestamp data associated with events.

Clang and GCC compilers provide entry/exit instrumentation for functions via the -finstrumentation-functions flag. This flag allows for a specific function to be called on any function entry/exit event, which we can leverage to generate code tracing and profiling information.

In this presentation, the authors propose and demonstrate a platform, tooling, and arch-neutral subsystem based on compiler function instrumentation for Zephyr. Possible ways to display the collected data, like flame graphs, are also presented.

The new tool can be used for:

A) Tracing, meaning it can be used to generate an instrumented call graph, including timestamps, limited by the number of entry/exit events that can fit into a memory buffer. 

B) Profiling, meaning it can be used to calculate the overall runtime spent in the top 'n' functions, plus the entry/exit counts for said functions, without much concern for a memory buffer overrun.

Speakers
avatar for Kevin Townsend

Kevin Townsend

Technical Lead, Linaro
Embedded systems engineer specialising in 32-bit ARM-based design and development, embedded security, and wireless technology (BLE, 802.15.4, etc.). Maintainer for Zephyr RTOS of: AArch32, TF-M Integration, and author of zscilib (Zephyr Scientific Computing Library). Long time contributor... Read More →
avatar for Gustavo Romero

Gustavo Romero

Software Engineer, Linaro
I'm a FOSS developer with a strong background in Linux and primarily focused on kernel and compiler development, bug fixing, and performance. I'm an OpenJDK and an Apache TVM Committer. On Linaro currently, I work focused on Apache TVM ML compiler framework for ARM MCUs and the Zephyr... Read More →



Wednesday June 28, 2023 15:05 - 15:45 CEST
Chamber Hall (Level 3)
  Zephyr Project Developer Summit