Allow perf_examples/self_count.c to compile on architectures where user
level reads to the performance counters are either not implemented
yet, or is not possible on that architecture.  It appears that it
was intended that the code compile under these circumstances, but
the macro "barrier()" was not defined in these cases.

Signed-off-by: Corey Ashford <cjash...@linux.vnet.ibm.com>

---
 perf_examples/self_count.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/perf_examples/self_count.c b/perf_examples/self_count.c
index 8458bd8..306b372 100644
--- a/perf_examples/self_count.c
+++ b/perf_examples/self_count.c
@@ -80,6 +80,14 @@ static inline int rdpmc(struct perf_event_mmap_page *hdr, 
uint64_t *value)
 }
 #else
 /*
+ *  Default barrier macro.
+ *  Given this is architecture specific, it must be defined when
+ *  libpfm is ported to new architecture. The default macro below
+ *  simply does nothing.
+ */
+#define barrier() {}
+
+/*
  *  Default function to read counter directly from user level mode.
  *  Given this is architecture specific, it must be defined when
  *  libpfm is ported to new architecture. The default routine below
-- 
1.7.0.4



------------------------------------------------------------------------------
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to