diff options
author | hunt <hunt> | 2005-08-29 18:49:10 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-08-29 18:49:10 +0000 |
commit | 10fcd0060d7b88bbf0503f85ecaf8c8660abeaaf (patch) | |
tree | 3b4d5f15e57fd7535dc91cdf6a0d5007278a7028 /runtime/stpd/stpd.c | |
parent | c195ad9312924a5d242193d7e22007ed5d5cb888 (diff) | |
download | systemtap-steved-10fcd0060d7b88bbf0503f85ecaf8c8660abeaaf.tar.gz systemtap-steved-10fcd0060d7b88bbf0503f85ecaf8c8660abeaaf.tar.xz systemtap-steved-10fcd0060d7b88bbf0503f85ecaf8c8660abeaaf.zip |
2005-08-29 Martin Hunt <hunt@redhat.com>
* stpd.c main): Add enable_relayfs flag.
Turn it off with "-r".
Diffstat (limited to 'runtime/stpd/stpd.c')
-rw-r--r-- | runtime/stpd/stpd.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c index 0a4cf57a..0b42ff6e 100644 --- a/runtime/stpd/stpd.c +++ b/runtime/stpd/stpd.c @@ -35,6 +35,7 @@ int print_only = 0; int quiet = 0; int merge = 1; int verbose = 0; +int enable_relayfs = 1; unsigned int buffer_size = 0; char *modname = NULL; char *modpath = NULL; @@ -67,7 +68,7 @@ int main(int argc, char **argv) int c, status; pid_t pid; - while ((c = getopt(argc, argv, "mpqb:n:v")) != EOF) + while ((c = getopt(argc, argv, "mpqrb:n:v")) != EOF) { switch (c) { case 'm': @@ -82,6 +83,9 @@ int main(int argc, char **argv) case 'v': verbose = 1; break; + case 'r': + enable_relayfs = 0; + break; case 'b': { int size = (unsigned)atoi(optarg); @@ -125,22 +129,25 @@ int main(int argc, char **argv) usage(argv[0]); } - /* now run the _stp_check script */ - if ((pid = vfork()) < 0) { - perror ("vfork"); - exit(-1); - } else if (pid == 0) { - if (execlp(stp_check, stp_check, NULL) < 0) - exit (-1); - } - if (waitpid(pid, &status, 0) < 0) { - perror("waitpid"); - exit(-1); - } - if (WIFEXITED(status) && WEXITSTATUS(status)) { - perror (stp_check); - fprintf(stderr, "Could not execute %s\n", stp_check); - exit(1); + + if (enable_relayfs) { + /* now run the _stp_check script */ + if ((pid = vfork()) < 0) { + perror ("vfork"); + exit(-1); + } else if (pid == 0) { + if (execlp(stp_check, stp_check, NULL) < 0) + exit (-1); + } + if (waitpid(pid, &status, 0) < 0) { + perror("waitpid"); + exit(-1); + } + if (WIFEXITED(status) && WEXITSTATUS(status)) { + perror (stp_check); + fprintf(stderr, "Could not execute %s\n", stp_check); + exit(1); + } } sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid()); |