This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][PATCH 1/4] kprobe-based symbol resolution for stap-translator


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


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]