From: Jiri Olsa <jolsa@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>,
Alexis Berlemont <alexis.berlemont@gmail.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 30/30] perf tools: Disable test code
Date: Fri, 2 Jan 2015 16:36:12 +0100 [thread overview]
Message-ID: <1420212972-21595-31-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1420212972-21595-1-git-send-email-jolsa@kernel.org>
NOTE: hack
Forcing test objects not to be compiled into perf code.
This saves almost 1MB of perf binary size on my setup:
# standard perf binary
$ ls -l perf
-rwxrwxr-x 1 jolsa jolsa 10283684 Jan 1 15:52 perf
# current perf binary
$ ls -l perf
-rwxrwxr-x 1 jolsa jolsa 9303174 Jan 1 15:58 perf
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
---
tools/perf/builtin-cmds.h | 2 +-
tools/perf/config.default | 2 +-
tools/perf/perf-sys.h | 2 +-
tools/perf/perf.c | 4 ++++
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
index 5ceb4b58cfdd..d0993b91932e 100644
--- a/tools/perf/builtin-cmds.h
+++ b/tools/perf/builtin-cmds.h
@@ -23,7 +23,7 @@
#define CONFIG_BUILTIN_HELP
#define CONFIG_BUILTIN_PROBE
#define CONFIG_BUILTIN_MEM
-#define CONFIG_BUILTIN_TEST
+//#define CONFIG_BUILTIN_TEST
#endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/config.default b/tools/perf/config.default
index 2781af21b70b..8a31a9d7b940 100644
--- a/tools/perf/config.default
+++ b/tools/perf/config.default
@@ -20,4 +20,4 @@ CONFIG_BUILTIN_INJECT := y
CONFIG_BUILTIN_MEM := y
CONFIG_BUILTIN_TRACE := y
CONFIG_BUILTIN_PROBE := y
-CONFIG_BUILTIN_TEST := y
+CONFIG_BUILTIN_TEST := n
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index a3b13d7dc1d4..48831388db1d 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -181,7 +181,7 @@ sys_perf_event_open(struct perf_event_attr *attr,
fd = syscall(__NR_perf_event_open, attr, pid, cpu,
group_fd, flags);
-#ifdef HAVE_ATTR_TEST
+#if defined(CONFIG_BUILTIN_TEST) && defined(HAVE_ATTR_TEST)
if (unlikely(test_attr__enabled))
test_attr__open(attr, pid, cpu, fd, group_fd, flags);
#endif
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 7c5ceff22d47..ef7c92cf9f25 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -57,7 +57,9 @@ static struct cmd_struct commands[] = {
{ "kmem", cmd_kmem, 0 },
{ "lock", cmd_lock, 0 },
{ "kvm", cmd_kvm, 0 },
+#ifdef CONFIG_BUILTIN_TEST
{ "test", cmd_test, 0 },
+#endif
#ifdef HAVE_LIBAUDIT_SUPPORT
{ "trace", cmd_trace, 0 },
#endif
@@ -539,7 +541,9 @@ int main(int argc, const char **argv)
}
cmd = argv[0];
+#ifdef CONFIG_BUILTIN_TEST
test_attr__init();
+#endif
/*
* We use PATH to find perf commands, but we prepend some higher
--
1.9.3
next prev parent reply other threads:[~2015-01-02 15:38 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 15:35 [RFC/PATCHSET 00/30] perf tools: New build framework Jiri Olsa
2015-01-02 15:35 ` [PATCH 01/30] perf tools: Add new build framework support Jiri Olsa
2015-01-05 10:57 ` Borislav Petkov
2015-01-05 11:13 ` Jiri Olsa
2015-01-06 13:41 ` Arnaldo Carvalho de Melo
2015-01-06 14:06 ` Jiri Olsa
2015-01-08 6:18 ` Namhyung Kim
2015-01-08 14:45 ` Jiri Olsa
2015-01-02 15:35 ` [PATCH 02/30] perf build: Add detected config " Jiri Olsa
2015-01-02 15:35 ` [PATCH 03/30] perf build: Add subdir " Jiri Olsa
2015-01-02 15:35 ` [PATCH 04/30] perf build: Add bench objects building Jiri Olsa
2015-01-02 15:35 ` [PATCH 05/30] perf build: Add tests " Jiri Olsa
2015-01-02 15:35 ` [PATCH 06/30] perf build: Add builtin " Jiri Olsa
2015-01-02 15:35 ` [PATCH 07/30] perf build: Add libperf " Jiri Olsa
2015-01-08 6:15 ` Namhyung Kim
2015-01-08 14:45 ` Jiri Olsa
2015-01-02 15:35 ` [PATCH 08/30] perf build: Add probe " Jiri Olsa
2015-01-02 15:35 ` [PATCH 09/30] perf build: Add dwarf " Jiri Olsa
2015-01-02 15:35 ` [PATCH 10/30] perf build: Add dwarf unwind " Jiri Olsa
2015-01-02 15:35 ` [PATCH 11/30] perf build: Add ui " Jiri Olsa
2015-01-02 15:35 ` [PATCH 12/30] perf build: Add slang " Jiri Olsa
2015-01-02 15:35 ` [PATCH 13/30] perf build: Add gtk " Jiri Olsa
2015-01-02 15:35 ` [PATCH 14/30] perf build: Add scripts " Jiri Olsa
2015-01-02 15:35 ` [PATCH 15/30] perf build: Add perf regs " Jiri Olsa
2015-01-02 15:35 ` [PATCH 16/30] perf build: Add zlib " Jiri Olsa
2015-01-02 15:35 ` [PATCH 17/30] perf build: Add perf.o object building Jiri Olsa
2015-01-02 15:36 ` [PATCH 18/30] perf build: Add arch x86 objects building Jiri Olsa
2015-01-02 15:36 ` [PATCH 19/30] perf build: Add arch arm " Jiri Olsa
2015-01-02 15:36 ` [PATCH 20/30] perf build: Add arch arm64 " Jiri Olsa
2015-01-02 15:36 ` [PATCH 21/30] perf build: Add arch powerpc " Jiri Olsa
2015-01-02 15:36 ` [PATCH 22/30] perf build: Add arch s390 " Jiri Olsa
2015-01-02 15:36 ` [PATCH 23/30] perf build: Add arch sh " Jiri Olsa
2015-01-02 15:36 ` [PATCH 24/30] perf build: Add arch sparc " Jiri Olsa
2015-01-02 15:36 ` [PATCH 25/30] perf build: Add single target build framework support Jiri Olsa
2015-01-02 15:36 ` [PATCH 26/30] perf make: Remove directory dependency rules Jiri Olsa
2015-01-02 15:36 ` [PATCH 27/30] perf make: Remove uneeded variables Jiri Olsa
2015-01-02 15:36 ` [PATCH 28/30] perf make: Remove PERF-CFLAGS file Jiri Olsa
2015-01-02 15:36 ` [PATCH 29/30] perf tools: Add support to configure builtin commands inclusion Jiri Olsa
2015-01-08 7:15 ` Namhyung Kim
2015-01-08 14:44 ` Jiri Olsa
2015-01-02 15:36 ` Jiri Olsa [this message]
2015-01-02 16:29 ` [PATCH 30/30] perf tools: Disable test code David Ahern
2015-01-02 17:36 ` [RFC/PATCHSET 00/30] perf tools: New build framework Ingo Molnar
2015-01-04 15:49 ` Jiri Olsa
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=1420212972-21595-31-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=acme@redhat.com \
--cc=alexis.berlemont@gmail.com \
--cc=bp@alien8.de \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/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