Bug 29150 - Would be useful to have a filter in eu-readelf like --name=<function>
Summary: Would be useful to have a filter in eu-readelf like --name=<function>
Status: NEW
Alias: None
Product: elfutils
Classification: Unclassified
Component: tools (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-15 19:04 UTC by Mark Wielaard
Modified: 2022-05-16 14:19 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2022-05-15 19:04:05 UTC
Copied from https://bugzilla.redhat.com/show_bug.cgi?id=1980026

For large executables like the linux kernel the human readable output of eu-readelf could be in the gigabytes.  llvm-dwarfdump has --name=<symbol_name> that allows the output to be limited to just DIEs with that symbol name.  So to see the DIEs and their children (-c) of function trace_event_name for kernel can do the following which is about 40K of output:

llvm-dwarfdump  -c --name=trace_event_name /usr/lib/debug/lib/modules/5.12.7-300.fc34.x86_64/vmlinux > trace_event_name.dwarf

Much easier to inspect 40KB of text than 4.8GB of the entire output from llvm-dwarfdump.  Would be nice if eu-readelf had similar filter for --debug-dump=info and ability to select whether to print children DIEs.

Documentation about the llvm-dwarfdump options is at https://llvm.org/docs/CommandGuide/llvm-dwarfdump.html .
Comment 1 Tom Tromey 2022-05-16 13:34:17 UTC
dwgrep can do this and way, way more.