From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1960 invoked by alias); 22 Dec 2014 21:12:28 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 1406 invoked by uid 48); 22 Dec 2014 21:12:23 -0000 From: "tromey at sourceware dot org" To: systemtap@sourceware.org Subject: [Bug translator/17749] New: stap doesn't recognize "++" as a use Date: Mon, 22 Dec 2014 21:12:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00252.txt.bz2 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: normally stap prints written-to but never read-from globals at shutdown 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.