Add loglevel to event list
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Dec 2011 01:20:10 +0000 (20:20 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Dec 2011 01:20:10 +0000 (20:20 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/lttng.h
lttng-sessiond/ust-app.c
lttng/commands/list.c

index 6fd56fa3ea94a7cf870c8432606c92c94fe96573..3dd915f61a6f10716df834072b35767e04e87d9b 100644 (file)
@@ -68,6 +68,7 @@ enum lttng_event_type {
        LTTNG_EVENT_FUNCTION_ENTRY            = 3,
        LTTNG_EVENT_NOOP                      = 4,
        LTTNG_EVENT_SYSCALL                   = 5,
+       LTTNG_EVENT_TRACEPOINT_LOGLEVEL       = 6,
 };
 
 /*
@@ -143,6 +144,7 @@ struct lttng_event_function_attr {
  */
 struct lttng_event {
        char name[LTTNG_SYMBOL_NAME_LEN];
+       char loglevel[LTTNG_SYMBOL_NAME_LEN];
        enum lttng_event_type type;
        uint32_t enabled;
        pid_t pid;
index 3847004d4349abe70e17a517cfeb8b07b8da3f23..f5dfb110bd15c8116017636a96420f0b89caddaa 100644 (file)
@@ -1383,7 +1383,6 @@ int ust_app_list_events(struct lttng_event **events)
 
                while ((ret = ustctl_tracepoint_list_get(app->key.sock, handle,
                                                &iter)) != -ENOENT) {
-                       /* TODO : get loglevel too */
                        if (count >= nbmem) {
                                DBG2("Reallocating event list from %zu to %zu entries", nbmem,
                                                2 * nbmem);
@@ -1396,6 +1395,7 @@ int ust_app_list_events(struct lttng_event **events)
                                }
                        }
                        memcpy(tmp[count].name, iter.name, LTTNG_UST_SYM_NAME_LEN);
+                       memcpy(tmp[count].loglevel, iter.loglevel, LTTNG_UST_SYM_NAME_LEN);
                        tmp[count].type = LTTNG_UST_TRACEPOINT;
                        tmp[count].pid = app->key.pid;
                        tmp[count].enabled = -1;
index abbdea1ba8bb904c86508c3ef965100073dd225c..4b29d4dc98dced934593c6f1317a6fb1730440d2 100644 (file)
@@ -131,6 +131,24 @@ const char *enabled_string(int value)
        }
 }
 
+static
+const char *loglevel_string_pre(const char *loglevel)
+{
+       if (loglevel[0] == '\0')
+               return "";
+       else
+               return " (loglevel: ";
+}
+
+static
+const char *loglevel_string_post(const char *loglevel)
+{
+       if (loglevel[0] == '\0')
+               return "";
+       else
+               return ")";
+}
+
 /*
  * Pretty print single event.
  */
@@ -138,8 +156,12 @@ static void print_events(struct lttng_event *event)
 {
        switch (event->type) {
        case LTTNG_EVENT_TRACEPOINT:
-               MSG("%s%s (type: tracepoint)%s", indent6,
-                               event->name, enabled_string(event->enabled));
+               MSG("%s%s%s%s%s (type: tracepoint)%s", indent6,
+                               event->name,
+                               loglevel_string_pre(event->loglevel),
+                               event->loglevel,
+                               loglevel_string_post(event->loglevel),
+                               enabled_string(event->enabled));
                break;
        case LTTNG_EVENT_PROBE:
                MSG("%s%s (type: probe)%s", indent6,
@@ -165,6 +187,10 @@ static void print_events(struct lttng_event *event)
                MSG("%s (type: noop)%s", indent6,
                                enabled_string(event->enabled));
                break;
+       case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
+               MSG("%s%s (type: tracepoint loglevel)%s", indent6,
+                               event->name, enabled_string(event->enabled));
+               break;
        case LTTNG_EVENT_ALL:
                /* We should never have "all" events in list. */
                assert(0);
This page took 0.04076 seconds and 4 git commands to generate.