News for hackers. Stuff that matters.
Re:Apple's new Processor Trace instrument is incredible by GeekyBear on Saturday August 16, 2025 @06:50PM (#44927509)
> Potentially interesting, but it's not really clear whether this is anything new or not. valgrind + kcachegrind does this too.

Looking at the kcachegrind homepage, it doesn't sound like they are pulling their data directly from the CPU core itself:

> Callgrind uses runtime instrumentation via the Valgrind framework for its cache simulation and call-graph generation.

https://kcachegrind.github.io/html/Home.html

Apple seems to have modified it's core design so that it will stream data to a log file while the code is running.

> Recent Apple silicon devices can capture a processor trace where the CPU stores information about the code it runs, including the branches it takes and the instructions it jumps to. The CPU streams this information to an area on the file system so that you can analyze it with the Processor Trace instrument.

Re:Apple's new Processor Trace instrument is incredible by jauntywundrkind on Saturday August 16, 2025 @07:06PM (#44927574)
Intel has a Performance Monitoring Unit on its core that has significant overlap.

Forgetting this tool-space, but at least some of these tools can make use of that hardware:

https://github.com/intel/pcm https://github.com/andikleen/pmu-tools

Re:Apple's new Processor Trace instrument is incredible by kaladin-jasnah on Saturday August 16, 2025 @08:26PM (#44927959)
IIRC perf does it as well.
Re:Apple's new Processor Trace instrument is incredible by do_not_redeem on Saturday August 16, 2025 @07:03PM (#44927560)
If you need data straight from the hardware you can use e.g. perf+hotspot, although I've heard that perf's tracing (not sampling!) supports fewer CPUs (but still more than just 1)