aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2012-02-12 05:45:24 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-02-13 15:01:25 -0500
commit6a5c13aff49ac9b3fea38d5f84b436718cb2780d (patch)
treee8b5a7ab074499663f66f09a5fcbff45be5a6c97
parentd3665498955779e56453501a16f4ad084f798802 (diff)
perf tools: Fix build dependency of perf python extension
The perf python extention (perf.so) file lacks its dependencies in the Makefile so that it cannot be refreshed if one of source files it depends is changed. Fix it by putting them in a separate file and processing it in both of Makefile and setup.py. Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1329043524-12470-1-git-send-email-namhyung@gmail.com Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Makefile5
-rw-r--r--tools/perf/util/python-ext-sources17
-rw-r--r--tools/perf/util/setup.py8
3 files changed, 25 insertions, 5 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 64df5de12ca8..8359fa140d2d 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -183,7 +183,10 @@ SCRIPT_SH += perf-archive.sh
183grep-libs = $(filter -l%,$(1)) 183grep-libs = $(filter -l%,$(1))
184strip-libs = $(filter-out -l%,$(1)) 184strip-libs = $(filter-out -l%,$(1))
185 185
186$(OUTPUT)python/perf.so: $(PYRF_OBJS) 186PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
187PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
188
189$(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
187 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ 190 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
188 --quiet build_ext; \ 191 --quiet build_ext; \
189 mkdir -p $(OUTPUT)python && \ 192 mkdir -p $(OUTPUT)python && \
diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources
new file mode 100644
index 000000000000..ff606f482a7c
--- /dev/null
+++ b/tools/perf/util/python-ext-sources
@@ -0,0 +1,17 @@
1#
2# List of files needed by perf python extention
3#
4# Each source file must be placed on its own line so that it can be
5# processed by Makefile and util/setup.py accordingly.
6#
7
8util/python.c
9util/ctype.c
10util/evlist.c
11util/evsel.c
12util/cpumap.c
13util/thread_map.c
14util/util.c
15util/xyarray.c
16util/cgroup.c
17util/debugfs.c
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 36d4c5619575..d0f9f29cf181 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -24,11 +24,11 @@ cflags += getenv('CFLAGS', '').split()
24build_lib = getenv('PYTHON_EXTBUILD_LIB') 24build_lib = getenv('PYTHON_EXTBUILD_LIB')
25build_tmp = getenv('PYTHON_EXTBUILD_TMP') 25build_tmp = getenv('PYTHON_EXTBUILD_TMP')
26 26
27ext_sources = [f.strip() for f in file('util/python-ext-sources')
28 if len(f.strip()) > 0 and f[0] != '#']
29
27perf = Extension('perf', 30perf = Extension('perf',
28 sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c', 31 sources = ext_sources,
29 'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
30 'util/util.c', 'util/xyarray.c', 'util/cgroup.c',
31 'util/debugfs.c'],
32 include_dirs = ['util/include'], 32 include_dirs = ['util/include'],
33 extra_compile_args = cflags, 33 extra_compile_args = cflags,
34 ) 34 )