0

Writing a SystemTap script (for Linux), and I want to make sure I catch the fact that a process has ended. What's the best way to do this (e.g., a particular kernel function, or an exhaustive list of ways a process could end like calling _exit())?

Thanks!

rivenmyst137
  • 345
  • 1
  • 4
  • 10

2 Answers2

0

Looks to me like the right thing is to probe do_exit. Someone correct me if I'm wrong.

rivenmyst137
  • 345
  • 1
  • 4
  • 10
0

Try

probe kprocess.release { printf("pid=%d tid=%d\n", released_pid, released_tid) }

or

probe kernel.trace("sched_process_exit") { printf("pid=%d tid=%d\n", task_pid($p), task_tid($p)) }
fche
  • 2,641
  • 20
  • 28