[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420212972-21595-31-git-send-email-jolsa@kernel.org>
Date: Fri, 2 Jan 2015 16:36:12 +0100
From: Jiri Olsa <jolsa@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Jiri Olsa <jolsa@...nel.org>,
Alexis Berlemont <alexis.berlemont@...il.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH 30/30] perf tools: Disable test code
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@...nel.org>
Cc: Alexis Berlemont <alexis.berlemont@...il.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists