-
Notifications
You must be signed in to change notification settings - Fork 10
Decouple linux process specifics from elf dump file output #34
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
chris-oo
left a comment
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.
The overall shape of the PR seems reasonable, but some minor nitpicks and questions about dead code.
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
- This step is part of the move of linux specific functionality to separate file in preparation for decoupling the linux Process specific logic from the output of ELF dump file Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
- define ProcessInfoSource trait that describes a process information data relevant to an ELF dump - implement the trait for the existing Linux ProcessView to preserve the current behavior - create a `Box<dyn ReadProcessMemory>` by calling the `ProcessView` method `create_memory_reader` when the `ProcessInfoSource` is known to be a `ProcessView` or expect the reader as an argument when the `CoreDumpBuilder` is created `from_source` - add documentation and adjust visibility to types that now need to be public for the crate users to use when they define their own ProcessInfoSource implementation Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
- the crate supports creating core dumps from a custom given source not from a Pid Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
37af989 to
d3152cb
Compare
|
I took care of the comments above and modified the changes to address them and marked the conversation as resolved. |
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
|
I added a commit that changes the crate internally from using trait objects to generics.
|
chris-oo
left a comment
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.
other than the nested imports, LGTM. Happy to merge once that's fixed.
I assume you'll need a new release on crates.io? I'll see about also getting some folks on my team to review.
|
Thanks for the review. |
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
c07c8b3 to
cef4c80
Compare
Release version 2.0 that includes a breaking change to support a trait based method of building coredumps from #34.
Objective
I would like to use the ELF core dump generation on a system that does not have linux kernel.
The ELF core dump generation should work also on windows.
I need to create a core dump from the information I have about the guest running in a hypervisor isolated Hyperlight Sandbox (registers and guest memory).
Design decisions
ProcessViewtype to a separatelinuxmodule that can be conditionally compiled when the platform is linux.This was not needed, but I thought it would be easier to follow.
Description
I defined a
traitcalledProcessInfoSourcethat would provide the necessary information theelfcorecore dump output logic needs (pid, threads, regions, mapped_files, aux_vector, page_size).The already defined
ProcessViewnow implements this trait. Theelfcorecore dump output logic now takes aProcessInfoSourcetrait object that provides all the needed information. This decouples the core dump generation from theProcessViewtype that assumes a linux kernel.To provide the custom process information source, the
from_sourcemethod was added toCoreDumpBuilderto create a customCoreDumpBuilderthat takes the custom info from a provided source and memory reader.