From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18684 invoked by alias); 30 Nov 2009 16:26:30 -0000 Received: (qmail 18672 invoked by uid 22791); 30 Nov 2009 16:26:28 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Nov 2009 16:26:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAUGQJJU022196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Nov 2009 11:26:19 -0500 Received: from fche.csb (vpn-243-177.phx2.redhat.com [10.3.243.177]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAUGQJHw029392; Mon, 30 Nov 2009 11:26:19 -0500 Received: by fche.csb (Postfix, from userid 2569) id 004785810F; Mon, 30 Nov 2009 11:26:18 -0500 (EST) To: Rajasekhar Duddu Cc: systemtap@sources.redhat.com Subject: Re: [PATCH V4] Tracepoint Tapset for Memory Subsystem References: <20091125093051.GA13363@rajduddu> From: fche@redhat.com (Frank Ch. Eigler) Date: Mon, 30 Nov 2009 16:26:00 -0000 In-Reply-To: <20091125093051.GA13363@rajduddu> (Rajasekhar Duddu's message of "Wed, 25 Nov 2009 15:00:51 +0530") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2009-q4/txt/msg00737.txt.bz2 Rajasekhar Duddu writes: > [...] > +%{ > +#define __GFP_BITMASKS(FLAG) if(gfp_flag & FLAG) { if(THIS->__retvalue[0] != '\0') \ > + strlcat(THIS->__retvalue, " | "#FLAG, MAXSTRINGLEN); \ > + else strlcat(THIS->__retvalue, #FLAG, MAXSTRINGLEN); } > +%} > +%{ > +#define __GFP_COMPOSITE_FLAG(FLAG) if(gfp_flag == FLAG) { \ > + strlcat(THIS->__retvalue, #FLAG, MAXSTRINGLEN); return; } > +%} These should be defined within the embedded-c function block below, and should be #undef'd there too, to avoid polluting the namespace. >[...] > --- a/testsuite/systemtap.examples/memory/vm.tracepoints.stp 1969-12-31 19:00:00.000000000 -0500 > +++ b/testsuite/systemtap.examples/memory/vm.tracepoints.stp 2009-11-25 04:06:21.000000000 -0500 > @@ -0,0 +1,18 @@ > +global slabs > + > +probe vm.kmem_cache_alloc { > + slabs [execname(), bytes_req]++ > +} > + > +probe timer.ms(10000) > +{ > + dummy = ""; > + foreach ([name, bytes] in slabs) { > + if (dummy != name) > + printf("\nProcess:%s\n", name); > + printf("Slab_size:%d\tCount:%d\n", bytes, slabs[name, bytes]); > + dummy = name; > + } > + delete slabs > + printf("\n-------------------------------------------------------\n\n") > +} As a matter of style, this would be nearly equivalent to all of that, except for reporting once at the end rather than every 10 seconds. global slabs probe vm.kmem_cache_alloc { slabs [execname(), bytes_req]<<<1 } Please confirm that the tapset reference documentation template is configured to extract the @@doc stuff from the tapset. Please add a sentence to NEWS to describe the new tapset. (Others who recently added tapset extensions should do the same!) Please commit with those changes. - FChE