-
Notifications
You must be signed in to change notification settings - Fork 22
New corelens module: pstack #183
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
Conversation
Signed-off-by: Stephen Brennan <[email protected]>
The pstack script allows dumping userspace stack traces for processes. It has a dump mode which only dumps minimal necessary information, suitable for use within a kdump kernel. Finally, it has a "print" mode to print the dumped contents. Import this script and make a small CorelensModule wrapper around it. We'll refine some of the functionality so that it can be supported in LKCE. The drgn file contrib/pstack.py was wholely contributed by me under drgn's license. As the author, I can also add it here under the UPL. Signed-off-by: Stephen Brennan <[email protected]>
In most vmcores, userspace tasks are not actually running: the CPU is executing a kernel-mode interrupt handler that brings it to a halt. Thus, the userspace registers are stored to the kernel stack. But for hypervisor vmcores, the CPU may be executing user code directly. In that case, drgn's stack trace registers are in fact the userspace registers. Handle this (rare) case. Signed-off-by: Stephen Brennan <[email protected]>
The original pstack implementation dumps data to multiple files: for each process, created one dump file for the JSON metadata, and another for the stack data. For large amounts of tasks, this can result in a lot of file creation, which can be unwieldy, and it's probably not a great idea to create thousands of tiny files in the kdump kernel. Move to a new format where everything is dumped to a single file. This requires a bit more code and a clear format definition, but the result is more efficient and easier to use. Signed-off-by: Stephen Brennan <[email protected]>
Signed-off-by: Stephen Brennan <[email protected]>
Previously, task selection could only be done with one CLI option. So a single PID could be specified, or a single command pattern, or a single task state. This is obviously not flexible enough. We would like to be able to select multiple patterns where possible. Implement this while ensuring we don't dump or print any tasks twice. Signed-off-by: Stephen Brennan <[email protected]>
In particular, take special care to highlight tasks that are actually running on CPU now, rather than simply in the runnable state. This is important because we allow selecting processes by their state or online status, so we want it to be obvious why a task is printed. Signed-off-by: Stephen Brennan <[email protected]>
Signed-off-by: Stephen Brennan <[email protected]>
Signed-off-by: Stephen Brennan <[email protected]>
For a while we've been beating around the bush by having a way to filter out which vmcores we run tests against. But that doesn't help filtering out kernel versions for live tests. Most new functionality doesn't necessarily need to work on UEK4, so we want it to be easy to skip tests below the minimum version. Signed-off-by: Stephen Brennan <[email protected]>
Signed-off-by: Stephen Brennan <[email protected]>
This is ready for review. Since most of the functionality can be exercised on a live system via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
This imports the pstack contrib script from drgn, and updates it. I'll end up pushing many of these updates back to drgn as well, but the main things are: