summaryrefslogtreecommitdiffstats
path: root/runtime/stpd/stpd.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-09-06 17:13:56 +0000
committerhunt <hunt>2005-09-06 17:13:56 +0000
commitc0b3ea3235ced04f5f372c98c5ea321e2da22c59 (patch)
treeb071fe11b66d3fcae27a6ba112ea02e6222931e0 /runtime/stpd/stpd.c
parenta899efa27ced5705b76155eee371bc16cdb2742e (diff)
downloadsystemtap-steved-c0b3ea3235ced04f5f372c98c5ea321e2da22c59.tar.gz
systemtap-steved-c0b3ea3235ced04f5f372c98c5ea321e2da22c59.tar.xz
systemtap-steved-c0b3ea3235ced04f5f372c98c5ea321e2da22c59.zip
2005-09-06 Martin Hunt <hunt@redhat.com>
* librelay.c: Remove all USE_PROCFS ifdefs. (sig_usr): Signal handler for SIGUSR1. (start_cmd): New function to handle "-c" option, forks() off a new process then waits for SIGUSR1 to exec it. (init_stp): Call start_cmd(). (stp_main_loop): Set a signal handler for SIGCHLD. * stpd.c (main): Add "-t" and "-c" options. (usage): Update with new options.
Diffstat (limited to 'runtime/stpd/stpd.c')
-rw-r--r--runtime/stpd/stpd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c
index 0b42ff6e..2fecc380 100644
--- a/runtime/stpd/stpd.c
+++ b/runtime/stpd/stpd.c
@@ -36,9 +36,11 @@ int quiet = 0;
int merge = 1;
int verbose = 0;
int enable_relayfs = 1;
+int target_pid = 0;
unsigned int buffer_size = 0;
char *modname = NULL;
char *modpath = NULL;
+char *target_cmd = NULL;
/* relayfs base file name */
static char stpd_filebase[1024];
@@ -52,10 +54,14 @@ char *stp_check="stp_check";
static void usage(char *prog)
{
- fprintf(stderr, "\n%s [-m] [-p] [-q] [-b bufsize] [-n num_subbufs] kmod-name\n", prog);
+ fprintf(stderr, "\n%s [-m] [-p] [-q] [-r] [-c cmd ] [-t pid] [-b bufsize] kmod-name\n", prog);
fprintf(stderr, "-m Don't merge per-cpu files.\n");
fprintf(stderr, "-p Print only. Don't log to files.\n");
fprintf(stderr, "-q Quiet. Don't display trace to stdout.\n");
+ fprintf(stderr, "-r Disable running stp_check and loading relayfs module.\n");
+ fprintf(stderr, "-c cmd. Command \'cmd\' will be run and stpd will exit when it does.\n");
+ fprintf(stderr, " _stp_target will contain the pid for the command.\n");
+ fprintf(stderr, "-t pid. Sets _stp_target to pid.\n");
fprintf(stderr, "-b buffer size. The systemtap module will specify a buffer size.\n");
fprintf(stderr, " Setting one here will override that value. The value should be\n");
fprintf(stderr, " an integer between 1 and 64 which be assumed to be the\n");
@@ -68,7 +74,7 @@ int main(int argc, char **argv)
int c, status;
pid_t pid;
- while ((c = getopt(argc, argv, "mpqrb:n:v")) != EOF)
+ while ((c = getopt(argc, argv, "mpqrb:n:t:c:v")) != EOF)
{
switch (c) {
case 'm':
@@ -98,6 +104,12 @@ int main(int argc, char **argv)
buffer_size = size;
break;
}
+ case 't':
+ target_pid = atoi(optarg);
+ break;
+ case 'c':
+ target_cmd = optarg;
+ break;
default:
usage(argv[0]);
}