D40466: HW-assisted tracing
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 08 Aug 2023 14:12:52 UTC
Hello, I have been working on the new tracing framework to provide instrumentation needed for technologies like ARM Coresight, ARM Statistical Profiling Extension (SPE), Intel Processor Trace (PT). My previous attempt on adding that functionality into hwpmc(4) fail so I decided to try again. So the new framework manages hardware technology that collects information about software execution and records it as "events" in highly compressed format into DRAM. The events cover information about control flow changes of a program, whether branches taken or not, exceptions taken, timing information, cycles elapsed and more. That allow us to restore entire program flow of a given application without performance impact. With this we can get the call trace and (with some effort of tracing analysis) understand how many times functions are called, how much time we spent in a single function, how we been interrupted and what we were doing inside the functions. We can trace individual threads of an executable in userspace or whatever CPU activity (of a specified IP range) in kernel mode, regardless of a thread. Currently targeting ARM Coresight support. Hovewer, my colleague in ARM Ltd is working on adding SPE support to it. I have some snippets for Intel PT as well, if someone is interested on adding PT support then let me know and I can help. https://reviews.freebsd.org/D40466 Ruslan