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: cannot trace user-level code in cross compilation environment


I have patched the kernel with utrace and other systemtap requirement.
If there is no utrace support in the kernel, the staprun cannot load
the utrace.ko.

How can I trace the staprun? I turned on -v for staprun, but there is
not too much information provided.

On Fri, Apr 1, 2011 at 6:59 PM, Adrien Kunysz <adrien@kunysz.be> wrote:
> On Fri, Apr 01, 2011 at 05:05:17PM +0800, Zhiwei Ying wrote:
>> I built a systemtap1.4 on ubuntu 10.4 32 bits. And also cross-compile
>> staprun to a develop board with kernel 2.6.35 x86.
>
> Userland instrumentation requires the uprobe kernel patch. Uprobe is
> not in the mainline kernel nor in Ubuntu so it seems normal you cannot
> probe userland programs with these kernels. I believe the uprobes patch
> is being maintained in this git repository:
> http://git.kernel.org/?p=linux/kernel/git/srikar/linux-uprobes.git;a=tree
>
>> On the host pc side,
>>
>> stap -r /target-board/kernel xxx.stp -p 4 -m traceauto.ko
>>
>> then copy the traceauto.ko to the board,
>> staprun -u -v -m traceauto.ko -c ./hello
>>
>>
>> xxx.stp
>> probe process("/ddtv/tracedrv/test/dhg/hello/hello").function("*").call
>> {
>> ? ? ? ? printf("USER, %s %s %s\n", thread_indent(1), pp(), $$parms)
>> }
>> probe process("/ddtv/tracedrv/test/dhg/hello/hello").function("*").return
>> {
>> ? ? ? ? printf("USER %s %s %s\n", thread_indent(-1), probefunc(), $$return)
>> }
>> probe end
>> {
>> ? ? ? ? printf ("end of tracing\n")
>> }
>>
>> It only able to print "end of tracing", nothing in the hello is
>> printed. Attached is the binary of traceauto.ko.
>>
>> BTW, it can trace kernel level code. Just not lucky on user-level code.
>
> If it's still not working with uprobe, the output generated at
> module-compilation time with stap -vvvvv would help to understand what
> is going on.
>
>> Any help is great appreciated.
>>
>> Thanks,
>> Zhiwei
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAk2VsAcACgkQKLX03ZSPZGy8rACfXElmGea5ijQb0qRhvtLGAlT3
> WEwAniUimy6j1/4V95ucSUTsmbGvF7Qf
> =rlJ2
> -----END PGP SIGNATURE-----
>
>


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