Linux Kernel & OS

Linux 7.4 overhauls perf Python scripts for faster execution and standalone use

Key Takeaway

The perf subsystem in Linux 7.4 converts all Python scripts to a new C-extension module, significantly improving performance and enabling standalone execution while adding ARM64 data-type profiling parity with x86.

Summary

The perf subsystem tooling updates for Linux 7.4, merged this weekend, center on a comprehensive overhaul of Python-based performance analysis scripts. All perf Python scripts now use the Python perf module as a C extension, supporting standalone execution outside the traditional perf environment. The module introduces lazy sample callchains, improved GIL handling, better session and thread lookup, and new exporters for treport, flamegraph, and SQLite/PostgreSQL formats.

ARM64 gains instruction tracking for data type profiling, bringing perf annotate --data-type functionality to parity with x86/x86_64. This resolves previous limitations around stack, global, per-CPU, and 'current' variable accesses on the architecture. The changes originated from Google engineer Ian Rogers and build on earlier Phoronix coverage of the perf script command speed improvements.

What changes in Linux 7.4 perf tooling

  • Python module architecture: All perf Python scripts converted to use a proper Python perf module implemented as a C extension, replacing previous ad-hoc Python integration with a structured, standalone-capable design.
  • Performance optimizations: The module adds lazy sample callchains and lazy event copies, reducing overhead in script execution, plus improved GIL (Global Interpreter Lock) handling for better multi-threaded performance.
  • New exporters and utilities: Added treport functionality, flamegraph generation, and direct SQLite/PostgreSQL database exporters for perf data, expanding post-processing and visualization options.
  • ARM64 data-type profiling: Instruction tracking on ARM64 now supports data type profiling with resolved stack, global, per-CPU, and 'current' variable accesses, matching x86/x86_64 perf annotate --data-type behavior.
  • Session/thread infrastructure: Better session and thread lookup mechanisms improve script reliability when analyzing complex multi-process and multi-threaded workloads.

Why it matters

Performance engineers and kernel developers across distributions will see faster profiling workflows and more portable analysis scripts, reducing friction when sharing perf-based tooling across teams and CI systems. The ARM64 parity improvement specifically benefits cloud and server deployments on AWS Graviton, Ampere Altra, and other ARM64 platforms where data-type profiling was previously limited. Distribution packagers should note the new Python module dependency structure when preparing Linux 7.4 perf packages.

Original reference: www.phoronix.com →