From 44b1b985e8880444f644c638044650419f71b080 Mon Sep 17 00:00:00 2001 From: trz Date: Wed, 2 Aug 2006 14:06:35 +0000 Subject: Fix for bug #2992 --- runtime/stpd/ChangeLog | 5 +++++ runtime/stpd/stpd.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'runtime') 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 + + * stpd.c (main): Use modname rather than driver_pid in + stpd_filebase. + 2006-07-20 Martin Hunt * 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"); -- cgit