int ret;
FILE *fp;
char *cmdline = NULL;
- char path[24]; /* Can't go bigger than /proc/65535/cmdline */
+ char path[20]; /* Can't go bigger than /proc/65535/cmdline */
snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
fp = fopen(path, "r");
}
}
+static const char *loglevel_jul_string(int value)
+{
+ switch (value) {
+ case -1:
+ return "";
+ case LTTNG_LOGLEVEL_JUL_OFF:
+ return "JUL_OFF";
+ case LTTNG_LOGLEVEL_JUL_SEVERE:
+ return "JUL_SEVERE";
+ case LTTNG_LOGLEVEL_JUL_WARNING:
+ return "JUL_WARNING";
+ case LTTNG_LOGLEVEL_JUL_INFO:
+ return "JUL_INFO";
+ case LTTNG_LOGLEVEL_JUL_CONFIG:
+ return "JUL_CONFIG";
+ case LTTNG_LOGLEVEL_JUL_FINE:
+ return "JUL_FINE";
+ case LTTNG_LOGLEVEL_JUL_FINER:
+ return "JUL_FINER";
+ case LTTNG_LOGLEVEL_JUL_FINEST:
+ return "JUL_FINEST";
+ case LTTNG_LOGLEVEL_JUL_ALL:
+ return "JUL_ALL";
+ default:
+ return "<<UNKNOWN>>";
+ }
+}
+
static const char *loglevel_string(int value)
{
switch (value) {
}
}
+static const char *logleveltype_string(enum lttng_loglevel_type value)
+{
+ switch (value) {
+ case LTTNG_EVENT_LOGLEVEL_ALL:
+ return ":";
+ case LTTNG_EVENT_LOGLEVEL_RANGE:
+ return " <=";
+ case LTTNG_EVENT_LOGLEVEL_SINGLE:
+ return " ==";
+ default:
+ return " <<TYPE UNKN>>";
+ }
+}
+
/*
* Pretty print single event.
*/
case LTTNG_EVENT_TRACEPOINT:
{
if (event->loglevel != -1) {
- MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s%s",
+ MSG("%s%s (loglevel%s %s (%d)) (type: tracepoint)%s%s%s",
indent6,
event->name,
+ logleveltype_string(event->loglevel_type),
loglevel_string(event->loglevel),
event->loglevel,
enabled_string(event->enabled),
cmdline = get_cmdline_by_pid(cur_pid);
MSG("\nPID: %d - Name: %s", cur_pid, cmdline);
free(cmdline);
+ /* Wipe current event since we are about to print a new PID. */
+ memset(&cur_event, 0, sizeof(cur_event));
}
if (strcmp(cur_event.name, event_field_list[i].event.name) != 0) {
print_events(&event_field_list[i].event);
}
for (i = 0; i < count; i++) {
- MSG("%s- %s%s", indent4, events[i].name,
- enabled_string(events[i].enabled));
+ MSG("%s- %s%s (loglevel%s %s)", indent4, events[i].name,
+ enabled_string(events[i].enabled),
+ logleveltype_string(events[i].loglevel_type),
+ loglevel_jul_string(events[i].loglevel));
}
MSG("");
MSG("%snumber of subbufers: %" PRIu64, indent6, channel->attr.num_subbuf);
MSG("%sswitch timer interval: %u", indent6, channel->attr.switch_timer_interval);
MSG("%sread timer interval: %u", indent6, channel->attr.read_timer_interval);
+ MSG("%strace file count: %" PRIu64, indent6, channel->attr.tracefile_count);
+ MSG("%strace file size (bytes): %" PRIu64, indent6, channel->attr.tracefile_size);
switch (channel->attr.output) {
case LTTNG_EVENT_SPLICE:
MSG("%soutput: splice()", indent6);
MSG("Tracing session %s: [%s%s]", session_name,
active_string(sessions[i].enabled),
snapshot_string(sessions[i].snapshot_mode));
- MSG("%sTrace path: %s\n", indent4, sessions[i].path);
+ MSG("%sTrace path: %s", indent4, sessions[i].path);
+ MSG("%sLive timer interval (usec): %u\n", indent4,
+ sessions[i].live_timer_interval);
break;
}
} else {
goto end;
}
- if (opt_kernel) {
+ if (opt_kernel || opt_userspace) {
/* Channel listing */
ret = list_channels(opt_channel);
if (ret < 0) {