syscalltimes in examples

linxz02@ovi.com linxz02@ovi.com
Thu Feb 23 05:00:00 GMT 2012


Hello David,

It looked that syscalltimes from 1.7 eliminates most similar bugs but not all:

xzl@t500.felix-3[SystemTap-1.7]$ sudo ./syscalltimes -n com.android.browser
Creating and building SystemTap module...
Pass 1: parsed user script and 79 library script(s) using 16348virt/12488res/1676shr kb, in 110usr/20sys/133real ms.
semantic error: unresolved type : identifier 'f_pid' at <input>:66:16
        source:                 if (pid() in f_pid) {
                                             ^
semantic error: unresolved type : identifier 'f_uid' at :70:16
        source:                 if (uid() in f_uid) {
                                             ^
semantic error: unresolved type : identifier 'f_pid' at :4:16
        source: global f_exec, f_pid, f_uid
                               ^
semantic error: unresolved type : identifier 'f_uid' at :4:23
        source: global f_exec, f_pid, f_uid
                                      ^
Pass 2: analyzed script: 585 probe(s), 67 function(s), 25 embed(s), 11 global(s) using 148340virt/63120res/2664shr kb, in 1230usr/190sys/1424real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.

Note that my line numbers here may not match the official version (http://sourceware.org/systemtap/examples/process/syscalltimes).Those errors are from function probe syscall.*.return().

To apply my modifications:

probe syscall.*.return {
# Skip if we have not seen this before
if (!([name, tid()] in starttime)) next

delta = gettimeofday_ns() - starttime[name, tid()]

# Check filters
if ('$FILTER') {
target = 0
        if ('$F_PID') {
    if (pid() in f_pid) {
    timebypid[name, pid()] <<< delta
    target = 1
    }
        }
        if ('$F_UID') {
    if (uid() in f_uid) {
    timebyuid[name, uid()] <<< delta
    target = 1
    }
        }
        if ('$F_EXEC') {
    if (execname() in f_exec) {
    timebyexec[name, execname()] <<< delta
    target = 1
    }
        }
} else
target = 1

.....

Now the scripts looks (partially?) OK:

xzl@t500.felix-3[SystemTap-1.7]$ sudo ./syscalltimes -n com.android.browser
Creating and building SystemTap module...
Pass 1: parsed user script and 79 library script(s) using 16252virt/12512res/1684shr kb, in 120usr/10sys/130real ms.
Pass 2: analyzed script: 585 probe(s), 39 function(s), 25 embed(s), 7 global(s) using 148516virt/63268res/2664shr kb, in 1170usr/230sys/1408real ms.
Pass 3: translated to C into "/tmp/stapqMiUrx/syscalltimes_src.c" using 148372virt/65512res/4968shr kb, in 170usr/60sys/235real ms.
syscalltimes.ko
Pass 4: compiled C into "syscalltimes.ko" in 16990usr/340sys/18079real ms.

Thanks very much.

-Felix

----- Original Message -----
> From: David Smith <dsmith@redhat.com>
> To: linxz02@ovi.com
> Cc: systemtap@sourceware.org
> Sent: Wednesday, February 22, 2012 11:54 AM
> Subject: Re: syscalltimes in examples
> 
> On 02/22/2012 11:15 AM, linxz02@ovi.com wrote:
> 
>>  Hi All,
>> 
>>  I'm using SystemTap-1.3. I was wondering whether I captured a bug in 
> the example of syscalltimes.
> 
> 
> Version 1.3 is pretty old (it is from 2010-07-21).  The current version
> is 1.7.  Is there any possibility of getting you to upgrade?
> 
>> 
>>  When I run syscalltimes as it is, I see a bunch of errors saying unresolved 
> types. It turned out
> 
>>  that the following patch will work:
> 
> ... patch deleted ...
> 
> Which version of syscalltimes do you have, the one that might have come
> with 1.3 or the current version?  Looks like Mark Wielaard updated this
> script in Sep. 2011 to fix similar errors.  The following link contains
> the latest version of the script:
> 
> <http://sourceware.org/systemtap/examples/process/syscalltimes>
> 
> The current version of the script works well with systemtap 1.7.
> 
> -- 
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)
>



More information about the Systemtap mailing list