* is in hexadecimal and can be 1 to 9 if it's in decimal.
*/
if (*s_hex == '\0' || !isdigit(*s_hex)) {
- ERR("Invalid probe description %s", s_hex);
+ ERR("Invalid probe description `%s`", s_hex);
ret = CMD_ERROR;
goto end;
}
const char *exclusion =
(const char *) lttng_dynamic_pointer_array_get_pointer(exclusions, i);
- strcat(ret, "\"");
+ strcat(ret, "`");
strcat(ret, exclusion);
- strcat(ret, "\"");
+ strcat(ret, "`");
if (i != count - 1) {
strcat(ret, ", ");
}
if (*x == '*') {
/* Event is a subset of the excluder */
- ERR("Event %s: %s excludes all events from %s", pattern, exclusion, pattern);
+ ERR("Exclusion pattern `%s` excludes all events from `%s`",
+ exclusion,
+ pattern);
goto error;
}
end:
if (warn) {
- WARN("Event %s: %s does not exclude any events from %s",
- pattern,
+ WARN("Exclusion pattern `%s` does not exclude any event from `%s`",
exclusion,
pattern);
}
if (opt_kernel) {
if (opt_loglevel) {
- WARN("Kernel loglevels are not supported.");
+ WARN("Kernel log levels are not supported");
}
}
case LTTNG_DOMAIN_JUL:
case LTTNG_DOMAIN_LOG4J:
case LTTNG_DOMAIN_PYTHON:
- ERR("Event name exclusions are not yet implemented for %s events",
+ ERR("Event name exclusions are not supported for %s event rules",
lttng_domain_type_str(dom.type));
ret = CMD_ERROR;
goto error;
case LTTNG_EVENT_PROBE:
case LTTNG_EVENT_USERSPACE_PROBE:
case LTTNG_EVENT_FUNCTION:
- ERR("Filter expressions are not supported for %s events",
+ ERR("Filter expressions are not supported for %s event rules",
get_event_type_str((lttng_event_type) opt_event_type));
ret = CMD_ERROR;
goto error;
/* Kernel tracer action */
if (opt_kernel) {
- DBG_FMT("Enabling kernel event: pattern=`{}`, channel_name=`{}`",
+ DBG_FMT("Enabling kernel event rule: pattern=`{}`, channel_name=`{}`",
pattern,
print_channel_name(channel_name));
break;
case CMD_ERROR:
default:
- ERR("Unable to parse userspace probe options");
+ ERR("Unable to parse user space probe options");
break;
}
goto error;
/* kernel loglevels not implemented */
ev->loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
} else if (opt_userspace) { /* User-space tracer action */
- DBG("Enabling UST event %s for channel %s, loglevel %s",
- pattern.c_str(),
- print_channel_name(channel_name),
- opt_loglevel ?: "<all>");
+ DBG_FMT("Enabling user space event rule: pattern=`{}`, channel_name=`{}`, log_level=`{}`",
+ pattern.c_str(),
+ print_channel_name(channel_name),
+ opt_loglevel ?: "all");
switch (opt_event_type) {
case LTTNG_EVENT_ALL: /* Default behavior is tracepoint */
case LTTNG_EVENT_SYSCALL:
case LTTNG_EVENT_USERSPACE_PROBE:
default:
- ERR("Event type not available for user-space tracing");
+ ERR("Instrumentation point type not supported for the %s domain",
+ lttng_domain_type_str(dom.type));
ret = CMD_UNSUPPORTED;
goto error;
}
loglevel_name_to_value(opt_loglevel, &loglevel);
if (name_search_ret == -1) {
- ERR("Unknown loglevel %s", opt_loglevel);
+ ERR("Unknown log level `%s`", opt_loglevel);
ret = -LTTNG_ERR_INVALID;
goto error;
}
} else if (opt_jul || opt_log4j || opt_python) {
if (opt_event_type != LTTNG_EVENT_ALL &&
opt_event_type != LTTNG_EVENT_TRACEPOINT) {
- ERR("Event type not supported for domain.");
+ ERR("Instrumentation point type not supported for the %s domain",
+ lttng_domain_type_str(dom.type));
ret = CMD_UNSUPPORTED;
goto error;
}
}
if (name_search_ret) {
- ERR("Unknown loglevel %s", opt_loglevel);
+ ERR("Unknown log level `%s`", opt_loglevel);
ret = -LTTNG_ERR_INVALID;
goto error;
}
error = 1;
goto end;
}
+
if (command_ret < 0) {
/* Turn ret to positive value to handle the positive error code */
switch (-command_ret) {
case LTTNG_ERR_KERN_EVENT_EXIST:
- WARN("Kernel event %s%s already enabled (channel %s, session %s)",
- pattern.c_str(),
+ WARN("Kernel event rule %s%s and attached to channel `%s` is already enabled (session `%s`)",
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string,
print_channel_name(channel_name),
session_name.c_str());
break;
case LTTNG_ERR_TRACE_ALREADY_STARTED:
{
- const char *msg =
- "The command tried to enable an event in a new domain for a session that has already been started once.";
- ERR("Event %s%s: %s (channel %s, session %s)",
- pattern.c_str(),
- exclusion_string,
- msg,
- print_channel_name(channel_name),
+ ERR("Can't enable an event in a new domain for a session that has already been started once (session `%s`)",
session_name.c_str());
error = 1;
break;
}
case LTTNG_ERR_SDT_PROBE_SEMAPHORE:
- ERR("SDT probes %s guarded by semaphores are not supported (channel %s, session %s)",
+ ERR("Failed to enable event rule with pattern `%s` and attached to channel `%s` as SDT probes guarded by semaphores are not supported (session `%s`)",
pattern.c_str(),
print_channel_name(channel_name),
session_name.c_str());
error = 1;
break;
default:
- ERR("Event %s%s: %s (channel %s, session %s)",
- pattern.c_str(),
+ ERR("Failed to enable event rule %s%s and attached to channel `%s`: %s (session `%s`)",
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string,
- lttng_strerror(command_ret),
command_ret == -LTTNG_ERR_NEED_CHANNEL_NAME ?
print_raw_channel_name(channel_name) :
print_channel_name(channel_name),
+ lttng_strerror(command_ret),
session_name.c_str());
error = 1;
break;
switch (dom.type) {
case LTTNG_DOMAIN_KERNEL:
case LTTNG_DOMAIN_UST:
- MSG("%s event %s%s created in channel %s",
+ {
+ MSG("Enabled %s event rule %s%s and attached to channel `%s`",
lttng_domain_type_str(dom.type),
- pattern.c_str(),
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string,
print_channel_name(channel_name));
break;
+ }
case LTTNG_DOMAIN_JUL:
case LTTNG_DOMAIN_LOG4J:
case LTTNG_DOMAIN_PYTHON:
* Don't print the default channel
* name for agent domains.
*/
- MSG("%s event %s%s enabled",
+ MSG("Enabled %s event rule %s%s",
lttng_domain_type_str(dom.type),
- pattern.c_str(),
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string);
break;
default:
abort();
}
}
- free(exclusion_string);
- }
- if (opt_filter) {
+ free(exclusion_string);
+ } else {
char *exclusion_string;
/* Filter present */
(char **) exclusions.array.buffer.data);
exclusion_string = print_exclusions(&exclusions);
if (!exclusion_string) {
- PERROR("Cannot allocate exclusion_string");
+ PERROR("Failed allocate exclusion string");
error = 1;
goto end;
}
if (command_ret < 0) {
switch (-command_ret) {
case LTTNG_ERR_FILTER_EXIST:
- WARN("Filter on event %s%s is already enabled"
- " (channel %s, session %s)",
- pattern.c_str(),
+ WARN("An event rule %s%s and filter expression `%s` is already attached to channel `%s`",
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string,
- print_channel_name(channel_name),
- session_name.c_str());
+ opt_filter,
+ print_channel_name(channel_name));
warn = 1;
break;
case LTTNG_ERR_TRACE_ALREADY_STARTED:
{
- const char *msg =
- "The command tried to enable an event in a new domain for a session that has already been started once.";
- ERR("Event %s%s: %s (channel %s, session %s, filter \'%s\')",
- ev->name,
- exclusion_string,
- msg,
- print_channel_name(channel_name),
- session_name.c_str(),
- opt_filter);
+ ERR("Can't enable an event in a new domain for a session that has already been started once (session `%s`)",
+ session_name.c_str());
error = 1;
break;
}
default:
- ERR("Event %s%s: %s (channel %s, session %s, filter \'%s\')",
- ev->name,
+ ERR("Failed to enable event rule %s%s, with filter expression `%s`, and attached to channel `%s`: %s (session `%s`)",
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") +
+ pattern + std::string("`"))
+ .c_str(),
exclusion_string,
- lttng_strerror(command_ret),
+ opt_filter,
command_ret == -LTTNG_ERR_NEED_CHANNEL_NAME ?
print_raw_channel_name(channel_name) :
print_channel_name(channel_name),
- session_name.c_str(),
- opt_filter);
+ lttng_strerror(command_ret),
+ session_name.c_str());
error = 1;
break;
}
- error_holder = command_ret;
+ error_holder = command_ret;
} else {
- MSG("Event %s%s: Filter '%s' successfully set",
- pattern.c_str(),
+ MSG("Enabled %s event rule %s%s and filter expression `%s`",
+ lttng_domain_type_str(dom.type),
+ opt_enable_all ? "matching all events" :
+ (std::string("with pattern `") + pattern +
+ std::string("`"))
+ .c_str(),
+
exclusion_string,
opt_filter);
}
+
free(exclusion_string);
}
{
int ret;
- /* Event name must be a valid globbing pattern to allow exclusions. */
+ /* Event name pattern must be a valid globbing pattern to allow exclusions. */
if (!strutils_is_star_glob_pattern(pattern)) {
- ERR("Event %s: Exclusions can only be used with a globbing pattern", pattern);
+ ERR("Event name pattern must contain wildcard characters to use exclusions");
goto error;
}
event_type = opt_event_type;
} else {
if (event_type != opt_event_type) {
- ERR("Multiple event type not supported.");
+ ERR("Only one event type may be enabled at once");
return CMD_ERROR;
}
}
arg_event_list = poptGetArg(pc.get());
if (arg_event_list == nullptr && opt_enable_all == 0) {
- ERR("Missing event name(s).");
+ ERR("Missing event name pattern(s)");
return CMD_ERROR;
}
case LTTNG_ERR_FATAL:
return "Fatal error of the session daemon";
case LTTNG_ERR_SELECT_SESS:
- return "A session MUST be selected";
+ return "A session must be selected";
case LTTNG_ERR_EXIST_SESS:
return "Session name already exists";
case LTTNG_ERR_NO_EVENT:
case LTTNG_ERR_KERN_LIST_FAIL:
return "Listing kernel events failed";
case LTTNG_ERR_UST_CALIBRATE_FAIL:
- return "UST calibration failed";
+ return "User space tracer calibration failed";
case LTTNG_ERR_UST_SESS_FAIL:
- return "UST create session failed";
+ return "User space tracer session creation failed";
case LTTNG_ERR_UST_CHAN_FAIL:
- return "UST create channel failed";
+ return "User space tracer channel creation failed";
case LTTNG_ERR_UST_CHAN_EXIST:
- return "UST channel already exist";
+ return "User space tracer channel already exist";
case LTTNG_ERR_UST_CHAN_NOT_FOUND:
- return "UST channel not found";
+ return "User space tracer channel not found";
case LTTNG_ERR_UST_CHAN_DISABLE_FAIL:
- return "Disable UST channel failed";
+ return "Disabling user space tracer channel failed";
case LTTNG_ERR_UST_CHAN_ENABLE_FAIL:
- return "Enable UST channel failed";
+ return "Enabling user space tracer channel failed";
case LTTNG_ERR_UST_ENABLE_FAIL:
- return "Enable UST event failed";
+ return "Enabling user space event failed";
case LTTNG_ERR_UST_DISABLE_FAIL:
- return "Disable UST event failed";
+ return "Disabling user space event failed";
case LTTNG_ERR_UST_META_FAIL:
return "Opening metadata failed";
case LTTNG_ERR_UST_START_FAIL:
- return "Starting UST trace failed";
+ return "Starting user space tracer session failed";
case LTTNG_ERR_UST_STOP_FAIL:
- return "Stopping UST trace failed";
+ return "Stopping user space tracer session trace failed";
case LTTNG_ERR_UST_CONSUMER64_FAIL:
- return "64-bit UST consumer start failed";
+ return "64-bit user space trace consumer start failed";
case LTTNG_ERR_UST_CONSUMER32_FAIL:
- return "32-bit UST consumer start failed";
+ return "32-bit user space trace consumer start failed";
case LTTNG_ERR_UST_STREAM_FAIL:
- return "UST create stream failed";
+ return "User space tracer stream creation failed";
case LTTNG_ERR_UST_LIST_FAIL:
- return "Listing UST events failed";
+ return "Listing of user space tracer events failed";
case LTTNG_ERR_UST_EVENT_EXIST:
- return "UST event already exist";
+ return "User space event already exist";
case LTTNG_ERR_UST_EVENT_NOT_FOUND:
- return "UST event not found";
+ return "User space event not found";
case LTTNG_ERR_UST_CONTEXT_EXIST:
- return "UST context already exist";
+ return "User space tracing context already exists";
case LTTNG_ERR_UST_CONTEXT_INVAL:
- return "UST invalid context";
+ return "Invalid user space tracing context";
case LTTNG_ERR_NEED_ROOT_SESSIOND:
return "Tracing the kernel requires a root lttng-sessiond daemon, as well as \"tracing\" group membership or root user ID for the lttng client";
case LTTNG_ERR_NO_UST:
case LTTNG_ERR_NOT_SUPPORTED:
return "Operation not supported";
case LTTNG_ERR_UST_EVENT_ENABLED:
- return "UST event already enabled";
+ return "User space event rule already enabled";
case LTTNG_ERR_SET_URL:
return "Error setting URL";
case LTTNG_ERR_URL_EXIST: