Bug 12276 - lookup functions & uploaded-data for address->file:line mappings
Summary: lookup functions & uploaded-data for address->file:line mappings
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Abe Jakop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 00:02 UTC by Frank Ch. Eigler
Modified: 2015-02-06 19:43 UTC (History)
1 user (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 Frank Ch. Eigler 2010-12-01 00:02:13 UTC
In order to do finer-grain-than-function profiling, it's desirable
to map a random PC to something more precise than [u]symdata() gives.

It may be practical to upload subsets/variants of the .debug_line data,
in order to enable a [u]symfileline() function that would produce a
file:line# string.  With that, this ditty should give a nice
line-by-line profile, as in opannotate --assembly.

global prof
probe timer.profile {
  prof [(user_mode() ? usymfileline(uaddr()) : symfileline(addr() /*?*/)] <<< 1
}

probe end {
  foreach (fileline+ in prof) {
     printf("%20s %6d\n", fileline, @count(prof[fileline]))
  }
}
Comment 1 Abe Jakop 2015-02-06 19:43:00 UTC
completed in merge 5ac123032cf46d7fecaf62803537ffc4de7b0f38