Profiling a Linux kernel code snippet in Intel VTune

285 views Asked by At

I am trying to profile a specific code snippet in a device driver in the Linux kernel. I want to know the hardware events that occur during the execution of this code block. I wanted to know whether this task can be done using Intel VTune.

I saw that VTune provides the ITT API for starting and stopping data collections at a specific place in the code, but I could not find out whether this method is compatible with kernel functions.

I currently use manual instrumentation in the kernel code and read performance counters using wrmsr and rdmsr assembly instructions. But I can only read 4 counters (in Intel Xeon Ice Lake) at a time without using multiplexing. I would like to read many uncore counters for my task.

Please let me know if someone has tried this or knows any alternative methods that can help with my task.

System details: Intel Xeon Silver 4314 Linux kernel 5.15

1

There are 1 answers

0
Jyothis V James - Intel On

Using Intel® VTune™ Profiler, can you try the instructions provided in the documentation for Linux Kernel Analysis: Enabling Linux Kernel Analysis - Intel® VTune™ Profiler

To collect additional counters, you can try using a custom collector as documented in the link: Custom Data Collection For Performance Analysis - Intel® VTune™ Profiler