I'm not sure which tool to use for micro-benchmarking a C program.
I would like to measure both:
- Memory usage, RSS ( Resident Set Size )
- CPU cycles
I did use
perf record -g
and perf script
piped into an awk script. This worked for finding the memory usage, but CPU cycles weren't accurate because perf record
gets the cpu cycles by sampling. perf stat
is accurate but obviously doesn't give per-function stats. The perf_event library seems to be terribly documented and a meal of a task for simple benchmarking.
Having briefly looked at:
- SystemTap
- DTrace
- LTTng
- gperftools
- likwid
- PAPI
Which seem like decent, well-documented tools.
What would you recommend looking the most into? Or any other suggestions?
Thank you for your time.
Asked by jinTgreater
(1 rep)
Jan 19, 2024, 06:23 PM
Last activity: Jan 19, 2024, 11:20 PM
Last activity: Jan 19, 2024, 11:20 PM