From: Mathieu Desnoyers Date: Fri, 10 Feb 2012 18:17:11 +0000 (-0500) Subject: Set default loglevel in metadata X-Git-Tag: v1.9.7~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8155c5e81ae9d83764056746aee85b3a17d7db38;p=lttng-ust.git Set default loglevel in metadata Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index 9d5d8827..c4b67c6b 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -878,6 +878,7 @@ int _ltt_event_metadata_statedump(struct ltt_session *session, struct ltt_event *event) { int ret = 0; + int loglevel = TRACE_DEFAULT; if (event->metadata_dumped || !CMM_ACCESS_ONCE(session->active)) return 0; @@ -900,13 +901,14 @@ int _ltt_event_metadata_statedump(struct ltt_session *session, if (ret) goto end; - if (event->desc->loglevel) { - ret = lttng_metadata_printf(session, - " loglevel = %d;\n", - *(*event->desc->loglevel)); - if (ret) - goto end; - } + if (event->desc->loglevel) + loglevel = *(*event->desc->loglevel); + + ret = lttng_metadata_printf(session, + " loglevel = %d;\n", + loglevel); + if (ret) + goto end; if (event->ctx) { ret = lttng_metadata_printf(session,