From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30070 invoked by alias); 13 Dec 2007 18:50:46 -0000 Received: (qmail 30063 invoked by uid 22791); 13 Dec 2007 18:50:46 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,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; Thu, 13 Dec 2007 18:50:38 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id lBDIoaCb008629 for ; Thu, 13 Dec 2007 13:50:36 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lBDIoa3M023507; Thu, 13 Dec 2007 13:50:36 -0500 Received: from [172.16.83.2] (dhcp83-2.boston.redhat.com [172.16.83.2]) by mail.boston.redhat.com (8.13.1/8.13.1) with ESMTP id lBDIoZ7m003673; Thu, 13 Dec 2007 13:50:35 -0500 Message-ID: <47617EFB.2000804@redhat.com> Date: Thu, 13 Dec 2007 18:50:00 -0000 From: Masami Hiramatsu User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Srinivasa Ds CC: ananth@in.ibm.com, Jim Keniston , Roland McGrath , Arjan van de Ven , anil.s.keshavamurthy@intel.com, davem@davemloft.net, systemtap-ml Subject: Re: [RFC -mm][PATCH ] Patch to avoid probing __init functions using kprobes References: <475DC362.9000707@redhat.com> <4760EAAE.7090303@in.ibm.com> <20071213082326.GA10642@in.ibm.com> <200712131651.18077.srinivasa@in.ibm.com> In-Reply-To: <200712131651.18077.srinivasa@in.ibm.com> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2007-q4/txt/msg00501.txt.bz2 Hi Srinivasa, Srinivasa Ds wrote: > On Thursday 13 Dec 2007 1:53:26 pm Ananth N Mavinakayanahalli wrote: >> On Thu, Dec 13, 2007 at 01:47:50PM +0530, Srinivasa Ds wrote: >>> Ananth N Mavinakayanahalli wrote: >>>> On Wed, Dec 12, 2007 at 08:21:01PM -0500, Masami Hiramatsu wrote: >>>>> Masami Hiramatsu wrote: >>>>>> Finally, I reproduced it by executing a command below: >>>>>> % stap -e 'probe kernel.function("migration_init"){}' >>>> That does seem like the right thing to do. This also needs to live in >>>> common code. >>>> >>>> Srini, >>>> Want to take a stab at it? > > This patch taken against the 2.6.24-rc4-mm1 fixes the problem > of probing __init functions.I have reused the code from extable.c > and modified the kprobes.c accordingly. Thanks, this patch worked fine for me. --- $ stap -ve 'probe kernel.function("migration_init"){}' Pass 1: parsed user script and 38 library script(s) in 210usr/10sys/227real ms. Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) in 230usr/100sys/324real ms. Pass 3: translated to C into "/tmp/staphufPIP/stap_aefede84fedbb0c1a1c03305e269e9af_273.c" in 0usr/0sys/0real ms. Pass 4: compiled C into "stap_aefede84fedbb0c1a1c03305e269e9af_273.ko" in 2390usr/390sys/2915real ms. Pass 5: starting run. ERROR: probe kernel.function("migration_init@/home/mhiramat/ksrc/2.6-mm/kernel/sched.c:5602") registration error (rc -22) Pass 5: run completed in 20usr/90sys/112real ms. --- -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Division e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com