}
/* Caller must free() *cmdline */
- cmdline = malloc(PATH_MAX);
+ cmdline = zmalloc(PATH_MAX);
if (!cmdline) {
- perror("malloc cmdline");
+ PERROR("malloc cmdline");
goto end;
}
ret = fread(cmdline, 1, PATH_MAX, fp);
if (ret < 0) {
- perror("fread proc list");
+ PERROR("fread proc list");
}
end:
return ret;
}
+/*
+ * List tracker PID(s) of session and domain.
+ */
+static int list_tracker_pids(void)
+{
+ int enabled, ret;
+ int *pids = NULL;
+ size_t nr_pids;
+
+ ret = lttng_list_tracker_pids(handle,
+ &enabled, &pids, &nr_pids);
+ if (ret) {
+ return ret;
+ }
+ if (enabled) {
+ int i;
+ _MSG("PID tracker: [");
+
+ for (i = 0; i < nr_pids; i++) {
+ if (i) {
+ _MSG(",");
+ }
+ _MSG(" %d", pids[i]);
+ }
+ _MSG(" ]\n\n");
+ }
+ free(pids);
+ return 0;
+}
+
/*
* Machine interface
* Find the session with session_name as name
active_string(sessions[i].enabled),
snapshot_string(sessions[i].snapshot_mode));
MSG("%sTrace path: %s", indent4, sessions[i].path);
- MSG("%sLive timer interval (usec): %u\n", indent4,
- sessions[i].live_timer_interval);
+ if (sessions[i].live_timer_interval != 0) {
+ MSG("%sLive timer interval (usec): %u", indent4,
+ sessions[i].live_timer_interval);
+ }
+ MSG("");
}
}
}
+ ret = list_tracker_pids();
+ if (ret) {
+ goto end;
+ }
+
ret = list_channels(opt_channel);
if (ret) {
goto end;
continue;
}
+ switch (domains[i].type) {
+ case LTTNG_DOMAIN_KERNEL:
+ case LTTNG_DOMAIN_UST:
+ ret = list_tracker_pids();
+ if (ret) {
+ goto end;
+ }
+ break;
+ default:
+ break;
+ }
+
ret = list_channels(opt_channel);
if (ret) {
goto end;