Loglevel fixes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 6 Feb 2012 22:18:22 +0000 (17:18 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 6 Feb 2012 22:18:22 +0000 (17:18 -0500)
- fix event list bug due to loglevel error,
- enforce "-1" loglevel value in the sessiond when ALL loglevels are
  selected.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/trace-ust.c
src/bin/lttng/commands/enable_events.c

index 61a762803668af2ffbbc330303b5034010bc6b87..bf20850003ece493934432f876af883a59979f58 100644 (file)
@@ -2035,13 +2035,13 @@ static int list_lttng_ust_global_events(char *channel_name,
                tmp[i].loglevel = uevent->attr.loglevel;
                switch (uevent->attr.loglevel_type) {
                case LTTNG_UST_LOGLEVEL_ALL:
-                       tmp[i].type = LTTNG_EVENT_LOGLEVEL_ALL;
+                       tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
                        break;
                case LTTNG_UST_LOGLEVEL_RANGE:
-                       tmp[i].type = LTTNG_EVENT_LOGLEVEL_RANGE;
+                       tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_RANGE;
                        break;
                case LTTNG_UST_LOGLEVEL_SINGLE:
-                       tmp[i].type = LTTNG_EVENT_LOGLEVEL_SINGLE;
+                       tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_SINGLE;
                        break;
                }
                i++;
index 236e7685b5900cf14362af6a1e8202911604f28b..ce6332d931618178948c64095abe1264cbc35315 100644 (file)
@@ -225,20 +225,21 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev)
        switch (ev->loglevel_type) {
        case LTTNG_EVENT_LOGLEVEL_ALL:
                lue->attr.loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
+               lue->attr.loglevel = -1;        /* Force to -1 */
                break;
        case LTTNG_EVENT_LOGLEVEL_RANGE:
                lue->attr.loglevel_type = LTTNG_UST_LOGLEVEL_RANGE;
+               lue->attr.loglevel = ev->loglevel;
                break;
        case LTTNG_EVENT_LOGLEVEL_SINGLE:
                lue->attr.loglevel_type = LTTNG_UST_LOGLEVEL_SINGLE;
+               lue->attr.loglevel = ev->loglevel;
                break;
        default:
                ERR("Unknown ust loglevel type (%d)", ev->type);
                goto error_free_event;
        }
 
-       /* Copy loglevel */
-       lue->attr.loglevel = ev->loglevel;
 
        /* Init node */
        lttng_ht_node_init_str(&lue->node, lue->attr.name);
index db0597dfbf1617cd1521931549e57e1680595e6e..e8f55dc7538794c23596f44b1e55faf0ce2fd9e6 100644 (file)
@@ -330,6 +330,8 @@ static int enable_events(char *session_name)
                                        ret = -1;
                                        goto error;
                                }
+                       } else {
+                               ev.loglevel = -1;
                        }
                }
 
@@ -460,6 +462,8 @@ static int enable_events(char *session_name)
                                        ret = -1;
                                        goto error;
                                }
+                       } else {
+                               ev.loglevel = -1;
                        }
                } else {
                        ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
This page took 0.029371 seconds and 4 git commands to generate.