From ada84671ff1a84b95c158eedcc2fe81f64eff15a Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 25 Jul 2005 19:57:23 +0000 Subject: [PATCH] fix lttctl signal git-svn-id: http://ltt.polymtl.ca/svn@970 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/doc/developer/ltt-experimental-rewrite.html | 2 ++ ltt/branches/poly/lttctl/lttctl.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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"); -- 2.34.1