Under CentOS what commandline will profile my C program including the time spent in system calls? What programs do I need to install with yum?
1
Install oprofile: yum install oprofile
Initialize oprofile:
opcontrol --no-vmlinux #If you have vmlinux set this option differently
opcontrol --init
opcontrol --reset
opcontrol --separate=lib
opcontrol --callgraph=0 # clear callgraph in case it was used recently
opcontrol --start
Now run the program to be profiled. Once it has run long enough, do the following:
opcontrol --dump
opreport --symbols /path/to/executable
See here for some other example outputs.
yum install perf
in CentOS6) – osgx Oct 11 '12 at 20:57