File libperf-add-libperf-to-the-python-so-build.patch of Package perf
68
1
From: Jiri Olsa <jolsa@kernel.org>
2
Date: Sun, 21 Jul 2019 13:24:12 +0200
3
Subject: libperf: Add libperf to the python.so build
4
Git-commit: a429dcb8feb60b8500fed81e2275c1944e3091fc
5
Patch-mainline: v5.4-rc1
6
References: jsc#SLE-13661
7
8
Link libperf.a with python.so.
9
10
Committer testing:
11
12
Continues to work:
13
14
# perf test python
15
18: 'import perf' in python : Ok
16
#
17
18
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
19
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
20
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
21
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
22
Cc: Andi Kleen <ak@linux.intel.com>
23
Cc: Michael Petlan <mpetlan@redhat.com>
24
Cc: Namhyung Kim <namhyung@kernel.org>
25
Cc: Peter Zijlstra <peterz@infradead.org>
26
Link: http://lkml.kernel.org/r/20190721112506.12306-26-jolsa@kernel.org
27
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
28
Signed-off-by: Tony Jones <tonyj@suse.de>
29
---
30
tools/perf/Makefile.perf | 1 +
31
tools/perf/util/setup.py | 3 ++-
32
2 files changed, 3 insertions(+), 1 deletion(-)
33
34
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
35
index 6e7e7d44ffac..67512a12276b 100644
36
--- a/tools/perf/Makefile.perf
37
+++ b/tools/perf/Makefile.perf
38
39
LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
40
41
LIBPERF = $(LIBPERF_PATH)libperf.a
42
+export LIBPERF
43
44
# python extension build directories
45
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
46
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
47
index a1a68a2fa917..d48f9cd58964 100644
48
--- a/tools/perf/util/setup.py
49
+++ b/tools/perf/util/setup.py
50
51
build_tmp = getenv('PYTHON_EXTBUILD_TMP')
52
libtraceevent = getenv('LIBTRACEEVENT')
53
libapikfs = getenv('LIBAPI')
54
+libperf = getenv('LIBPERF')
55
56
ext_sources = [f.strip() for f in open('util/python-ext-sources')
57
if len(f.strip()) > 0 and f[0] != '#']
58
59
include_dirs = ['util/include'],
60
libraries = extra_libraries,
61
extra_compile_args = cflags,
62
- extra_objects = [libtraceevent, libapikfs],
63
+ extra_objects = [libtraceevent, libapikfs, libperf],
64
)
65
66
setup(name='perf',
67
68