When listing events, show exclusions if they exist
authorJP Ikaheimonen <jp_ikaheimonen@mentor.com>
Tue, 5 Nov 2013 14:50:30 +0000 (16:50 +0200)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 14 Nov 2013 18:40:58 +0000 (13:40 -0500)
Add "[has exclusions]" to the printout of an event, if that
event has exclusions added.

include/lttng/lttng.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng/commands/list.c

index 255f7c42eeae2c9a3f447ce445f16fa6d62c97dc..85fdfaa257605f36ebbd7d99030e8f3ca32e97b9 100644 (file)
@@ -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];
 
index 69dfda6a3bf384813cc62189c2299348e12929b5..d00bf1e3bdde5acb6ff81c650c571304f38a66ef 100644 (file)
@@ -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++;
        }
 
index bca06e75d49cecd7bee2b07a03aa415f7e468aba..6a54279f912fa9984d7419a06fbe64c6f64fabaf 100644 (file)
@@ -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;
This page took 0.02911 seconds and 5 git commands to generate.