public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: systemtap cross compile with out of tree module
       [not found] <CANOPpZOpVEVHWPBOS_bwwkwP85dqKgDgRExUsjC-srkO78oyXg@mail.gmail.com>
@ 2013-01-18  7:05 ` xxx xxx
  2013-01-18 15:43   ` Frank Ch. Eigler
  0 siblings, 1 reply; 4+ messages in thread
From: xxx xxx @ 2013-01-18  7:05 UTC (permalink / raw)
  To: systemtap

Hi,
 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.
/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") { }

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 1: parsed user script and 89 library script(s) using
76520virt/21460res/2512shr/19664data kb, in 180usr/10sys/367real ms.
WARNING: side-effect-free probe 'probe_2142': keyword at mod_test.stp:1:1
 source: probe module("
/home/mav/stap/test_module.ko").function("hello_world") {
         ^
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0
global(s) using 136256virt/24488res/3444shr/21456data kb, in
20usr/170sys/2196real ms.
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'
/tmp/stapi1Qfjf/mod_test_src.c:573: error: implicit declaration of
function 'stap_start_task_finder'
/tmp/stapi1Qfjf/mod_test_src.c:575: error: implicit declaration of
function 'stap_stop_task_finder'
make[1]: *** [/tmp/stapi1Qfjf/mod_test_src.o] Error 1
make: *** [_module_/tmp/stapi1Qfjf] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "mod_test.ko" in 400usr/340sys/4250real ms.

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
For instrumenting modules also , is utrace required ? If more details
required, do let me know. Any help appreciated.

Regards,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: systemtap cross compile with out of tree module
  2013-01-18  7:05 ` systemtap cross compile with out of tree module xxx xxx
@ 2013-01-18 15:43   ` Frank Ch. Eigler
  2013-01-18 17:51     ` Josh Stone
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Ch. Eigler @ 2013-01-18 15:43 UTC (permalink / raw)
  To: xxx xxx; +Cc: systemtap

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: systemtap cross compile with out of tree module
  2013-01-18 15:43   ` Frank Ch. Eigler
@ 2013-01-18 17:51     ` Josh Stone
  2013-01-22  8:52       ` xxx xxx
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Stone @ 2013-01-18 17:51 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: xxx xxx, systemtap

On 01/18/2013 07:43 AM, Frank Ch. Eigler wrote:
> 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.)

I know there are parts of our code that don't have the context to know
whether an object path is a kernel module or userspace binary, and we
heuristically decide that absolute paths (starting with '/') must be
userspace.

This is probably such a case, and it's a pretty good example of why we
should fix those...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: systemtap cross compile with out of tree module
  2013-01-18 17:51     ` Josh Stone
@ 2013-01-22  8:52       ` xxx xxx
  0 siblings, 0 replies; 4+ messages in thread
From: xxx xxx @ 2013-01-22  8:52 UTC (permalink / raw)
  To: Josh Stone; +Cc: Frank Ch. Eigler, systemtap

On Fri, Jan 18, 2013 at 11:21 PM, Josh Stone <jistone@redhat.com> wrote:
> On 01/18/2013 07:43 AM, Frank Ch. Eigler wrote:
>> 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.)
>
> I know there are parts of our code that don't have the context to know
> whether an object path is a kernel module or userspace binary, and we
> heuristically decide that absolute paths (starting with '/') must be
> userspace.
>
> This is probably such a case, and it's a pretty good example of why we
> should fix those...
>

Thanks for the reply. Providing symlinks to out-of-tree module inside
the kernel directory works, then systemtap is able to find those
modules. But by probing multiple modules, systemtap gives a warning
WARNING: missing unwind/symbol data for module. If I probe each module
individually, it works :( . Earlier I used to give the full path
inside script like probe module("/home/mav/stap/test_module.ko"), so
systemtap mistaken it as a user application.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-22  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CANOPpZOpVEVHWPBOS_bwwkwP85dqKgDgRExUsjC-srkO78oyXg@mail.gmail.com>
2013-01-18  7:05 ` systemtap cross compile with out of tree module xxx xxx
2013-01-18 15:43   ` Frank Ch. Eigler
2013-01-18 17:51     ` Josh Stone
2013-01-22  8:52       ` xxx xxx

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).