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]

Re: systemtap cross compile with out of tree module


xxx xxx <maverick4ml@gmail.com> writes:

> [...]
>  I am trying to do a cross compile(powerpc) of systemtap script which
> probes a module situated out of tree of linux source tree. I can probe
> kernel functions, module functions situated inside the kernel tree.
> But out of tree module's gives error.

That doesn't sound right.

> /home/mav/stap/test_module.ko
> /home/mav/linux-2.6.26.4/
>
> My stap script is simple as
> probe module("test_module").function("hello_world") { }

OK.  (I can't think of any reason why an out-of-tree module should
behave differently in this way.  Do you have a
$SYSTEMTAP_DEBUGINFO_PATH set up?  Perhaps stap is confusing your
module with a request for a user-space process probe.)

> Using systemtap-2.0,  am getting an error as below.
> ./stap -d /home/mav/stap/test_module.ko -g -P -a powerpc -B
> CROSS_COMPILE=powerpc-linux-gnu- -p4 -r /home/mav/linux-2.6.26.4/ -m
> mod_test mod_test.stp
> [...]
> Pass 3: translated to C into "/tmp/stapi1Qfjf/mod_test_src.c" using
> 138640virt/28284res/5160shr/23140data kb, in 20usr/110sys/2110real ms.
> /tmp/stapi1Qfjf/mod_test_src.c: In function 'systemtap_module_init':
> /tmp/stapi1Qfjf/mod_test_src.c:569: error: implicit declaration of
> function '_stp_vma_init'
> [...]
> WARNING: kbuild exited with status: 2
> Pass 4: compiled C into "mod_test.ko" in 400usr/340sys/4250real ms.

That's not right.


> While trying with the latest git code, I dont get a compilation error,
> but while running it, i get "WARNING: process-tracking is not
> available in this kernel [man error::process-tracking]"
> I dont have access permissions outside my home directory like /lib/modues/* etc

Understood - makes sense since you're just using this as a cross-compilation
development machine.  Assuming there is a stap bug preventing you from normal
treatment, perhaps you could create a fake kernel build tree somewhere where
you do have privileges, symlinking to the real cross-build tree, merging in
links to the out-of-tree module, then use "stap -r /that/tree ..." instead
of something like $SYSTEMTAP_DEBUGINFO_PATH.


> For instrumenting modules also, is utrace required?

No.

> If more details required, do let me know. Any help appreciated.

How about the output from stap-report on your machine, plus perhaps
that of git stap's

% stap --vp 04 -p2 ... mod_test.stp


- FChE


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