aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-01-10 14:46:45 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-01-13 08:06:26 -0500
commit4887805384751717ef62a8f41439d1d3e4268b39 (patch)
tree5783b96b724c1e71c9ff60bb636014f3fc5dd575 /tools/perf/tests
parentc023f534c31f69a658fc21d619116ad12c7be464 (diff)
perf tools: Add test for building detached source tarballs
Test one of the main kernel Makefile targets to generate a perf sources tarball suitable for build outside the full kernel sources. This is to test that the tools/perf/MANIFEST file lists all the files needed to be in such tarball, which sometimes gets broken when we move files around, like when we made some files that were in tools/perf/ available to other tools/ codebases by moving it to tools/include/, etc. Now everytime we use 'make -C tools/perf -f tests/make' this test will be performed, helping detect such problems earlier in the devel cycle. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-gyivwbbu2j7c4j4pwpmttg2p@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r--tools/perf/tests/make10
-rwxr-xr-xtools/perf/tests/perf-targz-src-pkg21
2 files changed, 29 insertions, 2 deletions
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index e341088de8f3..00544b8b644b 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -216,10 +216,16 @@ $(run_O):
216 rm -rf $$TMP_O \ 216 rm -rf $$TMP_O \
217 rm -rf $$TMP_DEST 217 rm -rf $$TMP_DEST
218 218
219all: $(run) $(run_O) 219tarpkg:
220 @cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \
221 echo "- $@: $$cmd" && echo $$cmd > $@ && \
222 ( eval $$cmd ) >> $@ 2>&1
223
224
225all: $(run) $(run_O) tarpkg
220 @echo OK 226 @echo OK
221 227
222out: $(run_O) 228out: $(run_O)
223 @echo OK 229 @echo OK
224 230
225.PHONY: all $(run) $(run_O) clean 231.PHONY: all $(run) $(run_O) tarpkg clean
diff --git a/tools/perf/tests/perf-targz-src-pkg b/tools/perf/tests/perf-targz-src-pkg
new file mode 100755
index 000000000000..238aa3927c71
--- /dev/null
+++ b/tools/perf/tests/perf-targz-src-pkg
@@ -0,0 +1,21 @@
1#!/bin/sh
2# Test one of the main kernel Makefile targets to generate a perf sources tarball
3# suitable for build outside the full kernel sources.
4#
5# This is to test that the tools/perf/MANIFEST file lists all the files needed to
6# be in such tarball, which sometimes gets broken when we move files around,
7# like when we made some files that were in tools/perf/ available to other tools/
8# codebases by moving it to tools/include/, etc.
9
10PERF=$1
11cd ${PERF}/../..
12make perf-targz-src-pkg > /dev/null
13TARBALL=$(ls -rt perf-*.tar.gz)
14TMP_DEST=$(mktemp -d)
15tar xf ${TARBALL} -C $TMP_DEST
16rm -f ${TARBALL}
17cd - > /dev/null
18make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
19RC=$?
20rm -rf ${TMP_DEST}
21exit $RC