From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17454 invoked by alias); 13 Mar 2009 10:41:14 -0000 Received: (qmail 17447 invoked by uid 22791); 13 Mar 2009 10:41:14 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_43,J_CHICKENPOX_73 X-Spam-Check-By: sourceware.org Received: from e28smtp08.in.ibm.com (HELO e28smtp08.in.ibm.com) (59.145.155.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Mar 2009 10:40:42 +0000 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by e28smtp08.in.ibm.com (8.13.1/8.13.1) with ESMTP id n2DACMnM010665 for ; Fri, 13 Mar 2009 15:42:22 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n2DAeklp4239372 for ; Fri, 13 Mar 2009 16:10:46 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.13.1/8.13.3) with ESMTP id n2DAebdd015236 for ; Fri, 13 Mar 2009 21:40:38 +1100 Received: from [9.124.35.27] ([9.124.35.27]) by d28av05.in.ibm.com (8.13.1/8.12.11) with ESMTP id n2DAeb91015232 for ; Fri, 13 Mar 2009 21:40:37 +1100 Message-ID: <49BA38DB.1080604@linux.vnet.ibm.com> Date: Fri, 13 Mar 2009 10:44:00 -0000 From: Prerna Saxena User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: systemtap@sourceware.org Subject: [RFC][PATCH 1/4] kprobe-based symbol resolution for stap-translator Content-Type: multipart/mixed; boundary="------------030301080004050603000808" 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: 2009-q1/txt/msg00686.txt.bz2 This is a multi-part message in MIME format. --------------030301080004050603000808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1758 Hi, Here's a set of patches which enable the stap-translator to utilize kprobes for resolving function addresses. ( Similar to James Bottomley's patch sent out last july ) In place of resolving probe points in semantic pass (Pass 2 ) by consulting vmlinux/debuginfo, this approach defers symbol resolution to the generated kprobes module. The kprobes module is passed the name of the function to be probed, which gets resolved against the kernel symbol tables to insert probes. This construct can be invoked using a new switch "--ksym" . In its present form, it is capable of probing function entry & returns (non-inlines). It does /*not*/ support : * a wildcard - based search for module/function names * probing select/all functions in a given source file * probing inline functions. * statement probes Known issues : 1. Apparently systemtap modules pick up build-id from the debuginfo files. Since debuginfo lookup is completely bypassed here, the generated stap modules fail a consistency check later owing to incorrect build id. For now, patch 4 comments out this check and the stap modules run fine, but I'd appreciate some pointers on how to set it right. :-) 2. An incorrect indentation parameter passed to the translated output in pass 3 causes stap to abort due to assert failure. Patch 4 corrects this as well. Patches : 1. kallsym_patch_1 , kallsym_patch_2 : introduce changes to session.h / main.cxx for the new switch "--ksym" 2. kallsym_patch_3 : changes to tapsets.cxx. 3. kallsym_patch_4 : workarounds for known problems. I'm working on fine-tuning its capabilities.....looking fwd to suggestions... :-) -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India --------------030301080004050603000808 Content-Type: text/plain; name="kallsym_patch_1" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kallsym_patch_1" Content-length: 354 Index: git-02-mar/session.h =================================================================== --- git-02-mar.orig/session.h +++ git-02-mar/session.h @@ -118,6 +118,7 @@ struct systemtap_session // dwarfless operation bool consult_symtab; + bool consult_kallsym; std::string kernel_symtab_path; bool ignore_vmlinux; bool ignore_dwarf; --------------030301080004050603000808--