summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2007-03-12 18:28:47 +0000
committerfche <fche>2007-03-12 18:28:47 +0000
commitb272f21d2a42d44222cfc20f35025c324f6091c4 (patch)
treed3435c5a9d1576233b4f9a42e785db1908bc6118
parentcb43d90b37a7f9a066d56881b87067ef3254d95d (diff)
downloadsystemtap-steved-b272f21d2a42d44222cfc20f35025c324f6091c4.tar.gz
systemtap-steved-b272f21d2a42d44222cfc20f35025c324f6091c4.tar.xz
systemtap-steved-b272f21d2a42d44222cfc20f35025c324f6091c4.zip
2007-03-12 Frank Ch. Eigler <fche@elastic.org>
* librelay.c (init_stp): Use /proc/MODULE rather than /proc/systemtap/MODULE. 2007-03-12 Frank Ch. Eigler <fche@elastic.org> * procfs.c (_stp_register_procfs): Use /proc/MODULE rather than /proc/systemtap/MODULE.
-rw-r--r--runtime/stpd/ChangeLog5
-rw-r--r--runtime/stpd/librelay.c5
-rw-r--r--runtime/transport/ChangeLog5
-rw-r--r--runtime/transport/procfs.c26
4 files changed, 21 insertions, 20 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog
index 858f4e66..7b60957e 100644
--- a/runtime/stpd/ChangeLog
+++ b/runtime/stpd/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-12 Frank Ch. Eigler <fche@elastic.org>
+
+ * librelay.c (init_stp): Use /proc/MODULE rather than
+ /proc/systemtap/MODULE.
+
2006-12-11 Martin Hunt <hunt@redhat.com>
* symbols.c (get_sections): Set buffer sizes to large enough
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index 04ea7285..6acbe7f8 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -516,8 +516,9 @@ int init_stp(int print_summary)
fprintf(stderr, "ERROR, couldn't insmod probe module %s\n", modpath);
return -1;
}
-
- sprintf (proc_filebase, "/proc/systemtap/%s", modname);
+
+ /* We no longer use /proc/systemtap/, just /proc. */
+ sprintf (proc_filebase, "/proc/%s", modname);
char *ptr = index(proc_filebase,'.');
if (ptr)
*ptr = 0;
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index ff092a93..54bde5d2 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-12 Frank Ch. Eigler <fche@elastic.org>
+
+ * procfs.c (_stp_register_procfs): Use /proc/MODULE rather than
+ /proc/systemtap/MODULE.
+
2007-03-12 Frank Ch. Eigler <fche@redhat.com>
PR 4179.
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c
index ca243035..64538ae6 100644
--- a/runtime/transport/procfs.c
+++ b/runtime/transport/procfs.c
@@ -302,7 +302,6 @@ err:
static int _stp_register_procfs (void)
{
int i;
- const char *dirname = "systemtap";
#ifdef STP_RELAYFS
int j;
char buf[8];
@@ -322,22 +321,13 @@ static int _stp_register_procfs (void)
_stp_allocated_net_memory += sizeof(struct _stp_buffer);
list_add (p, &_stp_pool_q);
}
-
- /* look for existing /proc/systemtap */
- for (de = proc_root.subdir; de; de = de->next) {
- if (my_proc_match (strlen (dirname), dirname, de)) {
- _stp_proc_root = de;
- break;
- }
- }
-
- /* create /proc/systemtap if it doesn't exist */
- if (_stp_proc_root == NULL) {
- _stp_proc_root = proc_mkdir (dirname, NULL);
- if (_stp_proc_root == NULL)
- goto err0;
- }
+ /* Formerly, we allocated /proc/systemtap, but unfortunately
+ that's racy with multiple concurrent probes. So now we set
+ _stp_proc_root to proc_root. This way, /proc/stap_XXXX
+ rather than /proc/systemtap/stap_XXXX will be the directory
+ under which cmd/ etc. will show up. */
+ _stp_proc_root = NULL;
/* now create /proc/systemtap/module_name */
_stp_proc_mod = proc_mkdir (THIS_MODULE->name, _stp_proc_root);
@@ -380,7 +370,7 @@ err1:
}
#endif
- remove_proc_entry (THIS_MODULE->name, _stp_proc_root);
+ remove_proc_entry (THIS_MODULE->name, _stp_proc_root);
err0:
list_for_each_safe(p, tmp, &_stp_pool_q) {
list_del(p);
@@ -409,7 +399,7 @@ static void _stp_unregister_procfs (void)
}
#endif
remove_proc_entry ("cmd", _stp_proc_mod);
- remove_proc_entry (THIS_MODULE->name, _stp_proc_root); /* XXX: race condition */
+ remove_proc_entry (THIS_MODULE->name, _stp_proc_root);
/* free memory pools */
list_for_each_safe(p, tmp, &_stp_pool_q) {