Show that filter is enabled when listing session events
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Jul 2012 18:36:39 +0000 (14:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Jul 2012 18:36:39 +0000 (14:36 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/lttng.h
src/bin/lttng-sessiond/main.c
src/bin/lttng/commands/list.c

index 598abe07777d4b8594219e980ed242795d74b31d..0c32d941af6e17e859a41857c0d800d7be0cb5c2 100644 (file)
@@ -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];
 
index e2ca01eb54fe6541323f971095c1d329f28cf747..2abf9d0e79b5015b015f03c23bf5d5ee73092137 100644 (file)
@@ -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++;
        }
 
index 966be2def5e3ac8f300e47ab65e2db149c7c3a21..afd7cf0b3172c291046710c621625d465c675c3b 100644 (file)
@@ -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. */
This page took 0.029645 seconds and 4 git commands to generate.