From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30738 invoked by alias); 29 Dec 2009 21:36:18 -0000 Received: (qmail 30731 invoked by uid 22791); 29 Dec 2009 21:36:18 -0000 X-SWARE-Spam-Status: No, hits=-2.5 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; Tue, 29 Dec 2009 21:36:13 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBTLaCrT010294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 29 Dec 2009 16:36:12 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBTLaAET006782; Tue, 29 Dec 2009 16:36:11 -0500 Subject: Re: [PATCH V6] Tracepoint Tapset for Memory Subsystem From: Mark Wielaard To: Rajasekhar Duddu Cc: systemtap@sources.redhat.com In-Reply-To: <20091211183545.GA4643@rajduddu> References: <20091125093051.GA13363@rajduddu> <20091204120819.GA14359@rajduddu> <4B1C6D57.7090409@oracle.com> <20091209065725.GA5987@rajduddu> <20091211183545.GA4643@rajduddu> Content-Type: text/plain; charset="UTF-8" Date: Tue, 29 Dec 2009 21:36:00 -0000 Message-ID: <1262122570.22922.32.camel@hermans.wildebeest.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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/msg01027.txt.bz2 Hi Rajasekhar, On Sat, 2009-12-12 at 00:05 +0530, Rajasekhar Duddu wrote: > Changelog 3: > Defined two macros for converting the GFP_FLAGS into string > formats. > Added k(ret)probe based fallback probes for all the > Functions. Sorry for the late feedback. I finally tested on an old 2.6.18 kernel which didn't have the tracepoints defined. I made a couple of changes to the fallback probes to make them work (a bit). I agree with Wenji that having bytes_alloc be sometimes a long and sometimes a string is not very helpful. So I made it a long always by setting it to the same value as bytes_req. That isn't ideal, but better than having the type mismatch. I couldn't find a good solution for the vm.kmalloc fallback, since the function is always inlined, the return probe won't really work (I pulled that test out of the other buildok/vm.tracepoints.stp to show the rest does build now). Maybe someone knows a trick to get this fallback to also work. But maybe we should just encourage people to upgrade their kernel to one that has the tracepoints defined. Cheers, Mark commit 11c015d84facc299ebcb12771ccda1975333a6bc Author: Mark Wielaard Date: Tue Dec 29 21:05:55 2009 +0100 Fixup some memory tapset vm kernel function probe fallbacks. Older kernels don't have all GFP constants defined, and the fallback kernel function probe fallbacks don't have the same dwarf variable names as the kernel trace point probes. So replace them with variables that are available. bytes_alloc was sometimes a long and sometimes a string, this caused scripts to fail depending on which alternative was chosen for a particular kernel. So make it a long always. This isn't a full solution since kmalloc is always inlined which makes the kernel.function("kmalloc").return probe fail. * tapset/memory.stp: Define __GFP_THISNODE, __GFP_RECLAIMABLE, GFP_TEMPORARY, GFP_HIGHUSER_MOVABLE and GFP_THISNODE when not yet defined. (__vm.kmalloc.kp): Use $flags, not $gfp_flags. Set bytes_alloc equal to bytes_req. (__vm.kmem_cache_alloc.kp): Likewise. And use $cachep->buffer_size for bytes_req. (__vm.kmalloc_node.kp): Likewise. (__vm.kmem_cache_alloc_node.kp): Likewise. (__vm.kfree.kp): Use $ibjp for ptr, not $return. (__vm.kmem_cache_free.kp): Likewise. * testsuite/buildok/vm.tracepoints.stp: Move vm.kmalloc test to... * testsuite/buildok/vm.tracepoints.kmalloc.stp: ... here.