public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
To: systemtap@sourceware.org
Subject: [RFC][PATCH 1/4] kprobe-based symbol resolution for stap-translator
Date: Fri, 13 Mar 2009 10:44:00 -0000	[thread overview]
Message-ID: <49BA38DB.1080604@linux.vnet.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

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 


[-- Attachment #2: kallsym_patch_1 --]
[-- Type: text/plain, Size: 354 bytes --]

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;

             reply	other threads:[~2009-03-13 10:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13 10:44 Prerna Saxena [this message]
2009-03-13 10:58 ` [RFC][PATCH 2/4] " Prerna Saxena
2009-03-13 12:13 ` [RFC][PATCH 3/4] " Prerna Saxena
2009-03-13 12:30 ` [RFC][PATCH 4/4] " Prerna Saxena
2009-03-13 16:10 ` [RFC][PATCH 1/4] " Frank Ch. Eigler
2009-03-13 18:23   ` Ananth N Mavinakayanahalli
2009-03-13 21:04     ` Frank Ch. Eigler
2009-03-13 22:10       ` Josh Stone
2009-03-13 23:13         ` Frank Ch. Eigler
2009-03-16  7:01         ` Ananth N Mavinakayanahalli
2009-03-16 21:59           ` Josh Stone
2009-04-09 16:22       ` Frank Ch. Eigler
2009-04-13 15:07         ` Prerna Saxena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49BA38DB.1080604@linux.vnet.ibm.com \
    --to=prerna@linux.vnet.ibm.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).