summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2005-08-19 15:55:39 +0000
committerfche <fche>2005-08-19 15:55:39 +0000
commit0aaf677efbf70fd173d241c01632b4eacc8226e5 (patch)
tree011aac91bb983ba9f31b3bbee4829a7365d306f9
parent37908791bf273ecdf073a8bd848501d2137cd71a (diff)
downloadsystemtap-steved-0aaf677efbf70fd173d241c01632b4eacc8226e5.tar.gz
systemtap-steved-0aaf677efbf70fd173d241c01632b4eacc8226e5.tar.xz
systemtap-steved-0aaf677efbf70fd173d241c01632b4eacc8226e5.zip
2005-08-19 Frank Ch. Eigler <fche@elastic.org>
* librelay.c (modpath): New global. Use it for insmod only. * stpd.c (main): Set both modpath and modname, to support modules specified by full path name.
-rw-r--r--runtime/stpd/ChangeLog6
-rw-r--r--runtime/stpd/librelay.c5
-rw-r--r--runtime/stpd/stpd.c11
3 files changed, 19 insertions, 3 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog
index c1f1530e..e9b1a793 100644
--- a/runtime/stpd/ChangeLog
+++ b/runtime/stpd/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-19 Frank Ch. Eigler <fche@elastic.org>
+
+ * librelay.c (modpath): New global. Use it for insmod only.
+ * stpd.c (main): Set both modpath and modname, to support
+ modules specified by full path name.
+
2005-08-19 Martin Hunt <hunt@redhat.com>
* stpd.c (main): Simplify buffer size code.
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index fabbd145..6bceb99f 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -84,6 +84,7 @@ static int control_channel;
extern int print_only, quiet, merge, verbose;
extern unsigned int buffer_size;
extern char *modname;
+extern char *modpath;
/* per-cpu buffer info */
static struct buf_status
@@ -424,7 +425,7 @@ int init_stp(const char *relay_filebase, int print_summary)
perror ("vfork");
exit(-1);
} else if (pid == 0) {
- if (execl("/sbin/insmod", "insmod", modname, buf, NULL) < 0)
+ if (execl("/sbin/insmod", "insmod", modpath, buf, NULL) < 0)
exit(-1);
}
if (waitpid(pid, &rstatus, 0) < 0) {
@@ -432,7 +433,7 @@ int init_stp(const char *relay_filebase, int print_summary)
exit(-1);
}
if (WIFEXITED(rstatus) && WEXITSTATUS(rstatus)) {
- fprintf(stderr, "ERROR, couldn't insmod probe module %s\n", modname);
+ fprintf(stderr, "ERROR, couldn't insmod probe module %s\n", modpath);
return -1;
}
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c
index db0f328e..0a4cf57a 100644
--- a/runtime/stpd/stpd.c
+++ b/runtime/stpd/stpd.c
@@ -37,6 +37,7 @@ int merge = 1;
int verbose = 0;
unsigned int buffer_size = 0;
char *modname = NULL;
+char *modpath = NULL;
/* relayfs base file name */
static char stpd_filebase[1024];
@@ -104,7 +105,15 @@ int main(int argc, char **argv)
}
if (optind < argc)
- modname = argv[optind++];
+ {
+ /* Collect both full path and just the trailing module name. */
+ modpath = argv[optind++];
+ modname = rindex (modpath, '/');
+ if (modname == NULL)
+ modname = modpath;
+ else
+ modname++; /* skip over / */
+ }
if (!modname) {
fprintf (stderr, "Cannot invoke daemon without probe module\n");