X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_channels.c;h=194ec541eae167077597997fce467e3f10c101bd;hb=a0377dfefe40662ba7d68617bce6ff467114136c;hp=59fde7d4cec50c7c2486c6951d7edae157024030;hpb=ab5be9fa2eb5ba9600a82cd18fd3cfcbac69169a;p=lttng-tools.git diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 59fde7d4c..194ec541e 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -14,13 +14,14 @@ #include #include #include -#include #include #include #include #include +#include + #include "../command.h" #include "../utils.h" @@ -179,7 +180,7 @@ static int enable_channel(char *session_name) } } else { /* Checked by the caller. */ - assert(0); + abort(); } set_default_attr(&dom); @@ -220,7 +221,7 @@ static int enable_channel(char *session_name) /* Mi open channels element */ if (lttng_opt_mi) { - assert(writer); + LTTNG_ASSERT(writer); ret = mi_lttng_channels_open(writer); if (ret) { ret = CMD_ERROR; @@ -304,7 +305,8 @@ static int enable_channel(char *session_name) } } else { MSG("%s channel %s enabled for session %s", - get_domain_str(dom.type), channel_name, session_name); + lttng_domain_type_str(dom.type), + channel_name, session_name); success = 1; } @@ -424,7 +426,7 @@ int cmd_enable_channels(int argc, const char **argv) } order = get_count_order_u64(chan_opts.attr.subbuf_size); - assert(order >= 0); + LTTNG_ASSERT(order >= 0); rounded_size = 1ULL << order; if (rounded_size < chan_opts.attr.subbuf_size) { ERR("The subbuf size (%" PRIu64 ") is rounded and overflows!", @@ -440,7 +442,7 @@ int cmd_enable_channels(int argc, const char **argv) } /* Should now be power of 2 */ - assert(!((chan_opts.attr.subbuf_size - 1) & chan_opts.attr.subbuf_size)); + LTTNG_ASSERT(!((chan_opts.attr.subbuf_size - 1) & chan_opts.attr.subbuf_size)); DBG("Channel subbuf size set to %" PRIu64, chan_opts.attr.subbuf_size); break; @@ -460,7 +462,7 @@ int cmd_enable_channels(int argc, const char **argv) } order = get_count_order_u64(chan_opts.attr.num_subbuf); - assert(order >= 0); + LTTNG_ASSERT(order >= 0); rounded_size = 1ULL << order; if (rounded_size < chan_opts.attr.num_subbuf) { ERR("The number of subbuffers (%" PRIu64 ") is rounded and overflows!", @@ -476,7 +478,7 @@ int cmd_enable_channels(int argc, const char **argv) } /* Should now be power of 2 */ - assert(!((chan_opts.attr.num_subbuf - 1) & chan_opts.attr.num_subbuf)); + LTTNG_ASSERT(!((chan_opts.attr.num_subbuf - 1) & chan_opts.attr.num_subbuf)); DBG("Channel subbuf num set to %" PRIu64, chan_opts.attr.num_subbuf); break; @@ -644,7 +646,8 @@ int cmd_enable_channels(int argc, const char **argv) } } - ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace); + ret = print_missing_or_multiple_domains( + opt_kernel + opt_userspace, false); if (ret) { ret = CMD_ERROR; goto end;