struct lttng_event {
char name[LTTNG_SYMBOL_NAME_LEN];
char loglevel[LTTNG_SYMBOL_NAME_LEN];
+ int64_t loglevel_value;
enum lttng_event_type type;
uint32_t enabled;
pid_t pid;
tmp[i].type = LTTNG_EVENT_FUNCTION;
break;
case LTTNG_UST_TRACEPOINT_LOGLEVEL:
- /* TODO */
- ret = -LTTCOMM_NOT_IMPLEMENTED;
- goto error;
+ tmp[i].type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL;
break;
}
i++;
}
memcpy(tmp[count].name, iter.name, LTTNG_UST_SYM_NAME_LEN);
memcpy(tmp[count].loglevel, iter.loglevel, LTTNG_UST_SYM_NAME_LEN);
+ tmp[count].loglevel_value = iter.loglevel_value;
tmp[count].type = LTTNG_UST_TRACEPOINT;
tmp[count].pid = app->key.pid;
tmp[count].enabled = -1;
}
DBG("Enabling UST event %s for channel %s",
event_name, channel_name);
- /* Copy name and type of the event */
- strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
- ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
- ev.type = opt_event_type;
switch (opt_event_type) {
case LTTNG_EVENT_ALL: /* Default behavior is tracepoint */
- ev.type = LTTNG_EVENT_TRACEPOINT;
/* Fall-through */
case LTTNG_EVENT_TRACEPOINT:
+ /* Copy name and type of the event */
+ ev.type = LTTNG_EVENT_TRACEPOINT;
+ strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
+ ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
break;
case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
+ /* Copy name and type of the event */
ev.type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL;
+ strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
+ ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
break;
case LTTNG_EVENT_PROBE:
case LTTNG_EVENT_FUNCTION:
static
const char *loglevel_string_pre(const char *loglevel)
{
- if (loglevel[0] == '\0')
+ if (loglevel[0] == '\0') {
return "";
- else
+ } else {
return " (loglevel: ";
+ }
}
static
const char *loglevel_string_post(const char *loglevel)
{
- if (loglevel[0] == '\0')
+ if (loglevel[0] == '\0') {
return "";
- else
+ } else {
return ")";
+ }
}
/*
{
switch (event->type) {
case LTTNG_EVENT_TRACEPOINT:
- MSG("%s%s%s%s%s (type: tracepoint)%s", indent6,
+ {
+ char ll_value[LTTNG_SYMBOL_NAME_LEN] = "";
+
+ if (event->loglevel[0] != '\0') {
+ int ret;
+
+ ret = snprintf(ll_value, LTTNG_SYMBOL_NAME_LEN,
+ ", %lld", (long long) event->loglevel_value);
+ if (ret < 0)
+ ERR("snprintf error");
+ }
+ MSG("%s%s%s%s%s%s (type: tracepoint)%s", indent6,
event->name,
loglevel_string_pre(event->loglevel),
event->loglevel,
+ ll_value,
loglevel_string_post(event->loglevel),
enabled_string(event->enabled));
break;
+ }
case LTTNG_EVENT_PROBE:
MSG("%s%s (type: probe)%s", indent6,
event->name, enabled_string(event->enabled));
break;
case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
MSG("%s%s (type: tracepoint loglevel)%s", indent6,
- event->name, enabled_string(event->enabled));
+ event->name,
+ enabled_string(event->enabled));
break;
case LTTNG_EVENT_ALL:
/* We should never have "all" events in list. */