summaryrefslogtreecommitdiffstats
path: root/runtime/staprun
diff options
context:
space:
mode:
authorhunt <hunt>2007-06-07 17:50:25 +0000
committerhunt <hunt>2007-06-07 17:50:25 +0000
commit7845f88ce997eb709cbe4513b595dea5a5da0c5c (patch)
treeda4d4fc5b0e8e36e9881a0cccfcf1dd4c4a67e11 /runtime/staprun
parent8d2e746e17e36ecbb6678f81c0bcaec4d2db627c (diff)
downloadsystemtap-steved-7845f88ce997eb709cbe4513b595dea5a5da0c5c.tar.gz
systemtap-steved-7845f88ce997eb709cbe4513b595dea5a5da0c5c.tar.xz
systemtap-steved-7845f88ce997eb709cbe4513b595dea5a5da0c5c.zip
2007-06-07 Martin Hunt <hunt@redhat.com>
* relay_old.c (open_relayfs_files): Add support for output file names (-o) with bulk (relayfs) mode.
Diffstat (limited to 'runtime/staprun')
-rw-r--r--runtime/staprun/ChangeLog5
-rw-r--r--runtime/staprun/relay_old.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog
index cf05e41b..2ccfbb8a 100644
--- a/runtime/staprun/ChangeLog
+++ b/runtime/staprun/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-07 Martin Hunt <hunt@redhat.com>
+
+ * relay_old.c (open_relayfs_files): Add support for
+ output file names (-o) with bulk (relayfs) mode.
+
2007-06-04 Martin Hunt <hunt@redhat.com>
* mainloop.c (cleanup_and_exit): Disable signals
diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c
index 11a73cd7..01acbbd6 100644
--- a/runtime/staprun/relay_old.c
+++ b/runtime/staprun/relay_old.c
@@ -14,7 +14,6 @@
#include "staprun.h"
/* temporary per-cpu output written here for relayfs, filebase0...N */
-static char *percpu_tmpfilebase = "stpd_cpu";
static int relay_fd[NR_CPUS];
static int proc_fd[NR_CPUS];
static FILE *percpu_tmpfile[NR_CPUS];
@@ -98,7 +97,15 @@ static int open_relayfs_files(int cpu, const char *relay_filebase, const char *p
goto err1;
}
- sprintf(tmp, "%s%d", percpu_tmpfilebase, cpu);
+ if (outfile_name) {
+ /* special case: for testing we sometimes want to write to /dev/null */
+ if (strcmp(outfile_name, "/dev/null") == 0)
+ strcpy(tmp, outfile_name);
+ else
+ sprintf(tmp, "%s_%d", outfile_name, cpu);
+ } else
+ sprintf(tmp, "stpd_cpu%d", cpu);
+
if((percpu_tmpfile[cpu] = fopen(tmp, "w+")) == NULL) {
fprintf(stderr, "ERROR: Couldn't open output file %s: errcode = %s\n", tmp, strerror(errno));
goto err2;