Hacker News new | ask | show | jobs
by pebblexe 3370 days ago
Does anyone know of an easy way to interact with performance monitor counters in Linux? I've been reading stuff by Brendan Gregg about DTrace and the importance of PMCs, and it made it sound like Linux doesn't have the equivalent.
5 comments

Yes, this is what "perf stat <command>" does. Add more -d options to see more counters, or use -e to ask for specific counter(s) ("perf list" to list them).
Another nice tool is likwid. It lets you select a performance counter group (e.g. L3 CACHE) to monitor while running a program. It also provides derived metrics.

https://github.com/RRZE-HPC/likwid

There are multiple tools, and that's all Brendan Gregg has been talking about for years. Read any non-ancient posts on his blog.
it's not quite there (AFAIK) yet but here's an attempt https://github.com/dtrace4linux/linux