mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:perf/core] perf tools: Move barrier() definition to tools/ include/linux/compiler.h
@ 2015-05-10  7:06 tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2015-05-10  7:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: eranian, dzickus, bp, acme, adrian.hunter, tglx, hpa, dsahern,
	linux-kernel, namhyung, fweisbec, mingo, jolsa

Commit-ID:  5ac69737dc5e25fb1c26d18059c8e17ce2671d5d
Gitweb:     http://git.kernel.org/tip/5ac69737dc5e25fb1c26d18059c8e17ce2671d5d
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Thu, 7 May 2015 13:38:16 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 May 2015 16:05:04 -0300

perf tools: Move barrier() definition to tools/include/linux/compiler.h

To make it generally accessible by other tools/ projects, also will be
used in the tools/arch/*/include/asm/barrier.h files that are being
introduced now.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-qnjdqwu3vcnt14vqmr6wu788@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/linux/compiler.h | 4 ++++
 tools/perf/perf-sys.h          | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 88461f0..f0e7267 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -1,6 +1,10 @@
 #ifndef _TOOLS_LINUX_COMPILER_H_
 #define _TOOLS_LINUX_COMPILER_H_
 
+/* Optimization barrier */
+/* The "volatile" is due to gcc bugs */
+#define barrier() __asm__ __volatile__("": : :"memory")
+
 #ifndef __always_inline
 # define __always_inline	inline __attribute__((always_inline))
 #endif
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index bf349ea..f44e53e 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -153,8 +153,6 @@
 #define CPUINFO_PROC    {"model name"}
 #endif
 
-#define barrier() asm volatile ("" ::: "memory")
-
 #ifndef cpu_relax
 #define cpu_relax() barrier()
 #endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-10  7:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-10  7:06 [tip:perf/core] perf tools: Move barrier() definition to tools/ include/linux/compiler.h tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome