Skip to content
New issue

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

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

Already on GitHub? # to your account

Application stack trace on oomkill. #3654

Open
syamajala opened this issue Oct 11, 2021 · 7 comments
Open

Application stack trace on oomkill. #3654

syamajala opened this issue Oct 11, 2021 · 7 comments

Comments

@syamajala
Copy link

Is it possible to get an application level stack trace on oomkill? Are there any examples of how I might write a script to do something like that?

@davemarchevsky
Copy link
Collaborator

tools/oomkill.py (and associated tools/oomkill_example.txt) are a good start. You'd have to add a bpf_get_task_stack call and associated changes to oomkill's perf buf output.

This would be a useful feature to add to oomkill so if you end up doing this please send a PR!

@brendangregg
Copy link
Member

Thanks, it would be a good addition. I wonder why I didn't do it. Note that you'd need to trace the application's receipt of the signal so you were in the right context for pulling a stack, so this would, involve adding a probe and a filter and state.

I'd consider giving it a switch, like -s for stack.

@syamajala
Copy link
Author

@brendangregg do you mean i need to trace SIGKILL?

Why isnt it enough to call bpf_get_task_stack on p?

@jshowacre
Copy link

I don't believe the application has received the signal at that point in the kprobe. I wonder if adding a kretfunc on send_signal would be viable.

@brendangregg
Copy link
Member

brendangregg commented Oct 13, 2021

Ah thanks @syamajala and @davemarchevsky, you're right, this could just use the newer bpf_get_task_stack() call.

@irenge
Copy link

irenge commented Aug 30, 2022

Hi
Is this issue still open ?
It sounds interesting. I d like to have a work on it

@vanzei
Copy link

vanzei commented Jun 10, 2024

Hi,
I'm new to Open Source and very curious about eBPF / BCC.

Looking into the open issues, as good first I crossed with this one which looking into @brendangregg comments I have an idea how to implement and I started documenting it as the Contributing page shows for biolatency. Is there a way I can learn how to test it properly before making a PR?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants