Improve add-context command
[lttng-tools.git] / lttng / commands / list.c
index 191d2e7a2414d4cbf5b83496d0d53e825fc3f9f7..0b4afa308047b3ce951b27c2519494b61f1bf269 100644 (file)
@@ -3,8 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation; only version 2
+ * of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,7 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "cmd.h"
+#include "../cmd.h"
 
 static int opt_pid;
 static int opt_channels;
@@ -89,6 +89,9 @@ static char *get_cmdline_by_pid(pid_t pid)
        /* Caller must free() *cmdline */
        cmdline = malloc(PATH_MAX);
        ret = fread(cmdline, 1, PATH_MAX, fp);
+       if (ret < 0) {
+               perror("fread proc list");
+       }
        fclose(fp);
 
 end:
@@ -104,10 +107,13 @@ static int list_kernel(void)
 {
        int ret, pos, size;
        char *event_list, *event, *ptr;
+       struct lttng_domain dom;
 
        DBG("Getting all tracing events");
 
-       ret = lttng_kernel_list_events(&event_list);
+       dom.type = LTTNG_DOMAIN_KERNEL;
+
+       ret = lttng_list_events(&dom, &event_list);
        if (ret < 0) {
                ERR("Unable to list kernel instrumentation");
                return ret;
@@ -170,7 +176,7 @@ static int list_apps(void)
        pid_t *pids;
        char *cmdline;
 
-       count = 0;
+       count = -1;
        //count = lttng_ust_list_traceable_apps(&pids);
        if (count < 0) {
                ret = count;
This page took 0.023505 seconds and 4 git commands to generate.