-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathsigkill.stp
33 lines (30 loc) · 1.09 KB
/
sigkill.stp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/stap
# sigkill.stp
# Copyright (C) 2007 Red Hat, Inc., Eugene Teo <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# /usr/share/systemtap/tapset/signal.stp:
# [...]
# probe signal.send = _signal.send.*
# {
# sig=$sig
# sig_name = _signal_name($sig)
# sig_pid = task_pid(task)
# pid_name = task_execname(task)
# [...]
probe signal.send {
if (sig_name == "SIGTERM" || sig_name == "SIGKILL") {
printf("%s was sent to %s (pid:%d) by %s uid:%d time:%dus\n",
sig_name, pid_name, sig_pid, execname(), uid(), gettimeofday_us())
printf("cmdline_arg(0) = %s\n", cmdline_arg(0))
printf("cmdline_arg(1) = %s\n", cmdline_arg(1))
printf("cmdline_arg(2) = %s\n", cmdline_arg(2))
printf("cmdline_arg(3) = %s\n", cmdline_arg(3))
printf("cmdline_arg(4) = %s\n", cmdline_arg(4))
printf("cmdline_arg(5) = %s\n", cmdline_arg(5))
printf("cmdline_str = %s\n", cmdline_str())
}
}