Fix: (slight UI change) refuse missing -c if non-default channel exists
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 19 Jul 2013 13:04:29 +0000 (09:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 19 Jul 2013 13:11:13 +0000 (09:11 -0400)
commit850767541647c102a299d7fbc39c97555ac70224
treee8ce566cdd4a157065a3038ccff9d21680c12e86
parentb0a5f0fbc428de5cd15a5c86f95a12f32e8c3c88
Fix: (slight UI change) refuse missing -c if non-default channel exists

After a user creates a channel within a session, creating a "default"
channel if a user forgets to put "-c channel_name" in the following
add-context, enable-event, disable-event commands is misleading.  The
natural expected behavior would be that the command would apply the the
last enabled channel (notion of a "current" channel, like we have for
sessions), but certainly not that it creates a new channel with default
attributes behind the user's back.

An intermediate fix that would not require to keep a notion of current
channel is to refuse creation of a default channel if at least one
non-default channel has already been created in the session.

This commit affects enable-event, disable-event and add-context
commands.

This fix belongs to the 2.3-rc cycle, and cannot be backported, since
it:

a) changes the user interface of lttng (returns an error in the case
   where -c name is missing and the session contains an non-default
   channel)
b) changes the ABI between lttng-ctl and sessiond: a default channel is
   now expressed as an empty string ('\0') rather than by "channel0",
   which allows making the difference between an explicit "channel0"
   channel and a default channel in the session daemon.

Fixes #522

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 files changed:
doc/man/lttng.1
include/lttng/lttng-error.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/trace-kernel.c
src/bin/lttng-sessiond/trace-kernel.h
src/bin/lttng-sessiond/trace-ust.c
src/bin/lttng-sessiond/trace-ust.h
src/bin/lttng/commands/disable_events.c
src/bin/lttng/commands/enable_events.c
src/common/error.c
src/common/ust-consumer/ust-consumer.c
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.028235 seconds and 5 git commands to generate.