From 22e25b7152253d44385314fc7cdc5faa4e11e30f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 6 Feb 2012 17:18:22 -0500 Subject: [PATCH] Loglevel fixes - 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 --- src/bin/lttng-sessiond/main.c | 6 +++--- src/bin/lttng-sessiond/trace-ust.c | 5 +++-- src/bin/lttng/commands/enable_events.c | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 61a762803..bf2085000 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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++; diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 236e7685b..ce6332d93 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -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); diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index db0597dfb..e8f55dc75 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -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)"); -- 2.34.1