projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: disable clang-format to work around unstable output
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
destroy.cpp
diff --git
a/src/bin/lttng/commands/destroy.cpp
b/src/bin/lttng/commands/destroy.cpp
index b9fd53bbf620bbd7be275c5a0aabf6c24e3387f2..0258e31e858ced1d61dfb76a85d916f6932d203c 100644
(file)
--- a/
src/bin/lttng/commands/destroy.cpp
+++ b/
src/bin/lttng/commands/destroy.cpp
@@
-74,7
+74,7
@@
cmd_error_code destroy_session(const lttng_session& session)
ret = lttng_stop_tracing_no_wait(session.name);
if (ret < 0 && ret != -LTTNG_ERR_TRACE_ALREADY_STOPPED) {
ret = lttng_stop_tracing_no_wait(session.name);
if (ret < 0 && ret != -LTTNG_ERR_TRACE_ALREADY_STOPPED) {
- LTTNG_THROW_CTL(
fmt
::format("Failed to stop session `{}`", session.name),
+ LTTNG_THROW_CTL(
lttng
::format("Failed to stop session `{}`", session.name),
static_cast<lttng_error_code>(-ret));
}
static_cast<lttng_error_code>(-ret));
}
@@
-134,7
+134,8
@@
cmd_error_code destroy_session(const lttng_session& session)
auto ctl_ret_code =
lttng_destroy_session_ext(session.name, &raw_destruction_handle);
if (ctl_ret_code != LTTNG_OK) {
auto ctl_ret_code =
lttng_destroy_session_ext(session.name, &raw_destruction_handle);
if (ctl_ret_code != LTTNG_OK) {
- LTTNG_THROW_CTL(fmt::format("Failed to destroy session `{}`", session.name),
+ LTTNG_THROW_CTL(lttng::format("Failed to destroy session `{}`",
+ session.name),
ctl_ret_code);
}
ctl_ret_code);
}
@@
-184,7
+185,8
@@
cmd_error_code destroy_session(const lttng_session& session)
}
if (ctl_ret_code != LTTNG_OK) {
}
if (ctl_ret_code != LTTNG_OK) {
- LTTNG_THROW_CTL(fmt::format("Failed to destroy session `{}`", session.name),
+ LTTNG_THROW_CTL(lttng::format("Failed to destroy session `{}`",
+ session.name),
ctl_ret_code);
}
ctl_ret_code);
}
@@
-255,13
+257,13
@@
cmd_error_code destroy_session(const lttng_session& session)
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
-cmd_error_code destroy_sessions(const session_spec& spec)
+cmd_error_code destroy_sessions(const
lttng::cli::
session_spec& spec)
{
bool had_warning = false;
bool had_error = false;
bool listing_failed = false;
{
bool had_warning = false;
bool had_error = false;
bool listing_failed = false;
- const auto sessions = [&listing_failed, &spec]() -> session_list {
+ const auto sessions = [&listing_failed, &spec]() ->
lttng::cli::
session_list {
try {
return list_sessions(spec);
} catch (const lttng::ctl::error& ctl_exception) {
try {
return list_sessions(spec);
} catch (const lttng::ctl::error& ctl_exception) {
@@
-272,7
+274,8
@@
cmd_error_code destroy_sessions(const session_spec& spec)
}
}();
}
}();
- if (!listing_failed && sessions.size() == 0 && spec.type == session_spec::type::NAME) {
+ if (!listing_failed && sessions.size() == 0 &&
+ spec.type_ == lttng::cli::session_spec::type::NAME) {
ERR_FMT("Session `{}` not found", spec.value);
return CMD_ERROR;
}
ERR_FMT("Session `{}` not found", spec.value);
return CMD_ERROR;
}
@@
-289,7
+292,7
@@
cmd_error_code destroy_sessions(const session_spec& spec)
} catch (const lttng::ctl::error& ctl_exception) {
switch (ctl_exception.code()) {
case LTTNG_ERR_NO_SESSION:
} catch (const lttng::ctl::error& ctl_exception) {
switch (ctl_exception.code()) {
case LTTNG_ERR_NO_SESSION:
- if (spec.type
!=
session_spec::type::NAME) {
+ if (spec.type
_ != lttng::cli::
session_spec::type::NAME) {
/* Session destroyed during command, ignore and carry-on. */
sub_ret = CMD_SUCCESS;
break;
/* Session destroyed during command, ignore and carry-on. */
sub_ret = CMD_SUCCESS;
break;
@@
-335,11
+338,8
@@
int cmd_destroy(int argc, const char **argv)
bool success;
static poptContext pc;
const char *leftover = nullptr;
bool success;
static poptContext pc;
const char *leftover = nullptr;
- struct session_spec spec = {
- .type = session_spec::NAME,
- .value = nullptr,
- };
- session_list const sessions;
+ lttng::cli::session_spec spec(lttng::cli::session_spec::type::NAME);
+ lttng::cli::session_list const sessions;
pc = poptGetContext(nullptr, argc, argv, long_options, 0);
poptReadDefaultConfig(pc, 0);
pc = poptGetContext(nullptr, argc, argv, long_options, 0);
poptReadDefaultConfig(pc, 0);
@@
-358,10
+358,10
@@
int cmd_destroy(int argc, const char **argv)
list_cmd_options(stdout, long_options);
goto end;
case OPT_ALL:
list_cmd_options(stdout, long_options);
goto end;
case OPT_ALL:
- spec.type
= session_spec
::ALL;
+ spec.type
_ = lttng::cli::session_spec::type
::ALL;
break;
case OPT_ENABLE_GLOB:
break;
case OPT_ENABLE_GLOB:
- spec.type
= session_spec
::GLOB_PATTERN;
+ spec.type
_ = lttng::cli::session_spec::type
::GLOB_PATTERN;
break;
default:
command_ret = CMD_UNDEFINED;
break;
default:
command_ret = CMD_UNDEFINED;
This page took
0.024881 seconds
and
4
git commands to generate.