Bug 1005301 - process probes do not parse
Summary: process probes do not parse
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-06 15:45 UTC by Andi Kleen
Modified: 2013-09-06 16:48 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-06 16:42:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Andi Kleen 2013-09-06 15:45:45 UTC
Description of problem:

tprobe.c:
#include <sys/sdt.h>

main()
{
        DTRACE_PROBE2(test, main, 1, 2);
}

gcc -g -o tprobe tprobe.c

tprobe.stp:
probe process("tprobe").mark("test") { 
        println($arg1)
        println($arg2) 
}

$ sudo stap tprobe.stp 
semantic error: while resolving probe point: identifier 'process' at tprobe.stp:2:7
        source: probe process("tprobe").mark("test") { 
                      ^

semantic error: no match
Pass 2: analysis failed.  [man error::pass2]





Version-Release number of selected component (if applicable):
systemtap-2.3-1.fc19.x86_64
kernel  3.10.10-200.fc19.x86_64 
How reproducible:

Always

Steps to Reproduce:
1. see above
2.
3.

Actual results:
See above

Expected results:

Parse the file, probe the probe.


Additional info:

Comment 1 Frank Ch. Eigler 2013-09-06 16:01:13 UTC
Hi, Andi.  This just works for me on f19, with same stap version,
but a somewhat earlier kernel (3.10.5).  Can you try ...

% readelf -n tprobe
% stap --vp 03 -L 'process("tprobe").mark("*")'

Comment 2 Lukas Berk 2013-09-06 16:03:52 UTC
I think actual error here is that the .mark parameter should be .mark("main").  The 'test' parameter is what's referred to as the provider.

More information can be found at https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps

an alternative probe point could also be process("tprobe").provider("test").mark("main"){...}

Comment 3 Frank Ch. Eigler 2013-09-06 16:05:01 UTC
Good eyes, Lukas.

Comment 4 Andi Kleen 2013-09-06 16:42:28 UTC
Ok I tracked it down. It seems to be related to stap not seeing the binary (plus the typo)

Perhaps the documentation should be clearer on this.

For example if I specify an absolute path, does it always match the same binary even when called non absolute? I presume it does because it's matching on the inode.

Comment 5 Frank Ch. Eigler 2013-09-06 16:48:05 UTC
The stapprobes man page includes this:

> Note that for all process probes, PATH names refer to executables
> that are searched the same way shells do: relative to the working
> directory if they contain a "/" character, otherwise in $PATH.
> [...]

The runtime will indeed match things absolutely, not just by inode but
via elf build-ids.


Note You need to log in before you can comment on or make changes to this bug.