diff options
author | trz <trz> | 2006-08-02 14:06:35 +0000 |
---|---|---|
committer | trz <trz> | 2006-08-02 14:06:35 +0000 |
commit | 44b1b985e8880444f644c638044650419f71b080 (patch) | |
tree | 62a1dba746fdacca65f179d361b64e6c86ff7adc | |
parent | 8d6958765e6252c0dd8157f837b0005f83aa80cb (diff) | |
download | systemtap-steved-44b1b985e8880444f644c638044650419f71b080.tar.gz systemtap-steved-44b1b985e8880444f644c638044650419f71b080.tar.xz systemtap-steved-44b1b985e8880444f644c638044650419f71b080.zip |
Fix for bug #2992
-rw-r--r-- | runtime/stpd/ChangeLog | 5 | ||||
-rw-r--r-- | runtime/stpd/stpd.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog index 33f4fea1..7dd75470 100644 --- a/runtime/stpd/ChangeLog +++ b/runtime/stpd/ChangeLog @@ -1,3 +1,8 @@ +2006-08-02 Tom Zanussi <zanussi@us.ibm.com> + + * stpd.c (main): Use modname rather than driver_pid in + stpd_filebase. + 2006-07-20 Martin Hunt <hunt@redhat.com> * librelay.c (stp_main_loop): If module doesn't start, kill any diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c index 0b36fbb7..3158e5ed 100644 --- a/runtime/stpd/stpd.c +++ b/runtime/stpd/stpd.c @@ -211,8 +211,14 @@ int main(int argc, char **argv) if (statfs("/mnt/relay", &st) == 0 && (int) st.f_type == (int) RELAYFS_MAGIC) sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid()); - else - sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid); + else { + char *ptr; + sprintf(stpd_filebase, "/proc/systemtap/%s", modname); + ptr = index(stpd_filebase,'.'); + if (ptr) + *ptr = 0; + strcat(stpd_filebase, "/cpu"); + } if (init_stp(stpd_filebase, !quiet)) { //fprintf(stderr, "Couldn't initialize stpd. Exiting.\n"); |