Skip to contentSkip to conversation

perf bench: Add missing pthread.h include for CPU_*() macros

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  8a15858904c803450b6763d09f53d9a1dc7ab1c3
Gitweb:     http://git.kernel.org/tip/8a15858904c803450b6763d09f53d9a1dc7ab1c3
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 6 Jul 2016 12:14:56 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Jul 2016 15:19:52 -0300

perf bench: Add missing pthread.h include for CPU_*() macros

---
 tools/perf/bench/futex-hash.c          | 6 +++---
 tools/perf/bench/futex-lock-pi.c       | 4 +++-
 tools/perf/bench/futex-requeue.c       | 4 +++-
 tools/perf/bench/futex-wake-parallel.c | 4 +++-
 tools/perf/bench/futex-wake.c          | 4 +++-
 tools/perf/bench/numa.c                | 4 +++-
 6 files changed, 18 insertions(+), 8 deletions(-)
tools/perf/bench/futex-hash.c +3 -3
index 0999ac5..8fc1782 100644
@@ -8,8 +8,10 @@
  * many threads and futexes as possible.
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
-#include "../util/util.h"
 #include "../util/stat.h"
 #include <subcmd/parse-options.h>
 #include "../util/header.h"
@@ -17,9 +19,7 @@
 #include "futex.h"
 
 #include <err.h>
-#include <stdlib.h>
 #include <sys/time.h>
-#include <pthread.h>
 
 static unsigned int nthreads = 0;
 static unsigned int nsecs    = 10;
tools/perf/bench/futex-lock-pi.c +3 -1
index 6952db6..be95506 100644
@@ -2,6 +2,9 @@
  * Copyright (C) 2015 Davidlohr Bueso.
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
 #include "../util/util.h"
 #include "../util/stat.h"
@@ -13,7 +16,6 @@
 #include <err.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <pthread.h>
 
 struct worker {
 	int tid;
tools/perf/bench/futex-requeue.c +3 -1
index 7182386..7d9712c 100644
@@ -8,6 +8,9 @@
  * requeues without waking up any tasks -- thus mimicking a regular futex_wait.
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
 #include "../util/util.h"
 #include "../util/stat.h"
@@ -19,7 +22,6 @@
 #include <err.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <pthread.h>
 
 static u_int32_t futex1 = 0, futex2 = 0;
 
tools/perf/bench/futex-wake-parallel.c +3 -1
index 91aaf2a..aca1228 100644
@@ -7,6 +7,9 @@
  * it can be used to measure futex_wake() changes.
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
 #include "../util/util.h"
 #include "../util/stat.h"
@@ -18,7 +21,6 @@
 #include <err.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <pthread.h>
 
 struct thread_data {
 	pthread_t worker;
tools/perf/bench/futex-wake.c +3 -1
index f416bd7..877e680 100644
@@ -8,6 +8,9 @@
  * one or more tasks, and thus the waitqueue is never empty.
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
 #include "../util/util.h"
 #include "../util/stat.h"
@@ -19,7 +22,6 @@
 #include <err.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <pthread.h>
 
 /* all threads will block on the same futex */
 static u_int32_t futex1 = 0;
tools/perf/bench/numa.c +3 -1
index 7500d95..f7f5300 100644
@@ -4,6 +4,9 @@
  * numa: Simulate NUMA-sensitive workload and measure their NUMA performance
  */
 
+/* For the CLR_() macros */
+#include <pthread.h>
+
 #include "../perf.h"
 #include "../builtin.h"
 #include "../util/util.h"
@@ -21,7 +24,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <pthread.h>
 #include <sys/mman.h>
 #include <sys/time.h>
 #include <sys/resource.h>