Print the generated trigger name when `add-trigger` succeeds. Also,
no message is emited when a trigger is successfully registered as
the command will print an error message if any error occurs.
There is also no need to parrot the trigger's name if it was specified
by the user.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9607fbd358298b036bd533834143eb5e9d185cd0
if (ret_code != LTTNG_OK) {
goto error;
}
+ } else {
+ if (!name) {
+ const char *returned_trigger_name;
+ const enum lttng_trigger_status trigger_status =
+ lttng_trigger_get_name(trigger,
+ &returned_trigger_name);
+
+ if (trigger_status != LTTNG_TRIGGER_STATUS_OK) {
+ WARN("Failed to retrieve the name generated for the added trigger.");
+ } else {
+ MSG("Added trigger '%s'.",
+ returned_trigger_name);
+ }
+ }
}
- MSG("Trigger registered successfully.");
ret = 0;
goto end;