Systemtap Upcoming Feature: Address to File:Line Mapping
Abe Jakop
ajakop@redhat.com
Fri Dec 19 23:19:00 GMT 2014
----- Original Message -----
> From: "Frank Ch. Eigler" <fche@redhat.com>
> > [...] As for using this new feature, there are two new tapset
> > functions, usymfileline() and symfileline(). The former requires a
> > user-space address, and a kernel address for the the latter.
>
> Could we also have [u]symfile and/or [u]symline? That way, script
> code wouldn't need to parse [u]symfileline if they only wanted one
> or the other.
Yes. I will add those functions into the tapset library.
> > Since this feature stores line data for runtime access,
> > using this feature may result in large probe modules.
>
> Looking forward to advice as to whether further data
> compression may significantly help.
That's definitely on the list things to do for this feature.
> > [...]
> > linenumbers.stp
> > ===============
> > 1 probe process.statement("*") {
> > 2 printf("addr: %#x, file and line: %s\n",
> > 3 addr(), usymfileline(addr()) )
> > 4 }
>
> (uaddr() in this case.)
Oops. Good catch.
> Glancing at that pf3.stp sample, maybe [u]sym* family of functions
> should more regularly throw catchable errors in case of errors,
> instead of hard-coding a policy of returning a hexified parameter.
> That way the caller can more easily omit the info in its report. So,
>
> before:
>
> try { // modname() can throw
> fn = "k:".modname(addr()).":".symname(addr()).":".symfileline(addr())
> } catch {
> fn = "k:<unknown>:".symname(addr()).":".symfileline(addr())
> }
>
> after:
>
> try { part_1 = "k:".modname(addr()) }
> catch { part_1 = sprintf("k:%p",addr()) }
> try { part_2 = ":".symname(addr()) }
> catch { part_2 = "" }
> try { part_3 = ":".symfileline(addr()) }
> catch { part3 = "" }
> fn = part_1.part_2.part_3
Would this not cause backwards compatibility issues? Or were you thinking
this change would be effective for SystemTap versions >=2.7?
Should I open a PR for this change and another for the feature below?
> Hm, what if we had an expression-context try/catch? (Maybe a
> generalization of ? : ... sort of like @choose_defined()?)
>
> part_1 = "k:" . try_catch(modname(addr()), sprintf("%p",addr()))
> part_2 = try_catch(":".symname(addr()), "")
> part_3 = try_catch(":".symfilename(addr()), "")
> fn = part_1.part_2.part_3
>
> - FChE
Thanks for the feedback,
Abegail
More information about the Systemtap
mailing list