char name[LTTNG_SYMBOL_NAME_LEN];
enum lttng_loglevel_type loglevel_type;
- char loglevel[LTTNG_SYMBOL_NAME_LEN];
- int64_t loglevel_value; /* for printing */
+ char loglevel[LTTNG_SYMBOL_NAME_LEN]; /* '\0' for all loglevels */
+ int64_t loglevel_value; /* for printing */
uint32_t enabled;
pid_t pid;
/* Per event type configuration */
/*
* Command LTTNG_ENABLE_EVENT processed by the client thread.
- *
- * TODO: currently, both events and loglevels are kept within the same
- * namespace for UST global registry/app registery, so if an event
- * happen to have the same name as the loglevel (very unlikely though),
- * and an attempt is made to enable/disable both in the same session,
- * the first to be created will be the only one allowed to exist.
*/
static int cmd_enable_event(struct ltt_session *session, int domain,
char *channel_name, struct lttng_event *event)
goto error;
}
- if (opt_loglevel[0] != '\0') {
+ if (opt_loglevel) {
MSG("Kernel loglevels are not supported.");
ret = CMD_UNDEFINED;
goto error;
}
ev.loglevel_type = opt_loglevel_type;
- strncpy(ev.loglevel, opt_loglevel, LTTNG_SYMBOL_NAME_LEN);
- ev.loglevel[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
+ if (opt_loglevel) {
+ strncpy(ev.loglevel, opt_loglevel, LTTNG_SYMBOL_NAME_LEN);
+ ev.loglevel[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
+ } else {
+ ev.loglevel[0] = '\0';
+ }
} else {
ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
goto error;
memset(&event, 0, sizeof(struct lttng_event));
event.type = LTTNG_EVENT_TRACEPOINT;
+ event.loglevel[0] = '\0';
+ event.loglevel_type = LTTNG_EVENT_LOGLEVEL;
printf("\nTesting tracing all UST events:\n");
printf("-----------\n");
strcpy(ev1.name, "tp1");
ev1.type = LTTNG_EVENT_TRACEPOINT;
+ ev1.loglevel[0] = '\0';
+ ev1.loglevel_type = LTTNG_EVENT_LOGLEVEL;
strcpy(ev2.name, "ev2");
ev2.type = LTTNG_EVENT_TRACEPOINT;
+ ev2.loglevel[0] = '\0';
+ ev2.loglevel_type = LTTNG_EVENT_LOGLEVEL;
strcpy(ev3.name, "ev3");
ev3.type = LTTNG_EVENT_TRACEPOINT;
+ ev3.loglevel[0] = '\0';
+ ev3.loglevel_type = LTTNG_EVENT_LOGLEVEL;
printf("\nTesting tracing UST events:\n");
printf("-----------\n");