public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/24327] New: @defined unable to handle $$parms and $$vars meta variables
Date: Tue, 12 Mar 2019 20:16:00 -0000	[thread overview]
Message-ID: <bug-24327-6586@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2019-03-12 20:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 20:16 wcohen at redhat dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24327-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).