This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Perfmon systemtap runtime support
- From: William Cohen <wcohen at redhat dot com>
- To: Chuck Ebbert <76306 dot 1226 at compuserve dot com>
- Cc: systemtap <systemtap at sourceware dot org>
- Date: Fri, 14 Jul 2006 11:50:21 -0400
- Subject: Re: Perfmon systemtap runtime support
- References: <200607140056_MC3-1-C4F7-5156@compuserve.com>
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