Implement PID tracker content listing
[lttng-tools.git] / src / bin / lttng / commands / list.c
index aaa8f47a9ec4b157e44ca68fe9b4e0a9d712f161..b8d0046aa50e4491d82fd92c89c5a3a702b516b6 100644 (file)
@@ -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;
This page took 0.023075 seconds and 4 git commands to generate.