This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/17749] New: stap doesn't recognize "++" as a use


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]