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])) } }
completed in merge 5ac123032cf46d7fecaf62803537ffc4de7b0f38