memcache-stats

simplest tool to measure C program cache hit/miss and cpu time in linux?

佐手、 提交于 2019-11-27 02:47:59
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

simplest tool to measure C program cache hit/miss and cpu time in linux?

回眸只為那壹抹淺笑 提交于 2019-11-26 10:09:32
问题 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