New corelens module: pstack#183
Merged
brenns10 merged 11 commits intooracle-samples:mainfrom Aug 25, 2025
Merged
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]>
Member
Author
|
This is ready for review. Since most of the functionality can be exercised on a live system via |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: