diff options
author | trz <trz> | 2006-04-04 14:06:16 +0000 |
---|---|---|
committer | trz <trz> | 2006-04-04 14:06:16 +0000 |
commit | 984dcc0f89d6e02c1d0a647352358dbc25c110ac (patch) | |
tree | bc3662134756f172d2a03179dfa4212fe0df7446 | |
parent | ae653153d30946a7706369486dc646a9a3839a7c (diff) | |
download | systemtap-steved-984dcc0f89d6e02c1d0a647352358dbc25c110ac.tar.gz systemtap-steved-984dcc0f89d6e02c1d0a647352358dbc25c110ac.tar.xz systemtap-steved-984dcc0f89d6e02c1d0a647352358dbc25c110ac.zip |
fix for bug #2511
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | runtime/stpd/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/stpd/stpd.c | 9 | ||||
-rwxr-xr-x | stp_check.in | 5 |
4 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,7 @@ +2006-04-04 Tom Zanussi <zanussi@us.ibm.com> + + * stp_check: Change test for relay vs relayfs + 2006-03-30 Martin Hunt <hunt@redhat.com> * tapsets.cxx (dwarf_derived_probe::emit_registrations): diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog index 8151f5be..9233ccd9 100644 --- a/runtime/stpd/ChangeLog +++ b/runtime/stpd/ChangeLog @@ -1,3 +1,7 @@ +2006-04-04 Tom Zanussi <zanussi@us.ibm.com> + + * stpd.c (main): Check that /mnt/relay is actually relayfs. + 2006-03-15 Tom Zanussi <zanussi@us.ibm.com> * stpd.c (main): Add runtime check for relayfs vs relay-on-proc. diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c index e99f4b47..14107664 100644 --- a/runtime/stpd/stpd.c +++ b/runtime/stpd/stpd.c @@ -53,6 +53,7 @@ gid_t cmd_gid; /* relayfs base file name */ static char stpd_filebase[1024]; +#define RELAYFS_MAGIC 0xF0B4A981 /* if no output file name is specified, use this */ #define DEFAULT_OUTFILE_NAME "probe.out" @@ -211,11 +212,11 @@ int main(int argc, char **argv) if (!outfile_name) outfile_name = DEFAULT_OUTFILE_NAME; } - - if (statfs("/mnt/relay", &st) < 0) - sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid); - else + + if ((statfs("/mnt/relay", &st) == 0) && (st.f_type == (long) RELAYFS_MAGIC)) sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid()); + else + sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid); if (init_stp(stpd_filebase, !quiet)) { //fprintf(stderr, "Couldn't initialize stpd. Exiting.\n"); diff --git a/stp_check.in b/stp_check.in index 6e429b91..91f641dc 100755 --- a/stp_check.in +++ b/stp_check.in @@ -1,7 +1,8 @@ #!/bin/bash -RELAY=`grep sysfs_create_relay_file /proc/kallsyms` -if [ -n "$RELAY" ] +RELAYFS_FS=`grep relayfs_create_dir /proc/kallsyms` +RELAY=`grep relay_open /proc/kallsyms` +if [ -n "$RELAY" -a -z "$RELAYFS_FS" ] then exit 0 fi |