From: Mathieu Desnoyers Date: Fri, 13 Jul 2012 18:36:39 +0000 (-0400) Subject: Show that filter is enabled when listing session events X-Git-Tag: v2.1.0-rc1~91 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fceb65dfca20fb1e2071a44ada9fe61384d2b890;p=lttng-tools.git Show that filter is enabled when listing session events Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 598abe077..0c32d941a 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -269,7 +269,7 @@ struct lttng_event_function_attr { * * The structures should be initialized to zero before use. */ -#define LTTNG_EVENT_PADDING1 16 +#define LTTNG_EVENT_PADDING1 15 #define LTTNG_EVENT_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32 struct lttng_event { enum lttng_event_type type; @@ -280,6 +280,7 @@ struct lttng_event { int32_t enabled; /* Does not apply: -1 */ pid_t pid; + unsigned char filter; /* filter enabled ? */ char padding[LTTNG_EVENT_PADDING1]; diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index e2ca01eb5..2abf9d0e7 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2350,6 +2350,9 @@ static int list_lttng_ust_global_events(char *channel_name, tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_SINGLE; break; } + if (uevent->filter) { + tmp[i].filter = 1; + } i++; } diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 966be2def..afd7cf0b3 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -146,6 +146,15 @@ const char *enabled_string(int value) } } +static +const char *filter_string(int value) +{ + switch (value) { + case 1: return " [with filter]"; + default: return ""; + } +} + static const char *loglevel_string(int value) { switch (value) { @@ -195,23 +204,26 @@ 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", + MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s", indent6, event->name, loglevel_string(event->loglevel), event->loglevel, - enabled_string(event->enabled)); + enabled_string(event->enabled), + filter_string(event->filter)); } else { - MSG("%s%s (type: tracepoint)%s", + MSG("%s%s (type: tracepoint)%s%s", indent6, event->name, - enabled_string(event->enabled)); + enabled_string(event->enabled), + filter_string(event->filter)); } break; } case LTTNG_EVENT_PROBE: - MSG("%s%s (type: probe)%s", indent6, - event->name, enabled_string(event->enabled)); + MSG("%s%s (type: probe)%s%s", indent6, + event->name, enabled_string(event->enabled), + filter_string(event->filter)); if (event->attr.probe.addr != 0) { MSG("%saddr: 0x%" PRIx64, indent8, event->attr.probe.addr); } else { @@ -221,17 +233,20 @@ static void print_events(struct lttng_event *event) break; case LTTNG_EVENT_FUNCTION: case LTTNG_EVENT_FUNCTION_ENTRY: - MSG("%s%s (type: function)%s", indent6, - event->name, enabled_string(event->enabled)); + MSG("%s%s (type: function)%s%s", indent6, + event->name, enabled_string(event->enabled), + filter_string(event->filter)); MSG("%ssymbol: \"%s\"", indent8, event->attr.ftrace.symbol_name); break; case LTTNG_EVENT_SYSCALL: - MSG("%ssyscalls (type: syscall)%s", indent6, - enabled_string(event->enabled)); + MSG("%ssyscalls (type: syscall)%s%s", indent6, + enabled_string(event->enabled), + filter_string(event->filter)); break; case LTTNG_EVENT_NOOP: - MSG("%s (type: noop)%s", indent6, - enabled_string(event->enabled)); + MSG("%s (type: noop)%s%s", indent6, + enabled_string(event->enabled), + filter_string(event->filter)); break; case LTTNG_EVENT_ALL: /* We should never have "all" events in list. */