layout |
---|
default |
#include <stdlib.h>
int main(void) {
system("bash -c pidof");
return 0;
}
strace -f <prog>
sudo perf record -e 'syscalls:sys_enter_*' -e 'sched:sched_*' <prog>
sudo perf script
sudo perf record -e 'sched:sched_process_fork' -a
sudo perf script
sudo perf record -e 'sched:sched_process_fork' -e 'sched:sched_process_exec' -a
sudo perf script
It only fork once, which is called by system(3)
.