linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: fix undefined symbols in python binding
@ 2013-02-04  0:27 Ben Noordhuis
  0 siblings, 0 replies; only message in thread
From: Ben Noordhuis @ 2013-02-04  0:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Ben Noordhuis

Add dummy test_attr__enabled and test_attr__open symbols to
util/python.c to fix the following dynamic linker error:

  $ python python/twatch.py
  Traceback (most recent call last):
    File "python/twatch.py", line 16, in <module>
      import perf
  ImportError: /path/to/perf.so: undefined symbol: test_attr__enabled

Signed-off-by: Ben Noordhuis <info@bnoordhuis.nl>
---
 tools/perf/util/python.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index a2657fd..163abbb 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -8,6 +8,15 @@
 #include "cpumap.h"
 #include "thread_map.h"
 
+/* Dummy to satisfy linker. */
+bool test_attr__enabled;
+
+/* Dummy to satisfy linker. */
+void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
+	int fd, int group_fd, unsigned long flags)
+{
+}
+
 /* Define PyVarObject_HEAD_INIT for python 2.5 */
 #ifndef PyVarObject_HEAD_INIT
 # define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
-- 
1.7.9.5


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

only message in thread, other threads:[~2013-02-04  0:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-04  0:27 [PATCH] perf: fix undefined symbols in python binding Ben Noordhuis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).