#include "../command.h"
#include <src/common/sessiond-comm/sessiond-comm.h>
+#if (LTTNG_SYMBOL_NAME_LEN == 256)
+#define LTTNG_SYMBOL_NAME_LEN_SCANF_IS_A_BROKEN_API "255"
+#endif
+
static char *opt_event_list;
static int opt_event_type;
static const char *opt_loglevel;
{
int ret;
char s_hex[19];
+#define S_HEX_LEN_SCANF_IS_A_BROKEN_API "18" /* 18 is (19 - 1) (\0 is extra) */
char name[LTTNG_SYMBOL_NAME_LEN];
if (opt == NULL) {
}
/* Check for symbol+offset */
- ret = sscanf(opt, "%[^'+']+%s", name, s_hex);
+ ret = sscanf(opt, "%" LTTNG_SYMBOL_NAME_LEN_SCANF_IS_A_BROKEN_API
+ "[^'+']+%" S_HEX_LEN_SCANF_IS_A_BROKEN_API "s", name, s_hex);
if (ret == 2) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
ev->attr.probe.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
/* Check for symbol */
if (isalpha(name[0])) {
- ret = sscanf(opt, "%s", name);
+ ret = sscanf(opt, "%" LTTNG_SYMBOL_NAME_LEN_SCANF_IS_A_BROKEN_API "s",
+ name);
if (ret == 1) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
ev->attr.probe.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
}
/* Check for address */
- ret = sscanf(opt, "%s", s_hex);
+ ret = sscanf(opt, "%" S_HEX_LEN_SCANF_IS_A_BROKEN_API "s", s_hex);
if (ret > 0) {
if (*s_hex == '\0') {
ERR("Invalid probe address %s", s_hex);
}
warn = 1;
} else {
- MSG("%s event %s%s created in channel %s",
- get_domain_str(dom.type), event_name,
- exclusion_string,
- print_channel_name(channel_name));
+ /* So we don't print the default channel name for JUL. */
+ if (dom.type == LTTNG_DOMAIN_JUL) {
+ MSG("%s event %s%s enabled.",
+ get_domain_str(dom.type), event_name,
+ exclusion_string);
+ } else {
+ MSG("%s event %s%s created in channel %s",
+ get_domain_str(dom.type), event_name,
+ exclusion_string,
+ print_channel_name(channel_name));
+ }
}
free(exclusion_string);
}
pc = poptGetContext(NULL, argc, argv, long_options, 0);
poptReadDefaultConfig(pc, 0);
+ /* TODO: mi support */
+ if (lttng_opt_mi) {
+ ret = -LTTNG_ERR_MI_NOT_IMPLEMENTED;
+ ERR("mi option not supported");
+ goto end;
+ }
+
/* Default event type */
opt_event_type = LTTNG_EVENT_ALL;