public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/24327] New: @defined unable to handle $$parms and $$vars meta variables
@ 2019-03-12 20:16 wcohen at redhat dot com
  2019-03-13 18:16 ` [Bug translator/24327] " wcohen at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wcohen at redhat dot com @ 2019-03-12 20:16 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 24327
           Summary: @defined unable to handle $$parms and $$vars meta
                    variables
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: wcohen at redhat dot com
  Target Milestone: ---

When trying to get varwatch.stp example functioning again found that systemtap
failed to do the translation due to a problem with @defined.  Reduced the issue
down to the following reproducers using the meta variable $$parms and $$vars:

[wcohen@apm-mustang-b0-03 general]$ sudo stap -v -e 'probe
kernel.statement("do_sys_open@fs/open.c:*") {if (@defined($$vars))
{printf("have %s at %s \n", $$vars, pp()); exit()}}' 
Pass 1: parsed user script and 464 library scripts using
136888virt/117528res/8076shr/109268data kb, in 850usr/50sys/916real ms.
parse error: expected identifier or statistical operation
        saw: operator '-' at <input>:2:30
     source: foreach (__val = [__idx0] in -)
                                          ^
        in synthesized code from: identifier '$$vars' at <input>:1:65
     source: probe kernel.statement("do_sys_open@fs/open.c:*") {if
(@defined($$vars)) {printf("have %s at %s \n", $$vars, pp()); exit()}}
                                                                             ^

Segmentation fault
[wcohen@apm-mustang-b0-03 general]$ sudo stap -v -e 'probe
kernel.statement("do_sys_open@fs/open.c:*") {if (@defined($$parms))
{printf("have %s at %s \n", $$parms, pp()); exit()}}' 
Pass 1: parsed user script and 464 library scripts using
136888virt/117608res/8152shr/109268data kb, in 840usr/80sys/920real ms.
parse error: expected identifier or statistical operation
        saw: operator '-' at <input>:2:30
     source: foreach (__val = [__idx0] in -)
                                          ^
        in synthesized code from: identifier '$$parms' at <input>:1:65
     source: probe kernel.statement("do_sys_open@fs/open.c:*") {if
(@defined($$parms)) {printf("have %s at %s \n", $$parms, pp()); exit()}}
                                                                             ^

Segmentation fault


However, the $$return works fine:

[wcohen@apm-mustang-b0-03 general]$  sudo stap -v -e 'probe
kernel.function("do_sys_open").* {if (@defined($$return)) {printf("have %s at
%s \n", $$return, pp()); exit()}}' 
Pass 1: parsed user script and 464 library scripts using
136888virt/117508res/8056shr/109268data kb, in 800usr/130sys/928real ms.
WARNING: side-effect-free probe: keyword at <input>:1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
WARNING: side-effect-free probe: keyword at :1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
WARNING: side-effect-free probe: keyword at :1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
WARNING: side-effect-free probe: keyword at :1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
WARNING: side-effect-free probe: keyword at :1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
WARNING: side-effect-free probe: keyword at :1:1
 source: probe kernel.function("do_sys_open").* {if (@defined($$return))
{printf("have %s at %s \n", $$return, pp()); exit()}}
         ^
Pass 2: analyzed script: 13 probes, 4 functions, 1 embed, 0 globals using
219196virt/201100res/9452shr/191576data kb, in 2910usr/320sys/3238real ms.
Pass 3: translated to C into
"/tmp/stapmIShMf/stap_23a1216541622de325b5f556a74b2da3_5187_src.c" using
219196virt/201228res/9580shr/191576data kb, in 60usr/220sys/279real ms.
Pass 4: compiled C into "stap_23a1216541622de325b5f556a74b2da3_5187.ko" in
10070usr/730sys/10724real ms.
Pass 5: starting run.
have return=0x3 at kernel.function("do_sys_open@fs/open.c:1048").return 
Pass 5: run completed in 30usr/50sys/4931real ms.

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

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

end of thread, other threads:[~2019-03-13 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 20:16 [Bug translator/24327] New: @defined unable to handle $$parms and $$vars meta variables wcohen at redhat dot com
2019-03-13 18:16 ` [Bug translator/24327] " wcohen at redhat dot com
2019-03-13 18:26 ` wcohen at redhat dot com
2019-03-13 21:06 ` wcohen 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).