summaryrefslogtreecommitdiffstats
path: root/runtime/stpd
diff options
context:
space:
mode:
authortrz <trz>2006-03-15 16:14:09 +0000
committertrz <trz>2006-03-15 16:14:09 +0000
commit5b1cd012831a6b729422e34cf0ed616600613771 (patch)
tree069912a0908ebcc8f3e7f80fa5f18bb5c510a34b /runtime/stpd
parent9e0abebdf8aca24910b68ed35107926aab91443b (diff)
downloadsystemtap-steved-5b1cd012831a6b729422e34cf0ed616600613771.tar.gz
systemtap-steved-5b1cd012831a6b729422e34cf0ed616600613771.tar.xz
systemtap-steved-5b1cd012831a6b729422e34cf0ed616600613771.zip
Fix for bug #2406 (autodetect supported relayfs versions)
Diffstat (limited to 'runtime/stpd')
-rw-r--r--runtime/stpd/ChangeLog4
-rw-r--r--runtime/stpd/stpd.c10
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);