Bug 3282 - staprun failed in relayfs mode
Summary: staprun failed in relayfs mode
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-29 03:33 UTC by Li Guanglei
Modified: 2007-03-01 05:38 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li Guanglei 2006-09-29 03:33:40 UTC
I came across this error on latest CVS/ppc64/2.6.17.9/RHEL4U4

root:/home/root> cat a.stp

probe kernel.function("sys_read")
{
        printf("read\n")
}

root:/home/root> stap a.stp -b -v
Pass 1: parsed user script and 53 library script(s) in 590usr/0sys/679real ms.
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 global(s) in
370usr/40sys/473real ms.
Pass 3: translated to C into "/tmp/stap5V6eQy/stap_7528.c" in
130usr/110sys/270real ms.
Pass 4: compiled C into "stap_7528.ko" in 3270usr/210sys/3891real ms.
Pass 5: starting run.
waitpid: No child processes
Pass 5: run completed in 0usr/20sys/55real ms.
Pass 5: run failed.  Try again with more '-v' (verbose) options.
Comment 1 Li Guanglei 2006-09-29 04:51:13 UTC
I checked and found the reason is the due to the failure of:
execlp(stp_check, stp_check, NULL) , which is called inside init_relayfs of
librelayfs.c
the PKGLIBDIR is not defined so execlp can't find the path of stp_check.

Here is a patch, I tested and it works for me:

Index: Makefile.am
===================================================================
RCS file: /cvs/systemtap/src/Makefile.am,v
retrieving revision 1.54
diff -u -r1.54 Makefile.am
--- Makefile.am 26 Sep 2006 21:41:37 -0000      1.54
+++ Makefile.am 29 Sep 2006 04:47:04 -0000
@@ -5,7 +5,7 @@

 pkglibexecdir = ${libexecdir}/${PACKAGE}

-AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"'
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"'
-DPKGLIBDIR='"$(pkglibexecdir)"'

 AM_CFLAGS = -std=gnu99 -D_GNU_SOURCE -fexceptions \
            -Wall -Werror -Wshadow -Wunused -Wformat=2 -W
Comment 2 Li Guanglei 2006-09-29 09:13:11 UTC
(In reply to comment #1)

patch checked into CVS.

> I checked and found the reason is the due to the failure of:
> execlp(stp_check, stp_check, NULL) , which is called inside init_relayfs of
> librelayfs.c
> the PKGLIBDIR is not defined so execlp can't find the path of stp_check.
> 
> Here is a patch, I tested and it works for me:
> 
> Index: Makefile.am
> ===================================================================
> RCS file: /cvs/systemtap/src/Makefile.am,v
> retrieving revision 1.54
> diff -u -r1.54 Makefile.am
> --- Makefile.am 26 Sep 2006 21:41:37 -0000      1.54
> +++ Makefile.am 29 Sep 2006 04:47:04 -0000
> @@ -5,7 +5,7 @@
> 
>  pkglibexecdir = ${libexecdir}/${PACKAGE}
> 
> -AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"'
> +AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"'
> -DPKGLIBDIR='"$(pkglibexecdir)"'
> 
>  AM_CFLAGS = -std=gnu99 -D_GNU_SOURCE -fexceptions \
>             -Wall -Werror -Wshadow -Wunused -Wformat=2 -W
> 
Comment 3 Li Guanglei 2007-03-01 05:38:56 UTC
This has already been fixed.