Bug 10174 - let stap -d take a symbol table file as argument, for dwarfless *symname()
Summary: let stap -d take a symbol table file as argument, for dwarfless *symname()
Status: RESOLVED WORKSFORME
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-20 11:27 UTC by Prerna
Modified: 2019-05-29 13:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2010-08-12 18:11:34


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prerna 2009-05-20 11:27:58 UTC
While probing a function like :

void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
                              void *timerf, char *comm,
                              unsigned int timer_flag)

one can determine only address of timer interrupt handler (timerf).
One needs to lookup /proc/kallsyms to lookup what handler-function name this
address corresponds to.

It'll proly be a good idea for systemtap translator/tapsets to have functions
for this.
Comment 1 Frank Ch. Eigler 2009-05-20 11:33:58 UTC
As a part of bug #6580, symname() has already been added to the tapset.
Comment 2 Prerna 2009-05-25 04:54:20 UTC
Subject: Re:  Enable stap to map function addresses
 to function names



fche at redhat dot com wrote:
> ------- Additional Comments From fche at redhat dot com  2009-05-20 11:33 -------
> As a part of bug #6580, symname() has already been added to the tapset.
>
>
>   
Thanks Frank !! This construct doesnt seem to work in dwarfless scenario 
(in probe kprobe.function{} context).
Any pointers on what could be done to get it working ?

Comment 3 Mark Wielaard 2009-05-25 07:25:30 UTC
(In reply to comment #2)
> Thanks Frank !! This construct doesnt seem to work in dwarfless scenario 
> (in probe kprobe.function{} context).
> Any pointers on what could be done to get it working ?

You need to add dwarf :)
stap -d kernel (or stap -d module-name) will make the symbols available by
reading them from the debuginfo.
Comment 4 Frank Ch. Eigler 2009-05-25 16:24:28 UTC
> > Thanks Frank !! This construct doesnt seem to work in dwarfless scenario 
> 
> You need to add dwarf :)
> stap -d kernel (or stap -d module-name) will make the symbols available by
> reading them from the debuginfo.

Yeah, but that seems to defeat the purpose of dwarfless probing.
Maybe extend -d to accept a (presumed) kernel symbol table file

  -d /lib/modules/`uname -r`/build/System.map

And the kprobes.* logic can add this to session.unwindsyms.  For
that matter, it could read the file (like in jkenisto's older
symbol-table-based probing implementation) to verify placement
of kernel-side symbol probes.
Comment 5 Frank Ch. Eigler 2019-05-29 13:47:13 UTC
With fedora-like distros, where gdb minidebuginfo symbol tables are
present in the executable, this sort of extra effort is not needed.
systemtap/elfutils can pull symbols out of there for usymname()
resolution purposes.

https://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html

but see also https://bugzilla.redhat.com/show_bug.cgi?id=1714804