From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22875 invoked by alias); 1 Apr 2011 12:27:43 -0000 Received: (qmail 22868 invoked by uid 22791); 1 Apr 2011 12:27:42 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Apr 2011 12:27:38 +0000 Received: by iye7 with SMTP id 7so4516907iye.20 for ; Fri, 01 Apr 2011 05:27:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.115.199 with SMTP id l7mr4788262icq.308.1301660857773; Fri, 01 Apr 2011 05:27:37 -0700 (PDT) Received: by 10.43.53.71 with HTTP; Fri, 1 Apr 2011 05:27:37 -0700 (PDT) In-Reply-To: <20110401105919.GB5608@baltika> References: <20110401105919.GB5608@baltika> Date: Fri, 01 Apr 2011 12:27:00 -0000 Message-ID: Subject: Re: cannot trace user-level code in cross compilation environment From: Zhiwei Ying To: Adrien Kunysz Cc: systemtap Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q2/txt/msg00007.txt.bz2 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 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=3Dlinux/kernel/git/srikar/linux-uprobes.git;a=3D= 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 >> { >> =A0 =A0 =A0 =A0 printf("USER, %s %s %s\n", thread_indent(1), pp(), $$par= ms) >> } >> probe process("/ddtv/tracedrv/test/dhg/hello/hello").function("*").return >> { >> =A0 =A0 =A0 =A0 printf("USER %s %s %s\n", thread_indent(-1), probefunc()= , $$return) >> } >> probe end >> { >> =A0 =A0 =A0 =A0 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 > =3DrlJ2 > -----END PGP SIGNATURE----- > >