profile - Process or system profiler
$ profile [-p PID] [-a] [-e] [-d] [-f] [-w] [-t event_type] [COMMAND_TO_PROFILE]
profile
records profiling information that can then be read with ProfileViewer
.
-p PID
: Target PID-a
: Profile all processes (super-user only), result at /sys/kernel/profile-e
: Enable-d
: Disable-f
: Free the profiling buffer for the associated process(es).-w
: Enable profiling and wait for user input to disable.-t event_type
: Enable tracking specific event typeEvent type can be one of: sample, context_switch, page_fault, syscall, read, kmalloc and kfree.
# Enable whole-system profiling
$ profile -ae
# ...then, to stop
$ profile -ad
# Profile a running process, with PID 42
$ profile -p 42
# Profile syscalls made by echo
$ profile -t syscall -- echo "Hello friends!"
Profiler
(1) GUI for viewing profiling data produced by profile
.strace
(1)