[PATCH 18/66] perf bench: Disentangle headers

From: Arnaldo Carvalho de Melo
Date: Tue Jul 12 2016 - 18:43:14 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

We should try avoiding that perf.h header, it includes way too much
stuff, making it difficult to use things like setting _GNU_SOURCE only
on a small set of headers.

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: Hitoshi Mitake <mitake@xxxxxxxxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-lb6eg9w1kzrwhv0gm3ho0h54@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/bench/futex-hash.c | 8 ++++++--
tools/perf/bench/futex-lock-pi.c | 6 +++---
tools/perf/bench/futex-requeue.c | 6 +++---
tools/perf/bench/futex-wake-parallel.c | 6 +++---
tools/perf/bench/futex-wake.c | 6 +++---
5 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
index 8fc1782f90f5..caa9726ec9bd 100644
--- a/tools/perf/bench/futex-hash.c
+++ b/tools/perf/bench/futex-hash.c
@@ -11,10 +11,14 @@
/* For the CLR_() macros */
#include <pthread.h>

-#include "../perf.h"
+#include <errno.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <linux/kernel.h>
+#include <sys/time.h>
+
#include "../util/stat.h"
#include <subcmd/parse-options.h>
-#include "../util/header.h"
#include "bench.h"
#include "futex.h"

diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index be95506cc0d1..e2ba0d6f64fe 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -5,11 +5,11 @@
/* For the CLR_() macros */
#include <pthread.h>

-#include "../perf.h"
-#include "../util/util.h"
+#include <signal.h>
#include "../util/stat.h"
#include <subcmd/parse-options.h>
-#include "../util/header.h"
+#include <linux/kernel.h>
+#include <errno.h>
#include "bench.h"
#include "futex.h"

diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
index 7d9712c8ff01..7eceb0500900 100644
--- a/tools/perf/bench/futex-requeue.c
+++ b/tools/perf/bench/futex-requeue.c
@@ -11,11 +11,11 @@
/* For the CLR_() macros */
#include <pthread.h>

-#include "../perf.h"
-#include "../util/util.h"
+#include <signal.h>
#include "../util/stat.h"
#include <subcmd/parse-options.h>
-#include "../util/header.h"
+#include <linux/kernel.h>
+#include <errno.h>
#include "bench.h"
#include "futex.h"

diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c
index aca12284d8af..8143b54ff119 100644
--- a/tools/perf/bench/futex-wake-parallel.c
+++ b/tools/perf/bench/futex-wake-parallel.c
@@ -10,11 +10,11 @@
/* For the CLR_() macros */
#include <pthread.h>

-#include "../perf.h"
-#include "../util/util.h"
+#include <signal.h>
#include "../util/stat.h"
#include <subcmd/parse-options.h>
-#include "../util/header.h"
+#include <linux/kernel.h>
+#include <errno.h>
#include "bench.h"
#include "futex.h"

diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
index 877e680b28a8..e978d5610e5f 100644
--- a/tools/perf/bench/futex-wake.c
+++ b/tools/perf/bench/futex-wake.c
@@ -11,11 +11,11 @@
/* For the CLR_() macros */
#include <pthread.h>

-#include "../perf.h"
-#include "../util/util.h"
+#include <signal.h>
#include "../util/stat.h"
#include <subcmd/parse-options.h>
-#include "../util/header.h"
+#include <linux/kernel.h>
+#include <errno.h>
#include "bench.h"
#include "futex.h"

--
2.7.4