+static
+char *live_path(char *name)
+{
+ FILE *fp;
+ int ret;
+ char path[1035];
+ char cmd[1024];
+ char *out = NULL;
+
+ ret = sprintf(cmd, "lttngtop -r net://localhost|grep %s|cut -d' ' -f1",
+ name);
+ if (ret < 0) {
+ fprintf(stderr, "allocating cmd\n");
+ goto end;
+ }
+
+ fp = popen(cmd, "r");
+ if (fp == NULL) {
+ printf("Failed to run command\n" );
+ goto end;
+ }
+
+ /* Read the output a line at a time - output it. */
+ out = fgets(path, sizeof(path)-1, fp);
+ if (out)
+ out = strdup(path);
+
+ /* close */
+ pclose(fp);
+
+end:
+ return out;
+}
+