X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Flttngtop.c;h=be323eb5cc6761cf3e70d628c282042d3b2c707c;hb=828afa52c44e005619fb37f94f0122857a7298f6;hp=5c3267ef60ffc11d37a01f8988befcbccc8b2eef;hpb=c941855cb55c6869d8935d5c9680ad705a393504;p=lttngtop.git diff --git a/src/lttngtop.c b/src/lttngtop.c index 5c3267e..be323eb 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -90,6 +90,12 @@ static struct poptOption long_options[] = { { NULL, 0, 0, NULL, 0, NULL, NULL }, }; +static void handle_textdump_sigterm(int signal) +{ + quit = 1; + lttng_destroy_session("test"); +} + void *refresh_thread(void *p) { struct mmap_stream *mmap_info; @@ -1034,6 +1040,10 @@ int main(int argc, char **argv) } if (!opt_input_path) { + if (opt_textdump) { + signal(SIGTERM, handle_textdump_sigterm); + signal(SIGINT, handle_textdump_sigterm); + } ret = setup_live_tracing(); if (ret < 0) { goto end;