diff options
Diffstat (limited to 'runtime/stpd')
-rw-r--r-- | runtime/stpd/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/stpd/stpd.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog index dfaf199b..8151f5be 100644 --- a/runtime/stpd/ChangeLog +++ b/runtime/stpd/ChangeLog @@ -1,3 +1,7 @@ +2006-03-15 Tom Zanussi <zanussi@us.ibm.com> + + * stpd.c (main): Add runtime check for relayfs vs relay-on-proc. + 2006-03-06 Martin Hunt <hunt@redhat.com> * librelay.c (start_cmd): Set proper uid/gid before execing diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c index bb1a81e0..e99f4b47 100644 --- a/runtime/stpd/stpd.c +++ b/runtime/stpd/stpd.c @@ -23,8 +23,9 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <strings.h> +#include <string.h> #include <sys/wait.h> +#include <sys/statfs.h> #include <pwd.h> #include "librelay.h" @@ -88,6 +89,7 @@ int main(int argc, char **argv) { int c, status; pid_t pid; + struct statfs st; while ((c = getopt(argc, argv, "mpqrb:n:t:d:c:vo:u:")) != EOF) { @@ -210,7 +212,11 @@ int main(int argc, char **argv) outfile_name = DEFAULT_OUTFILE_NAME; } - sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid()); + if (statfs("/mnt/relay", &st) < 0) + sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid); + else + sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid()); + if (init_stp(stpd_filebase, !quiet)) { //fprintf(stderr, "Couldn't initialize stpd. Exiting.\n"); exit(1); |