Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance Overhead of Perf Event Subsystem in Linux Kernel

Performance counters for Linux are a new kernel-based subsystem that provide a framework for all things performance analysis. It covers hardware level (CPU/PMU, Performance Monitoring Unit) features and software features (software counters, tracepoints) as well. Since 2.6.33, the kernel provide 'perf_event_create_kernel_counter' kernel api for developers to create kernel counter to collect system runtime information. What I concern most is the performance impact on overall system when tracepoint/ftrace is enabled. There are no docs I can find about them. I was once told that ftrace was implemented by dynamically patching code, will it slow the system dramatically?

like image 592
Bo Xiao Avatar asked May 08 '10 13:05

Bo Xiao


1 Answers

Dynamic patching is used as a way to minimize overhead when tracing isn't activated. The overhead of the PMU-based hardware counters should depend on how many different events you're sampling, and how often. It's probably low enough for you to find an acceptable configuration, depending on what you want. I would try enabling whatever information collection you're interested in, carefully set the frequency, and then check empirically whether the overhead is acceptable.

like image 107
Simon Ruggier Avatar answered Nov 15 '22 00:11

Simon Ruggier