perf tools: Fix comm for processes with named threads
[firefly-linux-kernel-4.4.55.git] / tools / perf / util / trace-event-info.c
index d2655f08bcc033d757ba5740b2ed238984062f40..ac6830d8292b221f9676f5d3b15b0efdf9658642 100644 (file)
@@ -18,7 +18,8 @@
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
-#define _GNU_SOURCE
+#include <ctype.h>
+#include "util.h"
 #include <dirent.h>
 #include <mntent.h>
 #include <stdio.h>
@@ -31,7 +32,6 @@
 #include <pthread.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <ctype.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <linux/list.h>
 
 #define VERSION "0.5"
 
-#define _STR(x) #x
-#define STR(x) _STR(x)
-#define MAX_PATH 256
-
 #define TRACE_CTRL     "tracing_on"
 #define TRACE          "trace"
 #define AVAILABLE      "available_tracers"
@@ -73,26 +69,6 @@ struct events {
 };
 
 
-
-static void die(const char *fmt, ...)
-{
-       va_list ap;
-       int ret = errno;
-
-       if (errno)
-               perror("perf");
-       else
-               ret = -1;
-
-       va_start(ap, fmt);
-       fprintf(stderr, "  ");
-       vfprintf(stderr, fmt, ap);
-       va_end(ap);
-
-       fprintf(stderr, "\n");
-       exit(ret);
-}
-
 void *malloc_or_die(unsigned int size)
 {
        void *data;