From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91444 invoked by alias); 20 Jul 2015 18:15:04 -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 91433 invoked by uid 89); 20 Jul 2015 18:15:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f172.google.com Received: from mail-wi0-f172.google.com (HELO mail-wi0-f172.google.com) (209.85.212.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 20 Jul 2015 18:14:59 +0000 Received: by wibxm9 with SMTP id xm9so99016240wib.0 for ; Mon, 20 Jul 2015 11:14:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=Wj4TY3Ki/D3Bq5AfQ1APPqHf0r7odAhusI7A43ZjNY8=; b=iszuwm354180eVRS9JtVOAhos8IjMpS/mV4u9QF/y7mitjTRjGOGQNV6SbBjWoTRFs nmodT8aCr3RbWN26I7vDkUHMzu8nxa0Mt7kVDwqK0WIN2YTvPyrfbVV8tVSg0TmQ3k1H tcrseJX/jzjDjsNdn0EHJbsFKBn5ZK6coRTdjR6ejb/9feg+8VPt1nG4z1duuEn7EF7v wLd/KmG/ArEeMT4uhWUtjxSHTgBPGGDHyNwuIITNWdgMZ/aBBbnRTQElMlYihf49sBgR U57phbO6/kPCsm1P0jc7O5fuoWn0t0wBN2g8Snj68ogMiiJPYn7RVzeen1ER0aOXcroH KS3g== X-Gm-Message-State: ALoCoQkmUySqrUVLteQVWnvS+ZeKDbw5h3ob+iB8Xo+AXgi9+hp6DBxbGBvyRv0cJU241EsRgA9W X-Received: by 10.180.198.199 with SMTP id je7mr23827022wic.34.1437416096330; Mon, 20 Jul 2015 11:14:56 -0700 (PDT) Received: from [192.168.0.101] ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id ea2sm12932665wib.22.2015.07.20.11.14.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2015 11:14:55 -0700 (PDT) Message-ID: <55AD3A9F.4030703@linaro.org> Date: Mon, 20 Jul 2015 18:15:00 -0000 From: Zoltan Kiss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: systemtap@sourceware.org Subject: Array handling question Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-q3/txt/msg00042.txt.bz2 Hi, I have troubles to get what I want from linetimes.stp example, so I've decided to create my own somewhat simplified version. I'm currently interested in the average runtime of a function after a certain number of runs, but apparently it gives me values like 74279383992077, which is clearly wrong. And I have a feeling I'm misunderstanding something obvious about the array handling, but I couldn't figure out what. Could anyone give me an advice about what am I missing? Regards, Zoltan Kiss And here is my example script: global cnt = 0; global starttime = 0; global runtimes; probe process().function().call { starttime = gettimeofday_ns(); } probe process().function().return { runtime = gettimeofday_ns() - starttime; starttime = 0; runtimes <<< runtime; if (cnt > 50000) { printf("Runtime avg: %u\n", @avg(runtimes)); delete runtimes; cnt = 0; } cnt++; }