public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/17749] New: stap doesn't recognize "++" as a use
@ 2014-12-22 21:12 tromey at sourceware dot org
  2014-12-23  1:49 ` [Bug translator/17749] " fche at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2014-12-22 21:12 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 17749
           Summary: stap doesn't recognize "++" as a use
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: tromey at sourceware dot org

Consider this script:

global found = 0;
global found_pid = -1;
global sigstop = 19;

probe kernel.trace("signal_deliver") {
  if (pid() == found_pid && $sig == sigstop) {
    printf("%d\n", pid());
    exit();
  }
}

probe kernel.trace("sched_process_exec") {
  if (execname() =~ @1 && ++found == 1) {
    found_pid = pid();
    raise(sigstop);
  }
}

I ran it like so:

pokyo. sudo stap -g preattach.stp '.*ls.*'
29505
found=0x1


It printed out "found=0x1", but I think it should not have.

On irc jlebon pointed out:

<jlebon> normally stap prints written-to but never read-from globals at
     shutdown
<jlebon> I think it doesn't see that it is being read


I modified the script, on his suggestion, to hoist the ++found out of
the condition.  This suppressed the extraneous output.

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

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

end of thread, other threads:[~2015-01-30 16:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-22 21:12 [Bug translator/17749] New: stap doesn't recognize "++" as a use tromey at sourceware dot org
2014-12-23  1:49 ` [Bug translator/17749] " fche at redhat dot com
2015-01-15 18:07 ` jlebon at redhat dot com
2015-01-15 19:44 ` jistone at redhat dot com
2015-01-23 17:12 ` jlebon at redhat dot com
2015-01-23 17:16 ` jlebon at redhat dot com
2015-01-23 17:37 ` fche at redhat dot com
2015-01-23 18:17 ` jlebon at redhat dot com
2015-01-30 16:44 ` jlebon 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).