Function probe return

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Function probe return

philippe
Hi

I'm trying to run this script:

probe process("/opt/xxx/bin/swim").function("CREATE_LOGBOOK").call{
        time_call[probefunc()] = gettimeofday_us()                    
        printf("%-s call: %-d\n", probefunc(), time_call[probefunc()])
}                                                                    
                                                                       
probe process("/opt/xxx/bin/swim").function("CREATE_LOGBOOK").return{
        time = gettimeofday_us() - time_call[probefunc()]              
        printf("%-s: %-d us\n", probefunc(), time)                      
}                                

stap fails with the following error:
 root@p4080ds:/tmp#  stap -v timestamp_logbook_calls.stp
Pass 1: parsed user script and 90 library script(s) using 20688virt/14028res/1560shr/13196data kb, in 440usr/0sys/437real ms.
semantic error: while resolving probe point: identifier 'process' at timestamp_logbook_calls.stp:25:7
        source: probe process("/opt/xxx/bin/swim").function("CREATE_LOGBOOK").return{
                      ^

semantic error: process return probes not available [man error::inode-uprobes]
Pass 2: analyzed script: 8 probe(s), 147 function(s), 4 embed(s), 2 global(s) using 121640virt/16584res/2968shr/14212data kb, in 40usr/150sys/200real ms.
Pass 2: analysis failed.  [man error::pass2]

If the probe process("/opt/xxx/bin/swim").function("CREATE_LOGBOOK").return is commented, it works fine.

Why does the "call" work and not the "return"?

stap version 2.1/0.148
system: Linux 3.8.13-rt9 (powerpc)

Philippe
Reply | Threaded
Open this post in threaded view
|

Re: Function probe return

Josh Stone-5
On 09/11/2013 08:00 AM, philippe wrote:
> semantic error: while resolving probe point: identifier 'process' at
> timestamp_logbook_calls.stp:25:7
>         source: probe process("/opt/xxx/bin/swim").function("CREATE_LOGBOOK").return{
>                       ^
>
> semantic error: process return probes not available [man error::inode-uprobes]

> Why does the "call" work and not the "return"?

The second "semantic error" line tells the real reason.  Return probes
were a feature of our external uprobes module for older utrace-patched
kernels, but the initial inode-based uprobes built into the kernel
lacked return probes.  Starting in kernel 3.10, process return probes
should work again.