From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14391 invoked by alias); 17 Jul 2014 21:14:41 -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 14361 invoked by uid 89); 17 Jul 2014 21:14:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 17 Jul 2014 21:14:39 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6HLEYck030673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Jul 2014 17:14:34 -0400 Received: from t540p.usersys.redhat.com (dhcp-10-15-1-109.hsv.redhat.com [10.15.1.109]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6HLEXbL014522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 17 Jul 2014 17:14:34 -0400 Message-ID: <53C83CB9.3020808@redhat.com> Date: Thu, 17 Jul 2014 21:14:00 -0000 From: David Smith User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Systemtap List , pcp Subject: systemtap/pcp integration Content-Type: multipart/mixed; boundary="------------010000060503030300000202" X-IsSubscribed: yes X-SW-Source: 2014-q3/txt/msg00031.txt.bz2 This is a multi-part message in MIME format. --------------010000060503030300000202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1035 Here's a small update on the prototype systemtap/pcp integration work I'm doing. I've create a systemtap branch, called 'dsmith/mmv' that contains all my work. Basically this work allows systemtap to create 'mmv' memory mapped files. If you checkout and build that, then you should be able to run the attached systemtap script. This script is a translation of pcp's example python mmv script found in src/python/mmv.py. Note that systemtap will create a file called 'mmv' in /proc/systemtap/{MODULE_NAME}. I've just been using pcp's 'mmvdump' utility to dump the contents of the /proc/systemtap/{MODULE_NAME}/mmv file. Currently the pcp mmv pmda only looks in one place for mmv files, but it might be possible to create a symbolic link to systemtap's mmv file to make it happy. The code works for the attached script, but I'm sure it is quite fragile. Things like locking, error checking, documentation, etc. need to be done. -- David Smith dsmith@redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax) --------------010000060503030300000202 Content-Type: text/plain; charset=UTF-8; name="mmv.stp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mmv.stp" Content-length: 1286 global inst0, inst1, counter_metric, instant_metric, indom_metric global instant_value probe begin { inst0 = mmv_add_instance(0, "zero") inst1 = mmv_add_instance(1, "hero") printf("instances: %d, %d\n", inst0, inst1) indom0 = mmv_add_indom(1, "We can be heroes", "Set of instances from zero to hero") mmv_add_indom_instance(indom0, inst0) mmv_add_indom_instance(indom0, inst1) printf("indom: %d\n", indom0) counter_metric = mmv_add_metric("counter", 1, MMV_TYPE_NUMBER, MMV_SEM_COUNTER, mmv_units(0, 0, 1, 0, 0, 0), 0, "Example counter metric", "Yep, a test counter metric") instant_metric = mmv_add_metric("instant", 2, MMV_TYPE_NUMBER, MMV_SEM_INSTANT, mmv_units(0, 0, 0, 0, 0, 0), 0, "Example instant metric", "Yep, a test instantaneous metric") indom_metric = mmv_add_metric("indom", 3, MMV_TYPE_NUMBER, MMV_SEM_DISCRETE, mmv_units(0, 0, 0, 0, 0, 0), 1, "", "") printf("metrics: %d, %d, %d\n", counter_metric, instant_metric, indom_metric) mmv_stats_start(42, 0) instant_value = mmv_lookup_value(instant_metric, 0) mmv_set_value(instant_value, 41) mmv_inc_value(instant_value, 2) } probe timer.s(1) { mmv_inc_value(instant_value, 3) } probe end { mmv_stats_stop() } --------------010000060503030300000202--