Created
August 25, 2021 16:44
-
-
Save robbmanes/106a87fad13d001b4835c44f1ea8658c to your computer and use it in GitHub Desktop.
Trace sending and receiving of SIGKILL on Linux systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stap | |
probe begin { | |
printf("Watching for signal(9) and reporting sender and receiver statuses...\n"); | |
} | |
probe signal.syskill { | |
if(sig == 9) { | |
printf("[%s] SEND===> PID %d (%s) sent signal %d (%s) to PID %d (%s)\n", | |
ctime(gettimeofday_s()), | |
pid(), | |
execname(), | |
sig, | |
sig_name, | |
sig_pid, | |
pid_name); | |
print_backtrace() | |
} | |
} | |
probe signal.handle { | |
if(sig == 9) { | |
printf("[%s] RECV<=== PID %d (%s) has received signal %d (%s)\n", | |
ctime(gettimeofday_s()), | |
pid(), | |
execname(), | |
sig, | |
sig_name); | |
print_backtrace() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment