Linux's Perf Python Scripts More Robust & Faster With Linux 7.4
Linux 7.4 has introduced significant updates to its performance monitoring tools, with a complete overhaul of the Python-based scripts to improve robustness and speed.
The most significant change in Linux 7.4's perf tooling is the complete adaptation of all Python-based scripts to use the Python perf module, enabling standalone execution. This overhaul includes improvements to lazy sample callchains, event copies, GIL handling, and enhanced session/thread lookup functionality.
The Python perf module was developed by Google's Ian Rogers as a Python C extension, which has resulted in substantially faster performance compared to the previous implementation. The update also introduces new features including treport, flamegraph, and sqlite/postgres exporters for better data visualization and storage options.
ARM64 enhancements
Linux 7.4 brings instruction tracking capabilities to ARM64 for data type profiling, resolving stack, global, per-CPU and 'current' variable accesses. This development allows the 'perf annotate --data-type' command to function similarly on ARM64 as it does on Linux x86/x86_64 architectures, providing more consistent performance analysis across different systems.
Additional improvements
Beyond the major Python script overhaul and ARM64 enhancements, Linux 7.4's perf tools include various other fixes and minor improvements. These updates were outlined in the pull request that merged the changes over the weekend, further refining the performance monitoring capabilities of the Linux kernel.