[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#582813: please enable kprobes



Package: linux-2.6
Severity: normal


I guess one of the prime consumer of the kernel debug package would be 
systemtap.

With the current kernel config in squeeze, systemtap still will not be able to 
funciton properly. Currently, it needs KPROBES.

The kernel KConfig does not talk much about if there is any performance penalty 
with kprobes or not.

config KPROBES
        bool "Kprobes"
        depends on KALLSYMS && MODULES
        depends on HAVE_KPROBES
        help
          Kprobes allows you to trap at almost any kernel address and
          execute a callback function.  register_kprobe() establishes
          a probepoint and specifies the callback.  Kprobes is useful
          for kernel debugging, non-intrusive instrumentation and testing.
          If in doubt, say "N".

The kernel documentation on kprobes also does not talk much about performance 
when not in use.

3. Configuring Kprobes

When configuring the kernel using make menuconfig/xconfig/oldconfig,
ensure that CONFIG_KPROBES is set to "y".  Under "Instrumentation
Support", look for "Kprobes".

So that you can load and unload Kprobes-based instrumentation modules,
make sure "Loadable module support" (CONFIG_MODULES) and "Module
unloading" (CONFIG_MODULE_UNLOAD) are set to "y".

Also make sure that CONFIG_KALLSYMS and perhaps even CONFIG_KALLSYMS_ALL
are set to "y", since kallsyms_lookup_name() is used by the in-kernel
kprobe address resolution code.

If you need to insert a probe in the middle of a function, you may find
it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO),
so you can use "objdump -d -l vmlinux" to see the source-to-object
code mapping.

If you want to reduce probing overhead, set "Kprobes jump optimization
support" (CONFIG_OPTPROBES) to "y". You can find this option under the
"Kprobes" line.


We will not be needing OPTPROBES because it conflicts with PREEMPT.

Without kprobes, systemtap does not function.

01:01:13 rrs@champaran:/usr/share/doc/systemtap-doc/examples/process $ stap -v 
-e 'probe vfs.read {printf("read performed\n"); exit()}' --vp 0001
Pass 1: parsed user script and 68 library script(s) using 
49924virt/20852res/1740shr kb, in 140usr/0sys/170real ms.
Pass 2: analyzed script: 1 probe(s), 11 function(s), 2 embed(s), 1 global(s) 
using 204000virt/147372res/62168shr kb, in 1020usr/80sys/1631real ms.
Pass 3: translated to C into 
"/tmp/stapIaff2R/stap_12d7093f3328dd319a881defeba0255b_5678.c" using 
204000virt/148076res/62772shr kb, in 270usr/10sys/369real ms.
Running make -C "/lib/modules/2.6.34-1-amd64/build" M="/tmp/stapIaff2R" 
ARCH="x86_64" modules --no-print-directory
  CC [M]  /tmp/stapIaff2R/stap_12d7093f3328dd319a881defeba0255b_5678.o
/tmp/stapIaff2R/stap_12d7093f3328dd319a881defeba0255b_5678.c:1034:2: error: 
#error "Need CONFIG_KPROBES!"
make[3]: *** [/tmp/stapIaff2R/stap_12d7093f3328dd319a881defeba0255b_5678.o] 
Error 1
make[2]: *** [_module_/tmp/stapIaff2R] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
Pass 4: compiled C into "stap_12d7093f3328dd319a881defeba0255b_5678.ko" in 
2800usr/580sys/4317real ms.
Pass 4: compilation failed.  Try again with another '--vp 0001' option.
Running rm -rf /tmp/stapIaff2R


Regards,
Ritesh
-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
"Necessity is the mother of invention."

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: