From: compudj Date: Mon, 25 Jul 2005 19:57:23 +0000 (+0000) Subject: fix lttctl signal X-Git-Tag: v0.12.20~2519 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ada84671ff1a84b95c158eedcc2fe81f64eff15a;p=lttv.git fix lttctl signal git-svn-id: http://ltt.polymtl.ca/svn@970 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/doc/developer/ltt-experimental-rewrite.html b/ltt/branches/poly/doc/developer/ltt-experimental-rewrite.html index f3d82989..463ab96c 100644 --- a/ltt/branches/poly/doc/developer/ltt-experimental-rewrite.html +++ b/ltt/branches/poly/doc/developer/ltt-experimental-rewrite.html @@ -12,6 +12,7 @@ Fix the traps -> disable nested logging for now.
Use per cpu spinlock on trace list.
Finish the control module, libltt and lttctl : netlink interface
Finish integrating lttctl with lttd.
+fix lttctl signal waiting : use a flag.


* TODO
@@ -19,6 +20,7 @@ Add information in the buffer header : buffer size, etc etc...
-> this information is so small that we can repeat it. Makes flight recorder easier to decode.
Add trace start structure to facility channel.
+fix genevent : take no lock if num traces active is 0.



diff --git a/ltt/branches/poly/lttctl/lttctl.c b/ltt/branches/poly/lttctl/lttctl.c index 1eeb1b12..e4e2908e 100644 --- a/ltt/branches/poly/lttctl/lttctl.c +++ b/ltt/branches/poly/lttctl/lttctl.c @@ -32,9 +32,12 @@ static enum trace_ctl_op op = CTL_OP_NONE; static char *channel_root = NULL; static char *trace_root = NULL; +static int sigio_received = 0; + void handler(int signo) { printf("signal %d received\n", signo); + sigio_received = 1; } @@ -220,12 +223,13 @@ int lttctl_daemon(struct lttctl_handle *handle, char *trace_name) sigaddset(&(act.sa_mask), SIGIO); sigaction(SIGIO, &act, NULL); + sigio_received = 0; + pid = fork(); if(pid > 0) { - //sleep(1); /* parent */ - pause(); + while(!sigio_received) pause(); /* Now the trace is created, go on and create the supplementary files... */ printf("Creating supplementary trace files\n");