-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add SymbolIndex and kallsyms helpers #388
Commits on Sep 30, 2024
-
libdrgn: util: add qsort_arg() helper function
In commit c8ff872 ("Support systems without qsort_r"), usage of qsort_r was eliminated because it is a glibc extension. There was discussion of creating a utility function that implements qsort_r(), but the approach described uses thread local variables, so it is not actually reentrant, and it was dropped to avoid confusion. However, upcoming commits will also prefer a comparator function which takes an argument, and they also won't require a reentrant implementation. Add this helper in with a name that shouldn't spark confusion: qsort_arg(). Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 395071a - Browse repository at this point
Copy the full SHA 395071aView commit details -
python: Add helper for returning list of Symbols
This will be reused in an upcoming commit. Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f64287a - Browse repository at this point
Copy the full SHA f64287aView commit details
Commits on Oct 10, 2024
-
libdrgn, python: add SymbolIndex
The Symbol Finder API gives us the ability to register a dynamic callback for symbol lookup. However, many common use cases are satisfied by a simple static list of symbols. Correct and efficient lookup in this simple case is rather tricky. Implement a new type, SymbolIndex, which can take a list of symbols and index them for efficient lookup by name or address. Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fda9b25 - Browse repository at this point
Copy the full SHA fda9b25View commit details
Commits on Oct 11, 2024
-
helpers: linux: add vmlinux kallsyms helpers
When properly configured, Linux contains its own symbol table within kernel memory at runtime. It is exposed as the /proc/kallsyms file, which is the easiest way to consume it, for live kernels. However, with recent changes to the Linux kernel in 6.0, necessary symbols are exposed within VMCOREINFO that allow us to interpret the data structures inside kernel memory, without needing debuginfo. This allows us to write helpers that can load kallsyms on vmcores, or on live systems. Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 151c9bc - Browse repository at this point
Copy the full SHA 151c9bcView commit details -
helpers: linux: add module kallsyms helpers
Add Python helpers which load module kallsyms and return a symbol index for them. Unlike the /proc/kallsyms and built-in kallsyms, these are quite easy to handle using regular Python & drgn code, so implement them as Python helpers. There are (at least) two use cases for these helpers: 1. After loading CTF and built-in vmlinux kallsyms, support for module kallsyms is still necessary. 2. Sometimes, people only extract vmlinux DWARF debuginfo. Adding module symbols can allow stack traces and other symbolization to work even without module debuginfo. Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 19ab162 - Browse repository at this point
Copy the full SHA 19ab162View commit details -
libdrgn: add lifetime to drgn_symbol, reduce copying
The SymbolIndex structure owns the memory for symbols and names, and once added to the Program, it cannot be removed. Making copies of any of these symbols is purely a waste: we should be able to treat them as static. So add a lifetime and allow the SymbolIndex to specify static, avoiding unnecessary copies and frees. Signed-off-by: Stephen Brennan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ee3f77f - Browse repository at this point
Copy the full SHA ee3f77fView commit details