From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@gmail.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/16] perf tools: Fix build dependency of perf python extension
Date: Mon, 13 Feb 2012 23:52:42 -0200 [thread overview]
Message-ID: <1329184375-27911-4-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1329184375-27911-1-git-send-email-acme@infradead.org>
From: Namhyung Kim <namhyung@gmail.com>
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>
---
tools/perf/Makefile | 5 ++++-
tools/perf/util/python-ext-sources | 17 +++++++++++++++++
tools/perf/util/setup.py | 8 ++++----
3 files changed, 25 insertions(+), 5 deletions(-)
create mode 100644 tools/perf/util/python-ext-sources
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 64df5de..8359fa1 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -183,7 +183,10 @@ SCRIPT_SH += perf-archive.sh
grep-libs = $(filter -l%,$(1))
strip-libs = $(filter-out -l%,$(1))
-$(OUTPUT)python/perf.so: $(PYRF_OBJS)
+PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
+PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
+
+$(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
--quiet build_ext; \
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 0000000..ff606f4
--- /dev/null
+++ b/tools/perf/util/python-ext-sources
@@ -0,0 +1,17 @@
+#
+# List of files needed by perf python extention
+#
+# Each source file must be placed on its own line so that it can be
+# processed by Makefile and util/setup.py accordingly.
+#
+
+util/python.c
+util/ctype.c
+util/evlist.c
+util/evsel.c
+util/cpumap.c
+util/thread_map.c
+util/util.c
+util/xyarray.c
+util/cgroup.c
+util/debugfs.c
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 36d4c56..d0f9f29 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -24,11 +24,11 @@ cflags += getenv('CFLAGS', '').split()
build_lib = getenv('PYTHON_EXTBUILD_LIB')
build_tmp = getenv('PYTHON_EXTBUILD_TMP')
+ext_sources = [f.strip() for f in file('util/python-ext-sources')
+ if len(f.strip()) > 0 and f[0] != '#']
+
perf = Extension('perf',
- sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
- 'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
- 'util/util.c', 'util/xyarray.c', 'util/cgroup.c',
- 'util/debugfs.c'],
+ sources = ext_sources,
include_dirs = ['util/include'],
extra_compile_args = cflags,
)
--
1.7.9.123.g65da0
next prev parent reply other threads:[~2012-02-14 1:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 1:52 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 01/16] perf tools: fix endianness detection in perf.data Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 02/16] perf record: No build id option fails Arnaldo Carvalho de Melo
2012-02-14 1:52 ` Arnaldo Carvalho de Melo [this message]
2012-02-14 1:52 ` [PATCH 04/16] perf tools: Fix out of tree compiles Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 05/16] perf tools: Allow multiple threads or processes in record, stat, top Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 06/16] perf top: Don't process samples with no valid machine object Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 07/16] perf tools: Change perf_guest default back to false Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 08/16] perf tools: Implement islower/isupper macro into util.h Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 09/16] perf tools: ctype.c only wants util.h Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 10/16] perf tools: Get rid of ctype.h in symbol.c Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 11/16] perf tools: Remove unused functions from debugfs object Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 12/16] perf tools: Add sysfs mountpoint interface Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 13/16] perf tools: Add bitmap_or function into bitmap object Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 14/16] perf tools: Moving code in header.c Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 15/16] perf tools: Factor out feature op to process header sections Arnaldo Carvalho de Melo
2012-02-14 1:52 ` [PATCH 16/16] perf tools: cleanup initialization of attr->size Arnaldo Carvalho de Melo
2012-02-14 2:50 ` [GIT PULL 00/16] perf/core improvements and fixes Namhyung Kim
2012-02-14 3:07 ` Namhyung Kim
2012-02-14 5:10 ` Namhyung Kim
2012-02-14 5:23 ` David Ahern
2012-02-14 5:48 ` Namhyung Kim
2012-02-14 5:52 ` David Ahern
2012-02-14 5:58 ` Namhyung Kim
2012-02-14 10:50 ` Joerg Roedel
2012-02-14 13:10 ` Arnaldo Carvalho de Melo
2012-02-14 14:38 ` Arnaldo Carvalho de Melo
2012-02-14 15:10 ` Joerg Roedel
2012-02-14 16:11 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329184375-27911-4-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®