From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6860 invoked by alias); 14 Jul 2006 15:50:32 -0000 Received: (qmail 6840 invoked by uid 22791); 14 Jul 2006 15:50:31 -0000 X-Spam-Status: No, hits=-3.1 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; Fri, 14 Jul 2006 15:50:29 +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 k6EFoMje021495; Fri, 14 Jul 2006 11:50:22 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k6EFoM3E010599; Fri, 14 Jul 2006 11:50:22 -0400 Received: from [172.16.59.187] (dhcp59-187.rdu.redhat.com [172.16.59.187]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k6EFoMQb030362; Fri, 14 Jul 2006 11:50:22 -0400 Message-ID: <44B7BD3D.3090700@redhat.com> Date: Fri, 14 Jul 2006 15:50:00 -0000 From: William Cohen User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chuck Ebbert <76306.1226@compuserve.com> CC: systemtap Subject: Re: Perfmon systemtap runtime support References: <200607140056_MC3-1-C4F7-5156@compuserve.com> In-Reply-To: <200607140056_MC3-1-C4F7-5156@compuserve.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q3/txt/msg00106.txt.bz2 Chuck Ebbert wrote: > In-Reply-To: <44B6C74E.7040008@redhat.com> > > On Thu, 13 Jul 2006 18:21:02 -0400, William Cohen wrote: > >>I have been working on getting some performance monitoring support into >>systemtap. The perfmon1.diff patch is a very simple addition to the >>runtime. It just has functions to setup the perfmon monitoring hardware, >>read a counter, and shutdown the performance monitoring hardware. It >>uses the perfmon2 kernel ABI to configure the hardware. >> >>I have completed changes to the translator to use the runtime functions. >>I took Marin's suggestion of using guru mode to allow access to the >>various C functions and wrote some examples that used the runtime functions. >> >>The cost is relatively high for accessing the counters. Below is the >>output from p2x.stp, counting the number of cycles between consecutive >>calls to read the cycle count: >> >>[wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp >>interval = 15491 > > > I modified your sample pure C module from a while ago and I get 500-700 > cycles overhead: I tried tried your example and I got similar numbers: Jul 14 11:47:40 dhcp59-187 kernel: val0 = 6595400, val1 = 6595847, interval = 447 Jul 14 11:47:41 dhcp59-187 kernel: val0 = 6842567, val1 = 6843068, interval = 501 I don't know why I got such high cycle counts yesterday. Running the same p2x.stp today I got lower cycle counts: [wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp interval = 1051 [wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp interval = 1009 [wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp interval = 650 [wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp interval = 1063 [wcohen@dhcp59-187 systemtap_perfmon]$ ./install/bin/stap -g p2x.stp interval = 983 -Will