From 5d65678dde08d0b2e34ee79c2e0f6c26ff3e4592 Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 26 Mar 2007 16:15:11 +0000 Subject: 2007-03-26 Martin Hunt * mainloop.c (run_stp_check): Just use system() call. (init_staprun): Remove _stp_pid module parameter. (cleanup_and_exit): If closed==2, just exit without removing module. (driver_poll): Remove. We no longer require stap running. (_stp_main_loop): Remove call to driver_poll. * ctl.c (init_ctl_channel): Don't put files in systemtap_pid, revert back to systemtap/modulename. * relay.c: Revert back to systemtap/modulename paths. * relay_old.c: Ditto. * staprun.c: Add -L and -A args. --- runtime/staprun/ctl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/staprun/ctl.c') diff --git a/runtime/staprun/ctl.c b/runtime/staprun/ctl.c index 9336631c..a217d270 100644 --- a/runtime/staprun/ctl.c +++ b/runtime/staprun/ctl.c @@ -18,14 +18,18 @@ int init_ctl_channel(void) struct statfs st; if (statfs("/sys/kernel/debug", &st) == 0 && (int) st.f_type == (int) DEBUGFS_MAGIC) - sprintf (buf, "/sys/kernel/debug/systemtap_%d/cmd", getpid()); + sprintf (buf, "/sys/kernel/debug/systemtap/%s/cmd", modname); else - sprintf (buf, "/proc/systemtap_%d/cmd", getpid()); + sprintf (buf, "/proc/systemtap/%s/cmd", modname); dbug("Opening %s\n", buf); control_channel = open(buf, O_RDWR); if (control_channel < 0) { - fprintf(stderr, "ERROR: couldn't open control channel %s: errcode = %s\n", buf, strerror(errno)); + if (attach_mod) + fprintf (stderr, "ERROR: Cannot connect to module \"%s\".\n", modname); + else + fprintf (stderr, "ERROR: couldn't open control channel %s\n", buf); + fprintf (stderr, "errcode = %s\n", strerror(errno)); return -1; } return 0; -- cgit