X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=a57409d411b10ac09e53e655ca9cfc8c4a215710;hb=ff94328ff1538f1da009e81a27bbd922ef031727;hp=161680a6cdbda4ae27397efee2d6f4d694946083;hpb=8382cf6f76c29b0451b7fe986c6b882d6029ca47;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 161680a6c..a57409d41 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -166,6 +166,8 @@ static void list_lttng_channels(int domain, struct ltt_session *session, channels[i].attr.read_timer_interval = uchan->attr.read_timer_interval; channels[i].enabled = uchan->enabled; + channels[i].attr.tracefile_size = uchan->tracefile_size; + channels[i].attr.tracefile_count = uchan->tracefile_count; switch (uchan->attr.output) { case LTTNG_UST_MMAP: default: @@ -219,6 +221,8 @@ static int list_lttng_jul_events(struct jul_domain *dom, strncpy(tmp_events[i].name, event->name, sizeof(tmp_events[i].name)); tmp_events[i].name[sizeof(tmp_events[i].name) - 1] = '\0'; tmp_events[i].enabled = event->enabled; + tmp_events[i].loglevel = event->loglevel; + tmp_events[i].loglevel_type = event->loglevel_type; i++; } rcu_read_unlock(); @@ -823,7 +827,7 @@ static int start_kernel_session(struct ltt_kernel_session *ksess, int wpipe) /* Quiescent wait after starting trace */ kernel_wait_quiescent(kernel_tracer_fd); - ksess->started = 1; + ksess->active = 1; ret = LTTNG_OK; @@ -931,6 +935,16 @@ int cmd_enable_channel(struct ltt_session *session, attr->attr.switch_timer_interval = 0; } + /* + * The ringbuffer (both in user space and kernel) behave badly in overwrite + * mode and with less than 2 subbuf so block it right away and send back an + * invalid attribute error. + */ + if (attr->attr.overwrite && attr->attr.num_subbuf < 2) { + ret = LTTNG_ERR_INVALID; + goto error; + } + switch (domain->type) { case LTTNG_DOMAIN_KERNEL: { @@ -1445,7 +1459,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, tmp_dom.type = LTTNG_DOMAIN_UST; ret = cmd_enable_event(session, &tmp_dom, DEFAULT_JUL_CHANNEL_NAME, - &uevent, NULL, NULL, NULL, wpipe); + &uevent, filter_expression, filter, NULL, wpipe); if (ret != LTTNG_OK && ret != LTTNG_ERR_UST_EVENT_ENABLED) { goto error; } @@ -1819,7 +1833,11 @@ int cmd_start_trace(struct ltt_session *session) /* Flag session that trace should start automatically */ if (usess) { - usess->start_trace = 1; + /* + * Even though the start trace might fail, flag this session active so + * other application coming in are started by default. + */ + usess->active = 1; ret = ust_app_start_trace_all(usess); if (ret < 0) { @@ -1861,7 +1879,7 @@ int cmd_stop_trace(struct ltt_session *session) } /* Kernel tracer */ - if (ksession && ksession->started) { + if (ksession && ksession->active) { DBG("Stop kernel tracing"); /* Flush metadata if exist */ @@ -1888,11 +1906,15 @@ int cmd_stop_trace(struct ltt_session *session) kernel_wait_quiescent(kernel_tracer_fd); - ksession->started = 0; + ksession->active = 0; } - if (usess && usess->start_trace) { - usess->start_trace = 0; + if (usess && usess->active) { + /* + * Even though the stop trace might fail, flag this session inactive so + * other application coming in are not started by default. + */ + usess->active = 0; ret = ust_app_stop_trace_all(usess); if (ret < 0) {