From b7f087665742905f5a4bfe722bf9929f8805b3d7 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 14 Sep 2005 23:59:38 +0000 Subject: [PATCH] separate -m mode and -c git-svn-id: http://ltt.polymtl.ca/svn@1192 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttctl/lttctl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ltt/branches/poly/lttctl/lttctl.c b/ltt/branches/poly/lttctl/lttctl.c index 0e6cefd7..fe4be9b1 100644 --- a/ltt/branches/poly/lttctl/lttctl.c +++ b/ltt/branches/poly/lttctl/lttctl.c @@ -27,8 +27,10 @@ #define BUF_SIZE 4194304 enum trace_ctl_op { + CTL_OP_CREATE_START, CTL_OP_CREATE, CTL_OP_DESTROY, + CTL_OP_STOP_DESTROY, CTL_OP_START, CTL_OP_STOP, CTL_OP_DAEMON, @@ -62,10 +64,12 @@ void show_arguments(void) printf("Please use the following arguments :\n"); printf("\n"); printf("-n name Name of the trace.\n"); + printf("-b Create trace channels and start tracing (no daemon).\n"); printf("-c Create trace channels.\n"); printf("-m mode Normal or flight recorder mode.\n"); printf(" Mode values : normal (default) or flight.\n"); printf("-r Destroy trace channels.\n"); + printf("-R Stop tracing and destroy trace channels.\n"); printf("-s Start tracing.\n"); //printf(" Note : will automatically create a normal trace if " // "none exists.\n"); @@ -116,6 +120,8 @@ int parse_arguments(int argc, char **argv) } break; + case 'b': + op = CTL_OP_CREATE_START; case 'c': op = CTL_OP_CREATE; break; @@ -141,6 +147,9 @@ int parse_arguments(int argc, char **argv) case 'r': op = CTL_OP_DESTROY; break; + case 'R': + op = CTL_OP_STOP_DESTROY; + break; case 's': op = CTL_OP_START; break; @@ -420,6 +429,12 @@ int main(int argc, char ** argv) if(handle == NULL) return -1; switch(op) { + case CTL_OP_CREATE_START: + ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size, + n_subbufs); + if(!ret) + ret = lttctl_start(handle, trace_name); + break; case CTL_OP_CREATE: ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size, n_subbufs); @@ -427,6 +442,11 @@ int main(int argc, char ** argv) case CTL_OP_DESTROY: ret = lttctl_destroy_trace(handle, trace_name); break; + case CTL_OP_STOP_DESTROY: + ret = lttctl_stop(handle, trace_name); + if(!ret) + ret = lttctl_destroy_trace(handle, trace_name); + break; case CTL_OP_START: ret = lttctl_start(handle, trace_name); break; -- 2.34.1