Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added killsnoop, another snooping tool for tracing kill()s via ftrace #8

Merged
merged 1 commit into from Sep 16, 2014
Merged

Conversation

MegaMaddin
Copy link
Contributor

Hi Brendan,

first at all, your tools are awesome and excellent for learning kernel internals and for debugging problems.
I've added killsnoop for snopping kills, since I recently had the problem, that someone kills a worker application, which we where not able to locate the origin. In the end, it was a cleaning cron job, which kills long running (and hanging) processes :-)

Maybe someday, it will be useful for someone else.

Best regards,
Martin

@brendangregg
Copy link
Owner

Excellent, thanks! Good use of tracepoints, followed the style, did error messages.

Missing a man page and examples file, but I'll follow up and add those. It's very minor, but I wonder if instead of -f for signal name, it should be -s, to make it more memorable.

strtonum() doesn't exist for mawk, which I use for buffered output (since mawk is faster) with -d, but not interactive output (since mawk's flush is broken). We can fix it later somehow. I'm not sure the fix is simply to avoid mawk altogether and just use gawk/awk, since I think on some systems I've seen awk is mawk, and there isn't a gawk.

brendangregg added a commit that referenced this pull request Sep 16, 2014
added killsnoop, another snooping tool for tracing kill()s via ftrace
@brendangregg brendangregg merged commit e5164cd into brendangregg:master Sep 16, 2014
@brendangregg
Copy link
Owner

... and this is why I like writing examples files at the same time as the script. :-) So I'm writing documentation to explain that "KILLED" doesn't necessarily mean the process has been killed, since it depends on the signal, but this is feeling clumsy. I'll switch that column header to TPID for Target PID.

@MegaMaddin
Copy link
Contributor Author

Yep, you're right. Should I fix this and make another pull request?

@brendangregg
Copy link
Owner

It's ok, I'm about to commit the fix anyway with the docs.

@MegaMaddin
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants