From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8292 invoked by alias); 17 Mar 2006 17:34:26 -0000 Received: (qmail 8285 invoked by uid 22791); 17 Mar 2006 17:34:26 -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; Fri, 17 Mar 2006 17:34:24 +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 k2HHYN1W019186 for ; Fri, 17 Mar 2006 12:34:23 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k2HHYH130210 for ; Fri, 17 Mar 2006 12:34:17 -0500 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k2HHYFxX026461 for ; Fri, 17 Mar 2006 12:34:15 -0500 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id B69BF8001FF for ; Fri, 17 Mar 2006 12:34:15 -0500 (EST) Received: from ton.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by ton.toronto.redhat.com (8.13.1/8.13.1) with ESMTP id k2HHYFdO000391 for ; Fri, 17 Mar 2006 12:34:15 -0500 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id k2HHYFfK000388; Fri, 17 Mar 2006 12:34:15 -0500 X-Authentication-Warning: ton.toronto.redhat.com: fche set sender to fche@redhat.com using -f To: systemtap@sources.redhat.com Subject: Re: Proposed systemtap access to perfmon hardware References: <44183FCF.6010809@redhat.com> <441AE1DE.2040207@redhat.com> From: fche@redhat.com (Frank Ch. Eigler) Date: Fri, 17 Mar 2006 17:34:00 -0000 In-Reply-To: <441AE1DE.2040207@redhat.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-q1/txt/msg00823.txt.bz2 wcohen wrote: > To try to get a feel on how the performance monitoring hardware > support would work in SystemTap I wrote some simple examples. Nice work. To flesh out the operational model (and please correct me if I'm wrong): the way this stuff would all work is: - The systemtap translator would be linked with libpfm from perfmon2. (libpfm license is friendly.) - This library would be used at translation time to map perfmon.* probe point specifications to PMC register descriptions (pfmlib_output_param_t). (This will require telling the system the exact target cpu type for cross-instrumentation.) - These descriptions would be emitted into the C code, for actual installation during module initialization. For our first cut, since there appears to exist no kernel-side management API at the moment, the C code would directly manipulate the PMC registers. (This means no coexistence for oprofile or other concurrent perfctr probing. C'est la vie.) - The "sample" type perfmon probes would map to the same kind of dispatch/callback as the current "timer.profile": the probe handler should have valid pt_regs available. - The free-running type perfmon probes, probably named "perfctr.SPEC.setup" or ".start" or ".begin" would map to a one-time initialization that passes a token (PMC counter number?) to the handler. Other probe handlers can then query/manipulate the free-running counter using that number via the start/stop/query functions. Is that sufficiently detailed to begin an implementation? > [...] print ("ipc is %d.%d \n", ipc/factor, ipc % factor); (An aside: we should have a more compact notation for this. We won't support floating point numbers, but integers can be commonly scaled like this. Maybe printf("%.Nf", value), where N implies a power-of-ten scaling factor, and printf("%*f", value, scale) for general factors.) - FChE