summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util-cxx.h
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2016-11-26 07:03:37 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-12-05 15:51:44 -0300
commite67d52d411c3562263735479db2efd2ebd178db9 (patch)
treea88eae1461ecd9c0cfc84cb0f69faf9bbbfda859 /tools/perf/util/util-cxx.h
parenta9495fe9dc63bee1166772b6f10e199ef1747892 (diff)
downloadlinux-e67d52d411c3562263735479db2efd2ebd178db9.tar.gz
linux-e67d52d411c3562263735479db2efd2ebd178db9.tar.bz2
linux-e67d52d411c3562263735479db2efd2ebd178db9.zip
perf clang: Update test case to use real BPF script
Allow C++ code to use util.h and tests/llvm.h. Let 'perf test' compile a real BPF script. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-14-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util-cxx.h')
-rw-r--r--tools/perf/util/util-cxx.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/util-cxx.h b/tools/perf/util/util-cxx.h
new file mode 100644
index 000000000000..0e0e019c9f34
--- /dev/null
+++ b/tools/perf/util/util-cxx.h
@@ -0,0 +1,26 @@
+/*
+ * Support C++ source use utilities defined in util.h
+ */
+
+#ifndef PERF_UTIL_UTIL_CXX_H
+#define PERF_UTIL_UTIL_CXX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Now 'new' is the only C++ keyword found in util.h:
+ * in tools/include/linux/rbtree.h
+ *
+ * Other keywords, like class and delete, should be
+ * redefined if necessary.
+ */
+#define new _new
+#include "util.h"
+#undef new
+
+#ifdef __cplusplus
+}
+#endif
+#endif