simplest tool to measure C program cache hit/miss and cpu time in linux?
I'm writing a small program in C, and I want to measure it's performance. I want to see how much time do it run in the processor and how many cache hit+misses has it made. Information about context switches and memory usage would be nice to have too. The program takes less than a second to execute. I like the information of /proc/[pid]/stat, but I don't know how to see it after the program has died/been killed. Any ideas? EDIT: I think Valgrind adds a lot of overhead. That's why I wanted a simple tool, like /proc/[pid]/stat, that is always there. Use perf : perf stat ./yourapp See the kernel