public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mcermak at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/14924] warn on complex $ptr->foo expressions in .return probes
Date: Fri, 11 Nov 2016 12:17:00 -0000	[thread overview]
Message-ID: <bug-14924-6586-FsPaKmcmUf@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14924-6586@http.sourceware.org/bugzilla/>

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

--- Comment #8 from Martin Cermak <mcermak at redhat dot com> ---
Created attachment 9622
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9622&action=edit
possible patch

(In reply to Frank Ch. Eigler from comment #7)
> IMHO, we should warn even for plain  .return {$var}  constructs

Attached patch does that. I've -p2'd all the return probes and it looks fine
except one problem: For example:

Probe signal.send.return is only defined in the tapset for systemtap_v <=
"2.1".  So, when a user runs modern stap without --compatible, and her script
refers to probe signal.send.return, then this probe gets constructed using
probe signal.send, which actually is defined in the tapset. But since it is an
"entry" probe used as a "return" probe, the translator shows misleading warning
like this:

=======
$ stap --poison-cache  -e "probe signal.send.return {exit()}"  -p2 >/dev/null
WARNING: confusing usage, consider @entry($t) in .return probe: identifier '$t'
at /usr/local/share/systemtap/tapset/linux/signal.stp:76:28
 source:     task = @choose_defined($t, $p)
[ ... stuff deleted ... ]
=======

Let's list the linux/signal.stp:76 neighbourhood:

=======
  73 probe __signal.send.send_sigqueue = kernel.function("send_sigqueue")       
  74 {                                                                          
  75     name = "send_sigqueue"                                                 
  76     task = @choose_defined($t, $p)                                         
  77     sig = @choose_defined($q->info->si_signo, $sig)                        
  78     sinfo = @choose_defined($q->info, 0)                                   
  79     shared = 0                                                             
  80 %( systemtap_v <= "2.1" %?                                                 
  81     send2queue = 1                                                         
  82 %)                                                                         
  83 }
=======

So, that's misleading, since adding @entry() there would break the probe.

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

  parent reply	other threads:[~2016-11-11 12:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 21:49 [Bug translator/14924] New: " fche at redhat dot com
2016-10-17 15:31 ` [Bug translator/14924] " mcermak at redhat dot com
2016-10-17 17:24 ` jistone at redhat dot com
2016-11-08  9:36 ` mcermak at redhat dot com
2016-11-08 18:39 ` fche at redhat dot com
2016-11-08 18:54 ` jistone at redhat dot com
2016-11-10 15:32 ` mcermak at redhat dot com
2016-11-10 19:16 ` fche at redhat dot com
2016-11-11 12:17 ` mcermak at redhat dot com [this message]
2016-11-11 17:00 ` jistone at redhat dot com
2016-11-14 15:51 ` mcermak at redhat dot com
2016-11-18 13:32 ` mcermak at redhat dot com
2016-11-18 15:25 ` mcermak 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-14924-6586-FsPaKmcmUf@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).