From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2295 invoked by alias); 30 Nov 2006 15:31:44 -0000 Received: (qmail 2286 invoked by uid 22791); 30 Nov 2006 15:31:43 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 30 Nov 2006 15:31:36 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kAUFVXlF023428; Thu, 30 Nov 2006 10:31:33 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kAUFVX0f005205; Thu, 30 Nov 2006 10:31:33 -0500 Received: from vpn-248-15.boston.redhat.com (vpn-248-15.boston.redhat.com [10.13.248.15]) by pobox.corp.redhat.com (8.13.1/8.12.8) with ESMTP id kAUFVQTD004469; Thu, 30 Nov 2006 10:31:32 -0500 Subject: Re: Instrumenting context switches From: Martin Hunt To: Perry Cheng Cc: systemtap@sourceware.org In-Reply-To: References: Content-Type: text/plain Organization: Red Hat Inc. Date: Thu, 30 Nov 2006 18:22:00 -0000 Message-Id: <1164900670.17130.3.camel@dragon> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2006-q4/txt/msg00559.txt.bz2 On Wed, 2006-11-29 at 18:25 -0500, Perry Cheng wrote: > probe kernel.function("__switch_to") > { > doSwitchTo(gettimeofday_us(), $prev_p, $next_p); > } > > function doSwitchTo(timeus:long, prev:long, next:long) > %{ > _stp_printf("SWITCHCOUNT = %ld\n", switchCount); > <------------------------------ BAD LINE > switchCount++; > }% Obviously the code fragment above is not exactly what you are using to reproduce the bug. (You can't use keywords as parameter names, uninitialized switchCount, "}%", etc). I tried the following and did not see any problems. Can you give more details (arch, OS, etc) on how to reproduce? %{ long switchCount = 1000000; %} function doSwitchTo (t:long, p:long, n:long) %{ _stp_printf("SWITCHCOUNT = %ld\n", switchCount); switchCount++; %} probe kernel.function("__switch_to") { doSwitchTo(gettimeofday_us(), $prev_p, $next_p); }