public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/16478] New: stap -l process.function.label listing not just labels
@ 2014-01-21 20:10 jlebon at redhat dot com
  2014-01-21 20:22 ` [Bug translator/16478] " jistone at redhat dot com
  2014-01-22 21:08 ` jlebon at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jlebon at redhat dot com @ 2014-01-21 20:10 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16478

            Bug ID: 16478
           Summary: stap -l process.function.label listing not just labels
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jlebon at redhat dot com

Compile testsuite/systemtap.base/labels.c:

$ gcc testsuite/systemtap.base/labels.c -g -lm -o labels.x
$ 

Then try to list the labels:

$ stap -l 'process("labels.x").function("*").label("*")'
process("/home/vm/codebase/systemtap/build/labels.x").function("__do_global_dtors_aux")
process("/home/vm/codebase/systemtap/build/labels.x").function("__libc_csu_fini")
process("/home/vm/codebase/systemtap/build/labels.x").function("__libc_csu_init")
process("/home/vm/codebase/systemtap/build/labels.x").function("__libc_start_main@@GLIBC_2.2.5")
process("/home/vm/codebase/systemtap/build/labels.x").function("_fini")
process("/home/vm/codebase/systemtap/build/labels.x").function("_init")
process("/home/vm/codebase/systemtap/build/labels.x").function("_start")
process("/home/vm/codebase/systemtap/build/labels.x").function("deregister_tm_clones")
process("/home/vm/codebase/systemtap/build/labels.x").function("foo@/home/vm/codebase/systemtap/build/labels.c:5").label("init_an_int")
process("/home/vm/codebase/systemtap/build/labels.x").function("frame_dummy")
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:16").label("init_an_int")
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:18").label("init_an_int_again")
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:21").label("ptr_inited")
process("/home/vm/codebase/systemtap/build/labels.x").function("register_tm_clones")
$

Even regular functions show up in the listing. This also happens when we
specify a label e.g. .label("ptr_inited") will still list all the functions and
labels.

I believe this is due to the function("*"), which will match all other
functions. For example, this works as expected:

$ stap -l
'process("labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c").label("*")'
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:16").label("init_an_int")
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:18").label("init_an_int_again")
process("/home/vm/codebase/systemtap/build/labels.x").function("main@/home/vm/codebase/systemtap/build/labels.c:21").label("ptr_inited")
$

(Note that the main function was not listed on its own)

This also means that a script like this:

stap -e 'process("myproc").function("*").label("label_prefix*") { next }' will
not only trigger whenever labels are crossed, but also when functions are
entered. Do we want to change this behaviour?

Along these lines, it might be interesting to have a pplabel() tapset function.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug translator/16478] stap -l process.function.label listing not just labels
  2014-01-21 20:10 [Bug translator/16478] New: stap -l process.function.label listing not just labels jlebon at redhat dot com
@ 2014-01-21 20:22 ` jistone at redhat dot com
  2014-01-22 21:08 ` jlebon at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2014-01-21 20:22 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16478

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
(In reply to Jonathan Lebon from comment #0)
> $ stap -l 'process("labels.x").function("*").label("*")'

If you look at "... -vv |& grep pc=", you'll see those extras are all FUNC@:-1,
which is a sign that these were resolved through the symtab.  We should not
attempt symbtab at all for .label probes. (dwarf_query::has_label)

> Along these lines, it might be interesting to have a pplabel() tapset function.

Sure, sounds fine.  There are probably a lot of ppX() we could do, but this one
should be pretty straightforward.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug translator/16478] stap -l process.function.label listing not just labels
  2014-01-21 20:10 [Bug translator/16478] New: stap -l process.function.label listing not just labels jlebon at redhat dot com
  2014-01-21 20:22 ` [Bug translator/16478] " jistone at redhat dot com
@ 2014-01-22 21:08 ` jlebon at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jlebon at redhat dot com @ 2014-01-22 21:08 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16478

Jonathan Lebon <jlebon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Jonathan Lebon <jlebon at redhat dot com> ---
Fixed in commit 3449dd5.

(In reply to Jonathan Lebon from comment #0)
> Along these lines, it might be interesting to have a pplabel() tapset
> function.

Added in commit 887d4fe.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-22 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-21 20:10 [Bug translator/16478] New: stap -l process.function.label listing not just labels jlebon at redhat dot com
2014-01-21 20:22 ` [Bug translator/16478] " jistone at redhat dot com
2014-01-22 21:08 ` jlebon at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).