From 4634f12e972571bf8ab9cb3892e1d472aa7e0ddc Mon Sep 17 00:00:00 2001 From: JP Ikaheimonen Date: Tue, 5 Nov 2013 16:50:30 +0200 Subject: [PATCH] When listing events, show exclusions if they exist Add "[has exclusions]" to the printout of an event, if that event has exclusions added. --- include/lttng/lttng.h | 3 ++- src/bin/lttng-sessiond/cmd.c | 3 +++ src/bin/lttng/commands/list.c | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 255f7c42e..85fdfaa25 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -226,7 +226,7 @@ struct lttng_event_function_attr { * * The structures should be initialized to zero before use. */ -#define LTTNG_EVENT_PADDING1 15 +#define LTTNG_EVENT_PADDING1 14 #define LTTNG_EVENT_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32 struct lttng_event { enum lttng_event_type type; @@ -238,6 +238,7 @@ struct lttng_event { int32_t enabled; /* Does not apply: -1 */ pid_t pid; unsigned char filter; /* filter enabled ? */ + unsigned char exclusion; /* exclusions added ? */ char padding[LTTNG_EVENT_PADDING1]; diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 69dfda6a3..d00bf1e3b 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -305,6 +305,9 @@ static int list_lttng_ust_global_events(char *channel_name, if (uevent->filter) { tmp[i].filter = 1; } + if (uevent->exclusion) { + tmp[i].exclusion = 1; + } i++; } diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index bca06e75d..6a54279f9 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -168,6 +168,15 @@ const char *filter_string(int value) } } +static +const char *exclusion_string(int value) +{ + switch (value) { + case 1: return " [has exclusions]"; + default: return ""; + } +} + static const char *loglevel_string(int value) { switch (value) { @@ -217,18 +226,20 @@ static void print_events(struct lttng_event *event) case LTTNG_EVENT_TRACEPOINT: { if (event->loglevel != -1) { - MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s", + MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s%s", indent6, event->name, loglevel_string(event->loglevel), event->loglevel, enabled_string(event->enabled), + exclusion_string(event->exclusion), filter_string(event->filter)); } else { - MSG("%s%s (type: tracepoint)%s%s", + MSG("%s%s (type: tracepoint)%s%s%s", indent6, event->name, enabled_string(event->enabled), + exclusion_string(event->exclusion), filter_string(event->filter)); } break; -- 2.34.1