X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=b8d0046aa50e4491d82fd92c89c5a3a702b516b6;hp=aaa8f47a9ec4b157e44ca68fe9b4e0a9d712f161;hb=a5dfbb9db7ba31913657ed921006b13977b7b426;hpb=a9ad0c8fb50ac8cf9e9812dd9c9b4f949bac19a8 diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index aaa8f47a9..b8d0046aa 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -1246,6 +1246,37 @@ error_channels: 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, i; + + ret = lttng_list_tracker_pids(handle, + &enabled, &pids, &nr_pids); + if (ret) { + return ret; + } + _MSG("PID tracker: [%s]", enabled ? "enabled" : "disabled"); + if (enabled) { + _MSG(", pids: ["); + + for (i = 0; i < nr_pids; i++) { + if (i) { + _MSG(","); + } + _MSG(" %d", pids[i]); + } + _MSG(" ]"); + } + _MSG("\n\n"); + free(pids); + return 0; +} + /* * Machine interface * Find the session with session_name as name @@ -1667,6 +1698,11 @@ int cmd_list(int argc, const char **argv) } + ret = list_tracker_pids(); + if (ret) { + goto end; + } + ret = list_channels(opt_channel); if (ret) { goto end; @@ -1754,6 +1790,18 @@ int cmd_list(int argc, const char **argv) 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;