This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Systemtap Upcoming Feature: Address to File:Line Mapping
- From: Abe Jakop <ajakop at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 19 Dec 2014 18:19:36 -0500 (EST)
- Subject: Re: Systemtap Upcoming Feature: Address to File:Line Mapping
- Authentication-results: sourceware.org; auth=none
- References: <252539308 dot 11641276 dot 1418658500370 dot JavaMail dot zimbra at redhat dot com> <2066955740 dot 484444 dot 1418939520703 dot JavaMail dot zimbra at redhat dot com> <y0mtx0ru0mq dot fsf at fche dot csb>
----- 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