X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Flttngtop.c;h=a33e1d828ceb57f3248b16a19b8d50366bfed227;hp=08376cd6b0199aac096088b9e8b40a9a7f73a8c1;hb=2479719885485a6b991b47898d0c77a63f6b9513;hpb=96aa77debf3aee00361101fb2e76781c65f02ba9 diff --git a/src/lttngtop.c b/src/lttngtop.c index 08376cd..a33e1d8 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;