All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/34] perf and kconfig / kbuild
@ 2014-05-13 22:02 Alexis Berlemont
  2014-05-13 22:02 ` [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Alexis Berlemont
                   ` (35 more replies)
  0 siblings, 36 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Hello, 

A few months ago, I tried to make a proposal to introduce Kconfig in
perf's generation procedure.
(cf. https://lkml.org/lkml/2013/12/20/511)

I started from David Ahern's work; I was not aware that Jiri Olsa
pushed further the idea and proposed an alternative which integrated
kbuild too.

So, here is another proposal based on Jiri Olsa work (from April 2013). 
* Most of the NO_* and HAVE_* makefile variables were removed on
  behalf of Kconfig's ones (CONFIG_*); perf source code was modified
  accordingly;
* These changes make the glue files tools/perf/config/Makefile.fix-* useless
* The build test cases now relies on generated configuration files (in
  tools/perf/tests/configs); 

Hope this helps,

Alexis.

Alexis Berlemont (29):
  perf kbuild: fix recursive invocation of config/features-checks
  perf kbuild: store in config-detected missing variables (libdir, ...)
  perf kbuild: remove useless #ifdef directives
  perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
  perf kbuild: add missing files and missing flags in Kbuild files
  perf kbuild: update kbuild files according to last changes
  perf kbuild: remove legacy slang-related build variables
  perf kbuild: remove legacy libaudit-related build variables
  perf kbuild: remove legacy libgtk2-related build variables
  perf kbuild: remove legacy libperl-related build variables
  perf kbuild: remove legacy timerfd-related build variable
  perf kbuild: remove legacy demangle-related build variables
  perf kbuild: remove legacy on_exit-related build variable
  perf kbuild: remove legacy backtrace-related build variable
  perf kbuild: remove legacy numa-related build variable
  perf kbuild: remove legacy bionic-related build variable
  perf kbuild: remove legacy libelf-related build variables (1st part)
  perf kbuild: remove legacy libelf-related build variables (2nd part)
  perf kbuild: remove legacy libdwarf-related build variables
  perf kbuild: remove legacy libunwind-related build variables
  perf kbuild: remove legacy libpython-related build variable
  perf kbuild: add generated Kconfig build-test cases
  perf kbuild: fix installation of traceevent plugins
  perf kbuild: fix tarpkg target in tests/make
  perf kbuild: update Kbuild files with new and removed sources
  perf kbuild: update build test configurations
  perf kbuild: relocate the configs generating script
  perf kbuild: minor changes
  perf kbuild: remove Makefile.perf

Jiri Olsa (5):
  kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
  kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
  perf tools: Kbuild builtin source related fixies
  perf tools: Kbuild source related fixies
  perf tools: Add kbuild support into Makefile.kbuild

 scripts/Makefile.build                             |   3 +-
 scripts/kconfig/confdata.c                         |  11 +-
 scripts/kconfig/lkc.h                              |   1 +
 tools/perf/Kbuild                                  |  47 ++
 tools/perf/Kconfig                                 | 370 ++++++++
 tools/perf/MANIFEST                                |   1 +
 tools/perf/Makefile                                |   2 +-
 tools/perf/Makefile.kbuild                         | 414 +++++++++
 tools/perf/Makefile.perf                           | 930 ---------------------
 tools/perf/arch/Kbuild                             |   3 +
 tools/perf/arch/arm/Makefile                       |   4 +-
 tools/perf/arch/powerpc/Makefile                   |   2 +-
 tools/perf/arch/s390/Makefile                      |   2 +-
 tools/perf/arch/sh/Makefile                        |   2 +-
 tools/perf/arch/sparc/Makefile                     |   2 +-
 tools/perf/arch/x86/Kbuild                         |   2 +
 tools/perf/arch/x86/Makefile                       |   8 +-
 tools/perf/arch/x86/tests/Kbuild                   |   2 +
 tools/perf/arch/x86/util/Kbuild                    |   5 +
 tools/perf/bench/Kbuild                            |  12 +
 tools/perf/builtin-annotate.c                      |   8 +-
 tools/perf/builtin-bench.c                         |   5 +-
 tools/perf/builtin-cmds.h                          |  31 +
 tools/perf/builtin-help.c                          |   1 +
 tools/perf/builtin-inject.c                        |   2 +-
 tools/perf/builtin-kvm.c                           |  32 +-
 tools/perf/builtin-lock.c                          |   4 +-
 tools/perf/builtin-mem.c                           |   3 +-
 tools/perf/builtin-probe.c                         |  15 +-
 tools/perf/builtin-record.c                        |  14 +-
 tools/perf/builtin-report.c                        |   3 +
 tools/perf/builtin-sched.c                         |   2 +
 tools/perf/builtin-script.c                        |   6 +-
 tools/perf/builtin-top.c                           |  15 +-
 tools/perf/config/Makefile                         | 397 +++++----
 tools/perf/config/defconfig                        |  54 ++
 tools/perf/perf.c                                  |  53 +-
 tools/perf/perf.h                                  |   2 +
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild     |   3 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild   |   5 +
 tools/perf/tests/Kbuild                            |  34 +
 tools/perf/tests/builtin-test.c                    |   3 +-
 tools/perf/tests/configs/MINIMAL_config            |  60 ++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  69 ++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  60 ++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  65 ++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  69 ++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  69 ++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  67 ++
 tools/perf/tests/configs/NO_GTK2_config            |  69 ++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  68 ++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  67 ++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  67 ++
 tools/perf/tests/configs/NO_LIBNUMA_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPERL_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  69 ++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  68 ++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  69 ++
 tools/perf/tests/configs/NO_STDIO_config           |  69 ++
 tools/perf/tests/configs/NO_TIMERFD_config         |  69 ++
 tools/perf/tests/configs/NO_TUI_config             |  69 ++
 tools/perf/tests/configs/NO_UNWIND_config          |  65 ++
 tools/perf/tests/configs/REF_config                |  69 ++
 tools/perf/tests/generate_configs.py               |  33 +
 tools/perf/tests/make                              |  73 +-
 tools/perf/tests/tests.h                           |   4 +-
 tools/perf/ui/Kbuild                               |  15 +
 tools/perf/ui/browsers/Kbuild                      |   9 +
 tools/perf/ui/browsers/scripts.c                   |   4 +
 tools/perf/ui/gtk/Kbuild                           |   9 +
 tools/perf/ui/gtk/browser.c                        |   4 +-
 tools/perf/ui/gtk/gtk.h                            |   5 +-
 tools/perf/ui/gtk/util.c                           |   6 +-
 tools/perf/ui/setup.c                              |  14 +-
 tools/perf/ui/stdio/Kbuild                         |   1 +
 tools/perf/ui/tui/Kbuild                           |   4 +
 tools/perf/ui/ui.h                                 |   4 +-
 tools/perf/util/Kbuild                             | 125 +++
 tools/perf/util/PERF-VERSION-GEN                   |   4 +
 tools/perf/util/annotate.h                         |   4 +-
 tools/perf/util/generate-cmdlist.sh                |  22 +-
 tools/perf/util/hist.h                             |   4 +-
 tools/perf/util/include/dwarf-regs.h               |   4 +-
 tools/perf/util/map.c                              |   3 +-
 tools/perf/util/probe-event.c                      |   6 +-
 tools/perf/util/probe-finder.h                     |   5 +-
 tools/perf/util/scripting-engines/Kbuild           |  11 +
 tools/perf/util/setup.py                           |   8 +-
 tools/perf/util/srcline.c                          |   8 +-
 tools/perf/util/symbol-elf.c                       |   3 +-
 tools/perf/util/symbol.h                           |  33 +-
 tools/perf/util/trace-event-scripting.c            |  13 +-
 tools/perf/util/unwind-libunwind.c                 |   5 +-
 tools/perf/util/unwind.h                           |   7 +-
 tools/perf/util/util.c                             |   5 +-
 116 files changed, 4556 insertions(+), 1274 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 delete mode 100644 tools/perf/Makefile.perf
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/tests/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/builtin-cmds.h
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/NO_UNWIND_config
 create mode 100644 tools/perf/tests/configs/REF_config
 create mode 100644 tools/perf/tests/generate_configs.py
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

-- 
1.9.2


^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
@ 2014-05-13 22:02 ` Alexis Berlemont
  2014-05-14  5:00   ` Sam Ravnborg
  2014-05-13 22:02 ` [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Alexis Berlemont
                   ` (34 subsequent siblings)
  35 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, Michal Marek, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Introducing KBUILD_AUTOCONF variable for auto.conf include
allowing to specify custom auto.conf file.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 scripts/Makefile.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 003bc26..7602c01 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -31,7 +31,8 @@ subdir-asflags-y :=
 subdir-ccflags-y :=
 
 # Read auto.conf if it exists, otherwise ignore
--include include/config/auto.conf
+kbuild-autoconf := $(if $(KBUILD_AUTOCONF),$(KBUILD_AUTOCONF),include/config/auto.conf)
+-include $(kbuild-autoconf)
 
 include scripts/Kbuild.include
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
  2014-05-13 22:02 ` [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Alexis Berlemont
@ 2014-05-13 22:02 ` Alexis Berlemont
  2014-05-14  5:02   ` Sam Ravnborg
  2014-05-14 10:17   ` Michal Marek
  2014-05-13 22:02 ` [PATCH 03/34] perf tools: Kbuild builtin source related fixies Alexis Berlemont
                   ` (33 subsequent siblings)
  35 siblings, 2 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, Michal Marek, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Introducing KCONFIG_AUTOCONFIGDEP variable for conf tool
allowing to specify custom auto.conf.cmd file.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 scripts/kconfig/confdata.c | 11 ++++++++++-
 scripts/kconfig/lkc.h      |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index f88d90f..7afb2a7 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -75,6 +75,14 @@ const char *conf_get_autoconfig_name(void)
 	return name ? name : "include/config/auto.conf";
 }
 
+const char *conf_get_autoconfigdep_name(void)
+{
+	char *name = getenv("KCONFIG_AUTOCONFIGDEP");
+
+	return name ? name : "include/config/auto.conf.cmd";
+}
+
+
 static char *conf_expand_value(const char *in)
 {
 	struct symbol *sym;
@@ -953,7 +961,8 @@ int conf_write_autoconf(void)
 
 	sym_clear_all_valid();
 
-	file_write_dep("include/config/auto.conf.cmd");
+	name = conf_get_autoconfigdep_name();
+	file_write_dep(name);
 
 	if (conf_split_config())
 		return 1;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index d5daa7a..ac99004 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -84,6 +84,7 @@ const char *zconf_curname(void);
 /* confdata.c */
 const char *conf_get_configname(void);
 const char *conf_get_autoconfig_name(void);
+const char *conf_get_autoconfigdep_name(void);
 char *conf_get_default_confname(void);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 03/34] perf tools: Kbuild builtin source related fixies
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
  2014-05-13 22:02 ` [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Alexis Berlemont
  2014-05-13 22:02 ` [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Alexis Berlemont
@ 2014-05-13 22:02 ` Alexis Berlemont
  2014-05-13 22:02 ` [PATCH 04/34] perf tools: Kbuild " Alexis Berlemont
                   ` (32 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, Michal Marek, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding CONFIG_BUILTIN_* defines to govern builtin commands.
This will be usefull for kbuild process switch.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-cmds.h           | 27 ++++++++++++++++++++++
 tools/perf/builtin-help.c           |  1 +
 tools/perf/perf.c                   | 45 +++++++++++++++++++++++++++++++++++--
 tools/perf/util/generate-cmdlist.sh | 10 +++++++++
 4 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/builtin-cmds.h

diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
new file mode 100644
index 0000000..fec342a
--- /dev/null
+++ b/tools/perf/builtin-cmds.h
@@ -0,0 +1,27 @@
+#ifndef BUILTIN_CMDS_H
+#define BUILTIN_CMDS_H
+
+#define CONFIG_BUILTIN_REPORT 1
+#define CONFIG_BUILTIN_SCRIPT 1
+#define CONFIG_BUILTIN_BENCH 1
+#define CONFIG_BUILTIN_SCHED 1
+#define CONFIG_BUILTIN_TRACE 1
+#define CONFIG_BUILTIN_TOP 1
+#define CONFIG_BUILTIN_RECORD 1
+#define CONFIG_BUILTIN_BUILDID_LIST 1
+#define CONFIG_BUILTIN_INJECT 1
+#define CONFIG_BUILTIN_LOCK 1
+#define CONFIG_BUILTIN_KVM 1
+#define CONFIG_BUILTIN_BUILDID_CACHE 1
+#define CONFIG_BUILTIN_EVLIST 1
+#define CONFIG_BUILTIN_KMEM 1
+#define CONFIG_BUILTIN_STAT 1
+#define CONFIG_BUILTIN_DIFF 1
+#define CONFIG_BUILTIN_ANNOTATE 1
+#define CONFIG_BUILTIN_TIMECHART 1
+#define CONFIG_BUILTIN_LIST 1
+#define CONFIG_BUILTIN_HELP 1
+#define CONFIG_BUILTIN_PROBE 1
+#define CONFIG_BUILTIN_MEM 1
+
+#endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 178b88a..b6c78a6 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -7,6 +7,7 @@
 #include "util/cache.h"
 #include "builtin.h"
 #include "util/exec_cmd.h"
+#include "builtin-cmds.h"
 #include "common-cmds.h"
 #include "util/parse-options.h"
 #include "util/run-command.h"
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 431798a..c39470b 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -7,6 +7,7 @@
  * perf top, perf record, perf report, etc.) are started.
  */
 #include "builtin.h"
+#include "builtin-cmds.h"
 
 #include "util/exec_cmd.h"
 #include "util/cache.h"
@@ -33,34 +34,74 @@ struct cmd_struct {
 };
 
 static struct cmd_struct commands[] = {
+#ifdef CONFIG_BUILTIN_BUILDID_CACHE
 	{ "buildid-cache", cmd_buildid_cache, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_BUILDID_LIST
 	{ "buildid-list", cmd_buildid_list, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_DIFF
 	{ "diff",	cmd_diff,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_EVLIST
 	{ "evlist",	cmd_evlist,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_HELP
 	{ "help",	cmd_help,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LIST
 	{ "list",	cmd_list,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_RECORD
 	{ "record",	cmd_record,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_REPORT
 	{ "report",	cmd_report,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_BENCH
 	{ "bench",	cmd_bench,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_STAT
 	{ "stat",	cmd_stat,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TIMECHART
 	{ "timechart",	cmd_timechart,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TOP
 	{ "top",	cmd_top,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_ANNOTATE
 	{ "annotate",	cmd_annotate,	0 },
+#endif
 	{ "version",	cmd_version,	0 },
+#ifdef CONFIG_BUILTIN_SCRIPT
 	{ "script",	cmd_script,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
-#ifdef HAVE_LIBELF_SUPPORT
+#endif
+#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_KMEM
 	{ "kmem",	cmd_kmem,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LOCK
 	{ "lock",	cmd_lock,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
+#endif
 	{ "test",	cmd_test,	0 },
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_INJECT
 	{ "inject",	cmd_inject,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_MEM
 	{ "mem",	cmd_mem,	0 },
+#endif
 };
 
 struct pager_config {
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d..05ee30f 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+function cfg()
+{
+     cfg=`echo $1 | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
+     echo "$cfg"
+}
+
 echo "/* Automatically generated by $0 */
 struct cmdname_help
 {
@@ -13,6 +19,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -20,6 +27,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
@@ -27,6 +35,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -34,6 +43,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
 echo "};"
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 04/34] perf tools: Kbuild source related fixies
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (2 preceding siblings ...)
  2014-05-13 22:02 ` [PATCH 03/34] perf tools: Kbuild builtin source related fixies Alexis Berlemont
@ 2014-05-13 22:02 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 05/34] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
                   ` (31 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, Michal Marek, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Fixing several sources config dependencies to allow
separate config builds.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-lock.c        |  4 +++-
 tools/perf/builtin-sched.c       |  2 ++
 tools/perf/perf.c                |  6 ++++++
 tools/perf/perf.h                |  2 ++
 tools/perf/ui/browsers/scripts.c |  4 ++++
 tools/perf/ui/setup.c            | 10 +++++++++-
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index c852c7a..b255c20 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -992,9 +992,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
 				usage_with_options(report_usage, report_options);
 		}
 		rc = __cmd_report(false);
+#ifdef CONFIG_BULTIN_SCRIPT
 	} else if (!strcmp(argv[0], "script")) {
 		/* Aliased to 'perf script' */
-		return cmd_script(argc, argv, prefix);
+		rc = cmd_script(argc, argv, prefix);
+#endif
 	} else if (!strcmp(argv[0], "info")) {
 		if (argc) {
 			argc = parse_options(argc, argv,
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 9ac0a49..cb77a4e 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1741,11 +1741,13 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (!argc)
 		usage_with_options(sched_usage, sched_options);
 
+#ifdef CONFIG_BULTIN_SCRIPT
 	/*
 	 * Aliased to 'perf script' for now:
 	 */
 	if (!strcmp(argv[0], "script"))
 		return cmd_script(argc, argv, prefix);
+#endif
 
 	symbol__init();
 	if (!strncmp(argv[0], "rec", 3)) {
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index c39470b..74a1269 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -92,7 +92,9 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_TEST
 	{ "test",	cmd_test,	0 },
+#endif
 #if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
@@ -543,13 +545,17 @@ int main(int argc, const char **argv)
 	} else {
 		/* The user didn't specify a command; give them help */
 		printf("\n usage: %s\n\n", perf_usage_string);
+#ifdef CONFIG_BUILTIN_HELP
 		list_common_cmds_help();
 		printf("\n %s\n\n", perf_more_info_string);
+#endif
 		goto out;
 	}
 	cmd = argv[0];
 
+#ifdef CONFIG_BUILTIN_TEST
 	test_attr__init();
+#endif
 
 	/*
 	 * We use PATH to find perf commands, but we prepend some higher
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 5c11eca..8487a30 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -221,8 +221,10 @@ sys_perf_event_open(struct perf_event_attr *attr,
 	fd = syscall(__NR_perf_event_open, attr, pid, cpu,
 		     group_fd, flags);
 
+#ifdef CONFIG_BUILTIN_TEST
 	if (unlikely(test_attr__enabled))
 		test_attr__open(attr, pid, cpu, fd, group_fd, flags);
+#endif
 
 	return fd;
 }
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index 402d2bd..128988d 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -59,7 +59,11 @@ static int list_scripts(char *script_name)
 		paths[i] = names[i] + SCRIPT_NAMELEN;
 	}
 
+#ifdef CONFIG_BUILTIN_SCRIPT
 	num = find_scripts(names, paths);
+#else
+	num = 0;
+#endif
 	if (num > 0) {
 		choice = ui__popup_menu(num, names);
 		if (choice < num && choice >= 0) {
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 5df5140..66ecd08 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -71,16 +71,20 @@ void setup_browser(bool fallback_to_pager)
 
 	switch (use_browser) {
 	case 2:
+#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		if (setup_gtk_browser() == 0)
 			break;
 		printf("GTK browser requested but could not find %s\n",
 		       PERF_GTK_DSO);
 		sleep(1);
+#endif
 		/* fall through */
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
+#endif
 		/* fall through */
 	default:
 		use_browser = 0;
@@ -92,16 +96,20 @@ void setup_browser(bool fallback_to_pager)
 	}
 }
 
-void exit_browser(bool wait_for_ok)
+void exit_browser(bool wait_for_ok __maybe_unused)
 {
 	switch (use_browser) {
 	case 2:
+#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		exit_gtk_browser(wait_for_ok);
 		break;
+#endif
 
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
+#endif
 
 	default:
 		break;
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 05/34] perf tools: Add kbuild support into Makefile.kbuild
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (3 preceding siblings ...)
  2014-05-13 22:02 ` [PATCH 04/34] perf tools: Kbuild " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 06/34] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
                   ` (30 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, Michal Marek, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding kbuild support into Makefile.kbuild. The 'legacy'
Makefile still stays untouched as it was.

It's possible to use kbuild by running 'make -f Makefile.kbuild'
with any option supported by 'legacy' Makefile.

We now have 2 config files:
  '.config' - user configured setup
  '.config-detected' - system detected setup

The '.config-detected' affects '.config' and if there's
configured feature in '.config' which was not detected
it is automatically disabled.

The '.config-detected' is re/created if:
  - there's no '.config-detected'
  - '.config' was changed

In a cleaned tree the perf is built with 'allyesconfig'
having disabled all non-detected features, just as it is
done now.

You can change '.config' via:
  make -f Makefile.kbuild menuconfig

There's difference for O=DIR build. The DIR is populated
based on kernel source tree, so the final binary is created
under DIR/tools/perf.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/Kbuild                                |  47 +++
 tools/perf/Kconfig                               | 256 ++++++++++++++
 tools/perf/Makefile.kbuild                       | 411 +++++++++++++++++++++++
 tools/perf/Makefile.perf                         |   2 +-
 tools/perf/arch/Kbuild                           |   3 +
 tools/perf/arch/x86/Kbuild                       |   1 +
 tools/perf/arch/x86/util/Kbuild                  |   3 +
 tools/perf/bench/Kbuild                          |   9 +
 tools/perf/builtin-cmds.h                        |   4 +
 tools/perf/config/Makefile                       |  45 +++
 tools/perf/config/Makefile.fix-config            | 104 ++++++
 tools/perf/config/Makefile.fix-legacy            |  46 +++
 tools/perf/config/defconfig                      |  54 +++
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild   |   3 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild |   4 +
 tools/perf/tests/Kbuild                          |  23 ++
 tools/perf/ui/Kbuild                             |  14 +
 tools/perf/ui/browsers/Kbuild                    |   6 +
 tools/perf/ui/gtk/Kbuild                         |   7 +
 tools/perf/ui/stdio/Kbuild                       |   1 +
 tools/perf/ui/tui/Kbuild                         |   4 +
 tools/perf/util/Kbuild                           | 113 +++++++
 tools/perf/util/PERF-VERSION-GEN                 |   4 +
 tools/perf/util/generate-cmdlist.sh              |   8 +-
 tools/perf/util/scripting-engines/Kbuild         |   7 +
 tools/perf/util/setup.py                         |   8 +-
 26 files changed, 1180 insertions(+), 7 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/config/Makefile.fix-config
 create mode 100644 tools/perf/config/Makefile.fix-legacy
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

diff --git a/tools/perf/Kbuild b/tools/perf/Kbuild
new file mode 100644
index 0000000..80b9184
--- /dev/null
+++ b/tools/perf/Kbuild
@@ -0,0 +1,47 @@
+obj-y += perf.o
+
+obj-$(CONFIG_BUILTIN_ANNOTATE)      += builtin-annotate.o
+obj-$(CONFIG_BUILTIN_BENCH)         += builtin-bench.o
+obj-$(CONFIG_BUILTIN_BENCH)         += bench/
+obj-$(CONFIG_BUILTIN_BUILDID_CACHE) += builtin-buildid-cache.o
+obj-$(CONFIG_BUILTIN_BUILDID_LIST)  += builtin-buildid-list.o
+obj-$(CONFIG_BUILTIN_DIFF)          += builtin-diff.o
+obj-$(CONFIG_BUILTIN_EVLIST)        += builtin-evlist.o
+obj-$(CONFIG_BUILTIN_HELP)          += builtin-help.o
+obj-$(CONFIG_BUILTIN_INJECT)        += builtin-inject.o
+obj-$(CONFIG_BUILTIN_KMEM)          += builtin-kmem.o
+obj-$(CONFIG_BUILTIN_KVM)           += builtin-kvm.o
+obj-$(CONFIG_BUILTIN_LIST)          += builtin-list.o
+obj-$(CONFIG_BUILTIN_LOCK)          += builtin-lock.o
+obj-$(CONFIG_BUILTIN_PROBE)         += builtin-probe.o
+obj-$(CONFIG_BUILTIN_RECORD)        += builtin-record.o
+obj-$(CONFIG_BUILTIN_REPORT)        += builtin-report.o
+obj-$(CONFIG_BUILTIN_SCHED)         += builtin-sched.o
+obj-$(CONFIG_BUILTIN_SCRIPT)        += builtin-script.o
+obj-$(CONFIG_BUILTIN_STAT)          += builtin-stat.o
+obj-$(CONFIG_BUILTIN_TIMECHART)     += builtin-timechart.o
+obj-$(CONFIG_BUILTIN_TOP)           += builtin-top.o
+obj-$(CONFIG_BUILTIN_TRACE)         += builtin-trace.o
+obj-$(CONFIG_BUILTIN_MEM)           += builtin-mem.o
+obj-$(CONFIG_BUILTIN_TEST)          += tests/
+
+obj-y += ../../lib/rbtree.o
+
+obj-y += util/
+obj-y += ui/
+obj-y += arch/
+
+obj-$(CONFIG_LIBPERL)   += scripts/perl/Perf-Trace-Util/
+obj-$(CONFIG_LIBPYTHON) += scripts/python/Perf-Trace-Util/
+
+
+CFLAGS_rbtree.o += -Wno-unused-parameter
+
+CFLAGS_perf.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_perf.o += -include PERF-VERSION-FILE
+
+$(obj)/perf.o: $(obj)/PERF-VERSION-FILE
+
+CFLAGS_builtin-help.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_INFO_PATH=KBUILD_STR($(infodir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_MAN_PATH=KBUILD_STR($(mandir_SQ))"
diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
new file mode 100644
index 0000000..5f3a6b7
--- /dev/null
+++ b/tools/perf/Kconfig
@@ -0,0 +1,256 @@
+
+mainmenu "The perf configuration"
+
+menu "Built-in commands"
+
+config BUILTIN_RECORD
+	bool "record"
+	default y
+        ---help---
+	  record
+
+config BUILTIN_REPORT
+	bool "report"
+	default y
+        ---help---
+	  report
+
+config BUILTIN_STAT
+	bool "stat"
+	default y
+        ---help---
+	  stat
+
+config BUILTIN_TOP
+	bool "top"
+	default n
+        ---help---
+	  top
+
+config BUILTIN_TRACE
+	bool "trace"
+	default n
+	depends on CONFIG_LIBAUDIT
+        ---help---
+	  trace
+
+config BUILTIN_ANNOTATE
+	bool "annotate"
+	default n
+        ---help---
+	  annotate
+
+config BUILTIN_BENCH
+	bool "bench"
+	default n
+        ---help---
+	  bench
+
+config BUILTIN_BUILDID_CACHE
+	bool "buildid-cache"
+	default n
+        ---help---
+	  buildid-cache
+
+config BUILTIN_BUILDID_LIST
+	bool "buildid-list"
+	default n
+        ---help---
+	  buildid-list
+
+config BUILTIN_DIFF
+	bool "diff"
+	default y
+        ---help---
+	  diff
+
+config BUILTIN_EVLIST
+	bool "evlist"
+	default n
+        ---help---
+	  evlist
+
+config BUILTIN_HELP
+	bool "help"
+	default y
+        ---help---
+	  help
+
+config BUILTIN_INJECT
+	bool "inject"
+	default n
+        ---help---
+	  inject
+
+config BUILTIN_KMEM
+	bool "kmem"
+	default n
+        ---help---
+	  kmem
+
+config BUILTIN_KVM
+	bool "kvm"
+	default n
+        ---help---
+	  kvm
+
+config BUILTIN_LIST
+	bool "list"
+	default n
+        ---help---
+	  list
+
+config BUILTIN_LOCK
+	bool "lock"
+	default n
+        ---help---
+	  lock
+
+config BUILTIN_PROBE
+	bool "probe"
+	default n
+	depends on LIBELF
+        ---help---
+	  probe
+
+config BUILTIN_SCHED
+	bool "sched"
+	default n
+        ---help---
+	  sched
+
+config BUILTIN_SCRIPT
+	bool "script"
+	default y
+        ---help---
+	  script
+
+config BUILTIN_TIMECHART
+	bool "timechart"
+	default n
+        ---help---
+	  timechart
+
+config BUILTIN_MEM
+	bool "mem"
+	default y
+        ---help---
+	  mem
+
+config BUILTIN_TEST
+	bool "test"
+	default y
+        ---help---
+	  test
+
+endmenu
+
+menu "Libraries"
+
+config LIBAUDIT
+	bool "Audit (libaudit)"
+	default n
+        ---help---
+	  libaudit
+
+config LIBPERL
+	bool "Perl"
+	default n
+        ---help---
+	  Perl
+
+config LIBPYTHON
+	bool "Python"
+	default n
+        ---help---
+	  Python
+
+choice
+	prompt "Elf library"
+	default LIBELF
+
+	config LIBELF
+	bool "elf"
+	---help---
+	  libelf
+
+	config LIBELF_MINIMAL
+	bool "builtin support"
+	---help---
+	  builtin elf support
+endchoice
+
+config LIBUNWIND
+	bool "User space libunwind callchains"
+        ---help---
+	  libunwind
+
+config LIBUNWIND_DIR
+	string "libunwind directory"
+	depends on LIBUNWIND
+        ---help---
+	  libunwind directory
+
+
+config NUMA
+	bool "Numa support (bench)"
+	default n
+        ---help---
+	  numa
+
+config DEMANGLE
+	bool "Demangle symbols"
+	default n
+        ---help---
+	  demangle
+
+config BIONIC
+	bool "Bionic support"
+	default n
+        ---help---
+	  bionic
+
+endmenu
+
+menu "GUI"
+
+config STDIO
+	bool "Terminal"
+	default y
+        ---help---
+	  stdio
+
+config TUI
+	bool "Tui (newt based)"
+	default n
+        ---help---
+	  stdio
+
+config GTK2
+	bool "Gtk2"
+	default n
+        ---help---
+	  stdio
+
+endmenu
+
+menu "Build"
+config DEBUG
+	bool "Compile with debug info"
+	default n
+        ---help---
+	  debug info
+
+config DEBUG_PARSER
+	bool "Compile with parsers debug info"
+	default n
+        ---help---
+	  debug info
+
+config BACKTRACE
+	bool "Compile with dump_stack support"
+	default n
+        ---help---
+	  dump_stack support
+
+endmenu
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
new file mode 100644
index 0000000..41beb83
--- /dev/null
+++ b/tools/perf/Makefile.kbuild
@@ -0,0 +1,411 @@
+srctree := $(abspath $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)/../../))
+objtree := $(abspath $(if $(KBUILD_SRC),$(CURDIR),$(CURDIR)/../..))
+
+VPATH   := $(srctree)
+
+export srctree VPATH
+
+MAKEFLAGS += --include-dir=$(srctree)
+MAKEFLAGS += --no-builtin-rules
+MAKEFLAGS += --no-print-directory
+
+ifeq ("$(origin V)", "command line")
+KBUILD_VERBOSE = $(V)
+endif
+
+ifndef KBUILD_VERBOSE
+KBUILD_VERBOSE = 0
+endif
+
+ifeq ($(KBUILD_VERBOSE),1)
+quiet =
+Q =
+else
+quiet=quiet_
+Q = @
+endif
+
+# If the user is running make -s (silent mode), suppress echoing of
+# commands
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+quiet=silent_
+endif
+
+export quiet Q KBUILD_VERBOSE
+
+ifndef V
+QUIET_LINK  = @echo '  LD      $@';
+QUIET_GEN   = @echo '  GEN     $@';
+QUIET_CLEAN = @echo '  CLEAN   tools/perf';
+endif
+
+export QUIET_BISON QUIET_FLEX
+
+ifeq ($(KBUILD_SRC),)
+
+ifeq ("$(origin O)", "command line")
+KBUILD_OUTPUT := $(O)
+else
+KBUILD_OUTPUT := $(objtree)
+endif
+
+# Invoke a second make in the output directory, passing relevant variables
+# check that the output directory actually exists
+saved-output := $(KBUILD_OUTPUT)
+KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+$(if $(KBUILD_OUTPUT),, \
+     $(error output directory "$(saved-output)" does not exist))
+
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/lib)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/include/config)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/tools/perf)
+
+PHONY += $(MAKECMDGOALS) sub-make
+
+$(filter-out sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) all: sub-make
+        @:
+
+sub-make: FORCE
+	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+	KBUILD_SRC=$(srctree) \
+	-f $(CURDIR)/Makefile.kbuild \
+	$(filter-out sub-make,$(MAKECMDGOALS))
+
+# Leave processing to above invocation of make
+skip-makefile := 1
+endif # ifeq ($(KBUILD_SRC),)
+
+export KBUILD_SRC
+
+ifeq ($(skip-makefile),)
+
+build := -f $(srctree)/scripts/Makefile.build obj
+
+src-kernel := $(srctree)
+src-perf   := $(srctree)/tools/perf
+obj-kernel := $(objtree)
+obj-perf   := $(objtree)/tools/perf
+
+VPATH += $(src-perf)
+
+export src-perf obj-perf
+
+OUTPUT := $(obj-perf)
+
+export OUTPUT
+
+AS      = as
+LD      = ld
+CC      = gcc
+CPP     = $(CC) -E
+HOSTCC  = gcc
+FLEX    = flex
+BISON   = bison
+INSTALL = install
+
+export AS LD CC CPP HOSTCC FLEX BISON
+
+# kbuild related config
+CONFIG_SHELL          := /bin/sh
+
+KBUILD_KCONFIG        := $(src-perf)/Kconfig
+KBUILD_AUTOCONF       := $(obj-perf)/include/config/auto.conf
+
+KCONFIG_CONFIG        ?= $(obj-perf)/.config
+KCONFIG_TRISTATE      := $(obj-perf)/include/config/tristate.conf
+KCONFIG_AUTOHEADER    := $(obj-perf)/include/generated/autoconf.h
+KCONFIG_AUTOCONFIG    := $(KBUILD_AUTOCONF)
+KCONFIG_AUTOCONFIGDEP := $(KBUILD_AUTOCONF).cmd
+
+export CONFIG_SHELL
+export KBUILD_KCONFIG KBUILD_AUTOCONF
+export KCONFIG_CONFIG KCONFIG_TRISTATE KCONFIG_AUTOHEADER
+export KCONFIG_AUTOCONFIG KCONFIG_AUTOCONFIGDEP
+
+# perf detected config
+CONFIG_DETECTED := $(obj-perf)/.config-detected
+
+export CONFIG_DETECTED
+
+# external .a libs
+LK_DIR          := $(srctree)/tools/lib/lk/
+TRACE_EVENT_DIR := $(srctree)/tools/lib/traceevent/
+
+LIBTRACEEVENT   := $(obj-kernel)/tools/lib/traceevent/libtraceevent.a
+LIBLK           := $(obj-kernel)/tools/lib/lk/liblk.a
+LIBS_A          := $(LIBTRACEEVENT) $(LIBLK)
+
+export TRACE_EVENT_DIR LK_DIR LIBTRACEEVENT LIBLK
+
+all:
+
+scripts_basic:
+	$(Q)$(MAKE) $(build)=scripts/basic
+
+defconfig: scripts_basic
+	$(Q)cp $(src-perf)/config/defconfig $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig oldconfig
+
+%config: scripts_basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig $@
+
+$(KCONFIG_CONFIG):
+	$(Q)$(MAKE) $(build)=scripts/basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig allyesconfig
+
+$(CONFIG_DETECTED): $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile
+
+# no need to include auto.conf.cmd, because .config
+# is the only dependency here
+$(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
+	$(Q)mkdir -p $(obj-perf)/include/config
+	$(Q)mkdir -p $(obj-perf)/include/generated
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
+	@touch $(CONFIG_DETECTED) # final touch.. to keep the time dependency correct
+
+clean-dirs := $(addprefix _clean_, tools/perf/)
+
+$(clean-dirs):
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
+
+clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBLK)-clean
+	$(Q)$(QUIET_CLEAN)
+	$(Q)rm -f $(obj-perf)/perf
+	$(Q)rm -f $(obj-perf)/common-cmds.h
+	$(Q)rm -f $(obj-perf)/python/perf.so
+	$(Q)rm -rf $(obj-perf)/include/generated $(obj-perf)/include/config
+	$(Q)find $(obj-perf) \
+		\( -name '*.[oas]' -o -name '.*.cmd' \
+		-o -name '.*.d' -o -name '.*.tmp' \
+		-o -name '*-flex.[ch]' -o -name '*-bison.[ch]' \
+		\) -type f -print | xargs rm -f
+	$(Q)$(python-clean)
+	$(Q)rm -f $(CONFIG_DETECTED) $(KCONFIG_CONFIG)
+
+TAGS tags:
+	$(Q)rm -f $(src-perf)/tags
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs ctags -a
+
+cscope:
+	$(Q)rm -f $(src-perf)/cscope*
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs cscope -b
+
+PHONY += clean $(clean-dirs) tags TAGS cscope
+
+ifneq ($(filter %config help clean tags TAGS cscope,$(MAKECMDGOALS)),)
+dont-detect := 1
+endif
+
+ifndef dont-detect
+# detected config variables
+include $(CONFIG_DETECTED)
+
+# Following variables are needed within Kbuild files, we need
+# to export them as they are not part of the .config set.
+export CONFIG_ARCH := $(ARCH)
+export CONFIG_X86_64
+export htmldir_SQ
+export infodir_SQ
+export mandir_SQ
+export perfexecdir_SQ
+export prefix_SQ
+export PARSER_DEBUG_BISON
+export PARSER_DEBUG_FLEX
+export ETC_PERFCONFIG_SQ
+export PYTHON_EMBED_CCOPTS
+export PERL_EMBED_CCOPTS
+endif
+
+# let sources know it's kbuild
+CFLAGS += -DCONFIG_KBUILD
+
+# kbuild related config
+LINUXINCLUDE    := $(CFLAGS)
+KBUILD_BUILTIN  := 1
+KBUILD_CHECKSRC := 0
+
+export LINUXINCLUDE
+export KBUILD_BUILTIN KBUILD_CHECKSRC
+
+# pyuthon language binding
+PYTHON_EXTBUILD     := $(src-perf)/python_ext_build/
+PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
+PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
+
+export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
+
+python-clean := rm -rf $(PYTHON_EXTBUILD) $(obj-perf)/python/perf.so
+
+PYTHON_EXT_SRCS   := $(addprefix $(src-perf)/,$(shell grep -v ^\# $(src-perf)/util/python-ext-sources))
+PYTHON_EXT_DEPS   := $(src-perf)/util/python-ext-sources $(src-perf)/util/setup.py
+PYTHON_EXT_CFLAGS := $(CFLAGS) -w
+
+export PYTHON_EXT_SRCS
+
+
+$(obj-perf)/python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
+	$(QUIET_GEN)CFLAGS='$(PYTHON_EXT_CFLAGS)' $(PYTHON_WORD) $(src-perf)/util/setup.py \
+	  --quiet build_ext; \
+	mkdir -p $(obj-perf)/python && \
+	cp $(PYTHON_EXTBUILD_LIB)perf.so $(obj-perf)/python/
+
+all: tools/perf/PERF-VERSION-FILE scripts_basic $(KBUILD_AUTOCONF) tools/perf/perf $(LANG_BINDINGS)
+
+$(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/command-list.txt
+	$(QUIET_GEN)$(src-perf)/util/generate-cmdlist.sh $(src-perf) > $@+ && mv $@+ $@
+
+PHONY += all scripts_basic
+
+$(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
+	$(Q)$(MAKE) $(build)=tools/perf
+
+LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+
+tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS)
+
+$(LIBTRACEEVENT): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -C $(src-kernel)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent
+
+$(LIBTRACEEVENT)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
+
+PHONY += $(TRACE_EVENT_DIR) $(TRACE_EVENT_DIR)-clean
+
+$(LIBLK): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/lk
+	$(Q)$(MAKE) -C $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk
+
+$(LIBLK)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/lk
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk clean
+
+tools/perf/PERF-VERSION-FILE: FORCE
+	$(QUIET_GEN)$(SHELL_PATH) $(src-perf)/util/PERF-VERSION-GEN $(obj-perf)/
+
+
+# Single targets
+# ---------------------------------------------------------------------------
+# Single targets are compatible with:
+# - build with mixed source and output
+# - build with separate output dir 'make O=...'
+# - external modules
+#
+#  target-dir => where to store outputfile
+#  build-dir  => directory in kernel source tree to use
+
+build-dir  = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(patsubst %/,%,$(dir $@))))
+target-dir = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(dir $@)))
+
+%.o: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.i: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.o: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+
+SCRIPT_SH += $(src-perf)/perf-archive.sh
+SCRIPTS    = $(patsubst %.sh,%,$(SCRIPT_SH))
+
+$(SCRIPTS) : % : %.sh
+	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(perf-obj)$@'
+
+all: $(SCRIPTS)
+
+install-bin: all
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) $(obj-perf)/perf '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) $(src-perf)/perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
+	$(INSTALL) $(src-perf)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
+	$(INSTALL) $(src-perf)/scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) $(src-perf)/scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
+	$(INSTALL) $(src-perf)/scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
+	$(INSTALL) $(src-perf)/bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) $(src-perf)/tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+	$(INSTALL) $(src-perf)/tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+
+install: install-bin try-install-man
+
+DOC_TARGETS := doc man html info pdf
+
+$(DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:doc=all)
+
+INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
+INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
+
+# 'make install-doc' should call 'make -C Documentation install'
+$(INSTALL_DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:-doc=)
+
+help:
+	@echo 'Perf make targets:'
+	@echo '  doc		- make *all* documentation (see below)'
+	@echo '  man		- make manpage documentation (access with man <foo>)'
+	@echo '  html		- make html documentation'
+	@echo '  info		- make GNU info documentation (access with info <foo>)'
+	@echo '  pdf		- make pdf documentation'
+	@echo '  TAGS		- use etags to make tag information for source browsing'
+	@echo '  tags		- use ctags to make tag information for source browsing'
+	@echo '  cscope	- use cscope to make interactive browsing database'
+	@echo ''
+	@echo 'Perf install targets:'
+	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
+	@echo '  HINT: use "make prefix=<path> <install target>" to install to a particular'
+	@echo '        path like make prefix=/usr/local install install-doc'
+	@echo '  install	- install compiled binaries'
+	@echo '  install-doc	- install *all* documentation'
+	@echo '  install-man	- install manpage documentation'
+	@echo '  install-html	- install html documentation'
+	@echo '  install-info	- install GNU info documentation'
+	@echo '  install-pdf	- install pdf documentation'
+	@echo ''
+	@echo '  quick-install-doc	- alias for quick-install-man'
+	@echo '  quick-install-man	- install the documentation quickly'
+	@echo '  quick-install-html	- install the html documentation quickly'
+	@echo ''
+	@echo 'Perf maintainer targets:'
+	@echo '  clean			- clean all binary objects and build output'
+
+
+ifdef MAKE_DEBUG
+dummy := $(info DEBUG MAKEFLAGS             $(MAKEFLAGS))
+dummy := $(info DEBUG VPATH                 $(VPATH))
+dummy := $(info DEBUG srctree               $(srctree))
+dummy := $(info DEBUG objtree               $(objtree))
+dummy := $(info DEBUG src-kernel            $(src-kernel))
+dummy := $(info DEBUG src-perf              $(src-perf))
+dummy := $(info DEBUG obj-kernel            $(obj-kernel))
+dummy := $(info DEBUG obj-perf              $(obj-perf))
+dummy := $(info DEBUG KBUILD_KCONFIG        $(KBUILD_KCONFIG))
+dummy := $(info DEBUG KBUILD_AUTOCONF       $(KBUILD_AUTOCONF))
+dummy := $(info DEBUG KCONFIG_CONFIG        $(KCONFIG_CONFIG))
+dummy := $(info DEBUG KCONFIG_TRISTATE      $(KCONFIG_TRISTATE))
+dummy := $(info DEBUG KCONFIG_AUTOHEADER    $(KCONFIG_AUTOHEADER))
+dummy := $(info DEBUG KCONFIG_AUTOCONFIG    $(KCONFIG_AUTOCONFIG))
+dummy := $(info DEBUG KCONFIG_AUTOCONFIGDEP $(KCONFIG_AUTOCONFIGDEP))
+dummy := $(info DEBUG TRACE_EVENT_DIR       $(TRACE_EVENT_DIR))
+dummy := $(info DEBUG LK_DIR                $(LK_DIR))
+endif
+
+endif  # skip-makefile
+
+PHONY += FORCE
+.PHONY: $(PHONY)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 895edd3..5c666b87 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -606,7 +606,7 @@ $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPU
 $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
 
 $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
+	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
 
 $(SCRIPTS) : % : %.sh
 	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
diff --git a/tools/perf/arch/Kbuild b/tools/perf/arch/Kbuild
new file mode 100644
index 0000000..5cf419e
--- /dev/null
+++ b/tools/perf/arch/Kbuild
@@ -0,0 +1,3 @@
+obj-y += common.o
+
+obj-y += $(CONFIG_ARCH)/
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
new file mode 100644
index 0000000..52fd6fa
--- /dev/null
+++ b/tools/perf/arch/x86/Kbuild
@@ -0,0 +1 @@
+obj-y += util/
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
new file mode 100644
index 0000000..0ba617a
--- /dev/null
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -0,0 +1,3 @@
+obj-y += dwarf-regs.o
+obj-y += header.o
+obj-$(CONFIG_LIBUNWIND) += unwind.o
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
new file mode 100644
index 0000000..8883de9
--- /dev/null
+++ b/tools/perf/bench/Kbuild
@@ -0,0 +1,9 @@
+obj-y += mem-memcpy.o
+obj-y += mem-memset.o
+obj-y += sched-messaging.o
+obj-y += sched-pipe.o
+
+obj-$(CONFIG_NUMA) += numa.o
+
+obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
+obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
index fec342a..936842d 100644
--- a/tools/perf/builtin-cmds.h
+++ b/tools/perf/builtin-cmds.h
@@ -1,6 +1,7 @@
 #ifndef BUILTIN_CMDS_H
 #define BUILTIN_CMDS_H
 
+#ifndef CONFIG_KBUILD
 #define CONFIG_BUILTIN_REPORT 1
 #define CONFIG_BUILTIN_SCRIPT 1
 #define CONFIG_BUILTIN_BENCH 1
@@ -23,5 +24,8 @@
 #define CONFIG_BUILTIN_HELP 1
 #define CONFIG_BUILTIN_PROBE 1
 #define CONFIG_BUILTIN_MEM 1
+#else
+#include <generated/autoconf.h>
+#endif /* CONFIG_KBUILD */
 
 #endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 802cf54..78ee62d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -24,6 +24,7 @@ ifeq ($(ARCH),x86)
     CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
     ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
     LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+    CONFIG_X86_64=y
   else
     LIBUNWIND_LIBS = -lunwind -lunwind-x86
   endif
@@ -78,6 +79,10 @@ ifndef NO_LIBELF
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
 endif
 
+ifdef KCONFIG_CONFIG
+include $(src-perf)/config/Makefile.fix-legacy
+endif
+
 # include ARCH specific config
 -include $(src-perf)/arch/$(ARCH)/Makefile
 
@@ -244,6 +249,7 @@ ifeq ($(DEBUG),0)
 endif
 
 CFLAGS += -I$(src-perf)/util/include
+CFLAGS += -I$(obj-perf)/include
 CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
 CFLAGS += -I$(srctree)/tools/include/
 CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
@@ -733,3 +739,42 @@ endif
 ifeq ($(display_lib),1)
   $(info )
 endif
+
+ifdef CONFIG_DETECTED
+
+store = @echo "$(1)=$($(1))" >> $(CONFIG_DETECTED)
+
+all:
+	$(call store,ARCH)
+	$(call store,CFLAGS)
+	$(call store,LDFLAGS)
+	$(call store,EXTLIBS)
+	$(call store,htmldir_SQ)
+	$(call store,infodir_SQ)
+	$(call store,mandir_SQ)
+	$(call store,perfexecdir_SQ)
+	$(call store,prefix_SQ)
+	$(call store,PARSER_DEBUG_BISON)
+	$(call store,PARSER_DEBUG_FLEX)
+	$(call store,PYTHON_EMBED_CCOPTS)
+	$(call store,PERL_EMBED_CCOPTS)
+	$(call store,CONFIG_X86_64)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_LIBPERL)
+	$(call store,NO_LIBPYTHON)
+	$(call store,NO_NEWT)
+	$(call store,NO_GTK2)
+	$(call store,NO_DEMANGLE)
+	$(call store,NO_LIBELF)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_BACKTRACE)
+	$(call store,NO_LIBNUMA)
+	$(call store,NO_LIBAUDIT)
+	$(call store,NO_LIBBIONIC)
+	$(call store,ETC_PERFCONFIG_SQ)
+	$(call store,DESTDIR_SQ)
+	$(call store,bindir_SQ)
+	$(call store,perfexec_instdir_SQ)
+	$(call store,sysconfdir_SQ)
+
+endif # CONFIG_DETECTED
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
new file mode 100644
index 0000000..7f65fdb
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-config
@@ -0,0 +1,104 @@
+include $(CONFIG_DETECTED)
+include $(KCONFIG_CONFIG)
+
+CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
+
+# NO_LIBPERL
+ifdef CONFIG_LIBPERL
+ifdef NO_LIBPERL
+dummy := $(info Disabling CONFIG_LIBPERL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
+endif
+endif
+
+# NO_LIBPYTHON
+ifdef CONFIG_LIBPYTHON
+ifdef NO_LIBPYTHON
+dummy := $(info Disabling CONFIG_LIBPYTHON)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_NEWT
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_SLANG
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_GTK2
+ifdef CONFIG_GTK2
+ifdef NO_GTK2
+dummy := $(info Disabling CONFIG_GTK2)
+dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
+endif
+endif
+
+# NO_DEMANGLE
+ifdef CONFIG_DEMANGLE
+ifdef NO_DEMANGLE
+dummy := $(info Disabling CONFIG_DEMANGLE)
+dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
+endif
+endif
+
+# NO_LIBELF
+ifdef CONFIG_LIBELF
+ifdef NO_LIBELF
+dummy := $(info Disabling CONFIG_LIBELF)
+dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
+dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
+endif
+endif
+
+# NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
+ifdef NO_LIBUNWIND
+dummy := $(info Disabling CONFIG_LIBUNWIND)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
+endif
+endif
+
+# NO_BACKTRACE
+ifdef CONFIG_BACKTRACE
+ifdef NO_BACKTRACE
+dummy := $(info Disabling CONFIG_BACKTRACE)
+dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
+endif
+endif
+
+# NO_LIBNUMA
+ifdef CONFIG_NUMA
+ifdef NO_LIBNUMA
+dummy := $(info Disabling CONFIG_NUMA)
+dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
+endif
+endif
+
+# NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
+ifdef NO_LIBAUDIT
+dummy := $(info Disabling CONFIG_LIBAUDIT)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
+endif
+endif
+
+# NO_LIBBIONIC
+ifdef CONFIG_BIONIC
+ifdef NO_LIBBIONIC
+dummy := $(info Disabling CONFIG_BIONIC)
+dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
+endif
+endif
+
+all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
new file mode 100644
index 0000000..2ec91f3
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -0,0 +1,46 @@
+
+include $(KCONFIG_CONFIG)
+
+ifndef CONFIG_LIBPERL
+NO_LIBPERL := 1
+endif
+
+ifndef CONFIG_LIBPYTHON
+NO_LIBPYTHON := 1
+endif
+
+ifndef CONFIG_TUI
+NO_SLANG := 1
+endif
+
+ifndef CONFIG_GTK2
+NO_GTK2 := 1
+endif
+
+ifndef CONFIG_DEMANGLE
+NO_DEMANGLE := 1
+endif
+
+ifndef CONFIG_LIBELF
+NO_LIBELF := 1
+endif
+
+ifndef CONFIG_LIBUNWIND
+NO_LIBUNWIND := 1
+endif
+
+ifndef CONFIG_BACKTRACE
+NO_BACKTRACE := 1
+endif
+
+ifndef CONFIG_NUMA
+export NO_LIBNUMA := 1
+endif
+
+ifndef CONFIG_LIBAUDIT
+NO_LIBAUDIT := 1
+endif
+
+ifdef CONFIG_BIONIC
+NO_LIBBIONIC := 1
+endif
diff --git a/tools/perf/config/defconfig b/tools/perf/config/defconfig
new file mode 100644
index 0000000..7a385f1
--- /dev/null
+++ b/tools/perf/config/defconfig
@@ -0,0 +1,54 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux Kernel Configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+# CONFIG_BUILTIN_ANNOTATE is not set
+# CONFIG_BUILTIN_BENCH is not set
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+# CONFIG_BUILTIN_KMEM is not set
+# CONFIG_BUILTIN_KVM is not set
+# CONFIG_BUILTIN_LIST is not set
+# CONFIG_BUILTIN_LOCK is not set
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# Libraries
+#
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_BACKTRACE=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_NUMA is not set
+# CONFIG_DEMANGLE is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+# CONFIG_GTK2 is not set
+
+#
+# Build
+#
+CONFIG_DEBUG=y
+# CONFIG_DEBUG_PARSER is not set
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..fa54dd5
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
@@ -0,0 +1,3 @@
+obj-y += Context.o
+
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS)
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..0f32b85
--- /dev/null
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
@@ -0,0 +1,4 @@
+obj-y += Context.o
+
+CFLAGS_Context.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
diff --git a/tools/perf/tests/Kbuild b/tools/perf/tests/Kbuild
new file mode 100644
index 0000000..f2998a6
--- /dev/null
+++ b/tools/perf/tests/Kbuild
@@ -0,0 +1,23 @@
+obj-y += builtin-test.o
+obj-y += attr.o
+obj-y += dso-data.o
+obj-y += evsel-roundtrip-name.o
+obj-y += evsel-tp-sched.o
+obj-y += hists_link.o
+obj-y += mmap-basic.o
+obj-y += open-syscall-all-cpus.o
+obj-y += open-syscall.o
+obj-y += open-syscall-tp-fields.o
+obj-y += parse-events.o
+obj-y += perf-record.o
+obj-y += pmu.o
+obj-y += python-use.o
+obj-y += rdpmc.o
+obj-y += vmlinux-kallsyms.o
+obj-y += bp_signal.o
+obj-y += bp_signal_overflow.o
+obj-y += sw-clock.o
+obj-y += task-exit.o
+
+CFLAGS_python-use.o += -DPYTHON='"$(PYTHON_WORD)"' -DPYTHONPATH='"python"'
+CFLAGS_attr.o += -DPYTHON='"$(PYTHON_WORD)"' -DBINDIR='"$(bindir_SQ)"'
diff --git a/tools/perf/ui/Kbuild b/tools/perf/ui/Kbuild
new file mode 100644
index 0000000..f687132
--- /dev/null
+++ b/tools/perf/ui/Kbuild
@@ -0,0 +1,14 @@
+obj-$(CONFIG_TUI) += browser.o
+obj-y += helpline.o
+obj-y += hist.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
+
+obj-y += browsers/
+obj-y += stdio/
+
+obj-$(CONFIG_TUI)  += tui/
+obj-$(CONFIG_GTK2) += gtk/
+
+CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
new file mode 100644
index 0000000..43bfcbf
--- /dev/null
+++ b/tools/perf/ui/browsers/Kbuild
@@ -0,0 +1,6 @@
+obj-$(CONFIG_TUI) += annotate.o
+obj-$(CONFIG_TUI) += hists.o
+obj-$(CONFIG_TUI) += map.o
+obj-$(CONFIG_TUI) += scripts.o
+
+CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/gtk/Kbuild b/tools/perf/ui/gtk/Kbuild
new file mode 100644
index 0000000..6964926
--- /dev/null
+++ b/tools/perf/ui/gtk/Kbuild
@@ -0,0 +1,7 @@
+obj-y += browser.o
+obj-y += hists.o
+obj-y += setup.o
+obj-y += util.o
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += annotate.o
diff --git a/tools/perf/ui/stdio/Kbuild b/tools/perf/ui/stdio/Kbuild
new file mode 100644
index 0000000..9de4bd9
--- /dev/null
+++ b/tools/perf/ui/stdio/Kbuild
@@ -0,0 +1 @@
+obj-y += hist.o
diff --git a/tools/perf/ui/tui/Kbuild b/tools/perf/ui/tui/Kbuild
new file mode 100644
index 0000000..e282409
--- /dev/null
+++ b/tools/perf/ui/tui/Kbuild
@@ -0,0 +1,4 @@
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
new file mode 100644
index 0000000..10d5376
--- /dev/null
+++ b/tools/perf/util/Kbuild
@@ -0,0 +1,113 @@
+obj-y += abspath.o
+obj-y += alias.o
+obj-y += annotate.o
+obj-y += bitmap.o
+obj-y += build-id.o
+obj-y += callchain.o
+obj-y += cgroup.o
+obj-y += color.o
+obj-y += config.o
+obj-y += cpumap.o
+obj-y += ctype.o
+obj-y += debug.o
+obj-y += dso.o
+obj-y += environment.o
+obj-y += event.o
+obj-y += evlist.o
+obj-y += evsel.o
+obj-y += exec_cmd.o
+obj-y += header.o
+obj-y += help.o
+obj-y += hist.o
+obj-y += hweight.o
+obj-y += intlist.o
+obj-y += levenshtein.o
+obj-y += machine.o
+obj-y += map.o
+obj-y += pager.o
+obj-y += parse-options.o
+obj-y += path.o
+obj-y += pmu-flex.o
+obj-y += pmu-bison.o
+obj-y += pmu.o
+obj-y += pstack.o
+obj-y += quote.o
+obj-y += rblist.o
+obj-y += run-command.o
+obj-y += session.o
+obj-y += sigchain.o
+obj-y += sort.o
+obj-y += stat.o
+obj-y += strbuf.o
+obj-y += strfilter.o
+obj-y += string.o
+obj-y += strlist.o
+obj-y += svghelper.o
+obj-y += symbol.o
+
+obj-$(CONFIG_LIBUNWIND) += unwind.o
+
+obj-$(CONFIG_LIBELF) += symbol-elf.o
+obj-$(CONFIG_LIBELF) += dwarf-aux.o
+obj-$(CONFIG_LIBELF) += probe-event.o
+obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
+
+obj-y += sysfs.o
+obj-y += target.o
+obj-y += thread.o
+obj-y += thread_map.o
+obj-y += top.o
+obj-y += usage.o
+obj-y += util.o
+obj-y += values.o
+obj-y += xyarray.o
+obj-y += vdso.o
+obj-y += wrapper.o
+obj-y += trace-event-info.o
+obj-y += trace-event-parse.o
+obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
+obj-y += trace-event-read.o
+
+obj-y += scripting-engines/
+
+define bison
+$(Q)echo '  BI      $@'
+$(Q)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) -o $@ -p $1
+endef
+
+define flex
+$(Q)echo '  FL      $@';
+$(Q)$(FLEX) --header-file=$(basename $@).h $(PARSER_DEBUG_FLEX) -t $< > $@
+endef
+
+obj-y += parse-events-flex.o
+obj-y += parse-events-bison.o
+obj-y += parse-events.o
+
+$(obj)/parse-events-bison.c: $(src)/parse-events.y
+	$(call bison,parse_events_)
+
+$(obj)/parse-events-flex.c: $(src)/parse-events.l $(obj)/parse-events-bison.c
+	$(call flex)
+
+$(src)/parse-events-flex.o: $(src)/parse-events-flex.c
+$(src)/parse-events-bison.o: $(src)/parse-events-bison.c
+
+$(src)/pmu-bison.c: $(src)/pmu.y
+	$(call bison,perf_pmu_)
+
+$(src)/pmu-flex.c: $(src)/pmu.l $(src)/pmu-bison.c
+	$(call flex)
+
+$(src)/pmu-flex.o: $(src)/pmu-flex.c
+$(src)/pmu-bison.o: $(src)/pmu-bison.c
+
+CFLAGS_parse-events-flex.o  += -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_pmu-flex.o  += -w
+CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+
+CFLAGS_config.o += -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"'
+CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH='"$(perfexecdir_SQ)"' -DPREFIX='"$(prefix_SQ)"'
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 39f1750..efb74f0 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -9,6 +9,10 @@ GVF=${OUTPUT}PERF-VERSION-FILE
 LF='
 '
 
+if [ "${srctree}x" = "x" ]; then
+srctree=../..
+fi
+
 #
 # First check if there is a .git to get the version from git describe
 # otherwise try to get the version from the kernel Makefile
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 05ee30f..5d84ffc 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -15,7 +15,7 @@ struct cmdname_help
 
 static struct cmdname_help common_cmds[] = {"
 
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -26,12 +26,12 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -42,7 +42,7 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
diff --git a/tools/perf/util/scripting-engines/Kbuild b/tools/perf/util/scripting-engines/Kbuild
new file mode 100644
index 0000000..b6360ee
--- /dev/null
+++ b/tools/perf/util/scripting-engines/Kbuild
@@ -0,0 +1,7 @@
+obj-$(CONFIG_LIBPERL)   += trace-event-perl.o
+obj-$(CONFIG_LIBPYTHON) += trace-event-python.o
+
+CFLAGS_trace-event-perl.o   := $(PERL_EMBED_CCOPTS)
+
+CFLAGS_trace-event-python.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index d0aee4b..a5c73de 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -2,6 +2,7 @@
 
 from distutils.core import setup, Extension
 from os import getenv
+from os import environ
 
 from distutils.command.build_ext   import build_ext   as _build_ext
 from distutils.command.install_lib import install_lib as _install_lib
@@ -27,8 +28,11 @@ build_tmp = getenv('PYTHON_EXTBUILD_TMP')
 libtraceevent = getenv('LIBTRACEEVENT')
 libapikfs = getenv('LIBAPIKFS')
 
-ext_sources = [f.strip() for f in file('util/python-ext-sources')
-				if len(f.strip()) > 0 and f[0] != '#']
+if environ.has_key('PYTHON_EXT_SRCS'):
+    ext_sources = getenv('PYTHON_EXT_SRCS').split()
+else:
+    ext_sources = [f.strip() for f in file('util/python-ext-sources')
+                                   if len(f.strip()) > 0 and f[0] != '#']
 
 perf = Extension('perf',
 		  sources = ext_sources,
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 06/34] perf kbuild: fix recursive invocation of config/features-checks
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (4 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 05/34] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 07/34] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
                   ` (29 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Makefile.kbuild | 2 +-
 tools/perf/config/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 41beb83..8be891d 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -90,7 +90,7 @@ VPATH += $(src-perf)
 
 export src-perf obj-perf
 
-OUTPUT := $(obj-perf)
+OUTPUT := $(obj-perf)/
 
 export OUTPUT
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 78ee62d..1760f57 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -135,7 +135,7 @@ endif
 
 feature_check = $(eval $(feature_check_code))
 define feature_check_code
-  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
+  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(src-perf)/config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
 endef
 
 feature_set = $(eval $(feature_set_code))
@@ -234,7 +234,7 @@ ifeq ($(feature-all), 1)
   #
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
 else
-  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
+  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C $(src-perf)/config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
 endif
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 07/34] perf kbuild: store in config-detected missing variables (libdir, ...)
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (5 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 06/34] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 08/34] perf kbuild: remove useless #ifdef directives Alexis Berlemont
                   ` (28 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Makefile.kbuild | 5 ++++-
 tools/perf/config/Makefile | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 8be891d..93a1a78 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -214,8 +214,11 @@ export prefix_SQ
 export PARSER_DEBUG_BISON
 export PARSER_DEBUG_FLEX
 export ETC_PERFCONFIG_SQ
+export libdir_SQ
 export PYTHON_EMBED_CCOPTS
 export PERL_EMBED_CCOPTS
+export GTK_CFLAGS
+
 endif
 
 # let sources know it's kbuild
@@ -264,7 +267,7 @@ $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
 LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
-	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS) $(GTK_LIBS)
 
 $(LIBTRACEEVENT): FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 1760f57..e10e8bf 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -774,7 +774,10 @@ all:
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
+	$(call store,libdir_SQ)
 	$(call store,perfexec_instdir_SQ)
 	$(call store,sysconfdir_SQ)
+	$(call store,GTK_CFLAGS)
+	$(call store,GTK_LIBS)
 
 endif # CONFIG_DETECTED
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 08/34] perf kbuild: remove useless #ifdef directives
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (6 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 07/34] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 09/34] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
                   ` (27 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/ui/setup.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 66ecd08..cb69740 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -71,20 +71,16 @@ void setup_browser(bool fallback_to_pager)
 
 	switch (use_browser) {
 	case 2:
-#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		if (setup_gtk_browser() == 0)
 			break;
 		printf("GTK browser requested but could not find %s\n",
 		       PERF_GTK_DSO);
 		sleep(1);
-#endif
 		/* fall through */
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
-#endif
 		/* fall through */
 	default:
 		use_browser = 0;
@@ -100,16 +96,12 @@ void exit_browser(bool wait_for_ok __maybe_unused)
 {
 	switch (use_browser) {
 	case 2:
-#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		exit_gtk_browser(wait_for_ok);
 		break;
-#endif
 
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-#endif
 
 	default:
 		break;
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 09/34] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (7 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 08/34] perf kbuild: remove useless #ifdef directives Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 10/34] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
                   ` (26 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/perf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 74a1269..588221c 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -95,7 +95,7 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_TEST
 	{ "test",	cmd_test,	0 },
 #endif
-#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
+#ifdef CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_INJECT
@@ -524,7 +524,7 @@ int main(int argc, const char **argv)
 		fprintf(stderr, "cannot handle %s internally", cmd);
 		goto out;
 	}
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#ifdef CONFIG_BUILTIN_TRACE
 	if (!prefixcmp(cmd, "trace")) {
 		set_buildid_dir();
 		setup_path();
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 10/34] perf kbuild: add missing files and missing flags in Kbuild files
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (8 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 09/34] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 11/34] perf kbuild: update kbuild files according to last changes Alexis Berlemont
                   ` (25 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/arch/x86/util/Kbuild                  |  1 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild |  3 ++-
 tools/perf/tests/Kbuild                          | 15 +++++++++++++--
 tools/perf/ui/Kbuild                             |  1 +
 tools/perf/ui/browsers/Kbuild                    |  2 ++
 tools/perf/ui/gtk/Kbuild                         |  2 ++
 tools/perf/util/Kbuild                           | 12 +++++++++---
 tools/perf/util/scripting-engines/Kbuild         |  6 +++++-
 8 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
index 0ba617a..e033b94 100644
--- a/tools/perf/arch/x86/util/Kbuild
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -1,3 +1,4 @@
 obj-y += dwarf-regs.o
 obj-y += header.o
+obj-y += tsc.o
 obj-$(CONFIG_LIBUNWIND) += unwind.o
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
index 0f32b85..c31ca7c 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
@@ -1,4 +1,5 @@
 obj-y += Context.o
 
 CFLAGS_Context.o := $(PYTHON_EMBED_CCOPTS)
-CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes 
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs
diff --git a/tools/perf/tests/Kbuild b/tools/perf/tests/Kbuild
index f2998a6..b4e7682 100644
--- a/tools/perf/tests/Kbuild
+++ b/tools/perf/tests/Kbuild
@@ -18,6 +18,17 @@ obj-y += bp_signal.o
 obj-y += bp_signal_overflow.o
 obj-y += sw-clock.o
 obj-y += task-exit.o
+obj-y += code-reading.o
+obj-y += sample-parsing.o
+obj-y += keep-tracking.o
+obj-y += parse-no-sample-id-all.o
 
-CFLAGS_python-use.o += -DPYTHON='"$(PYTHON_WORD)"' -DPYTHONPATH='"python"'
-CFLAGS_attr.o += -DPYTHON='"$(PYTHON_WORD)"' -DBINDIR='"$(bindir_SQ)"'
+
+# TODO: this should only be included if arch = x86
+obj-y += perf-time-to-tsc.o
+
+CFLAGS_python-use.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_python-use.o += -D"PYTHONPATH=KBUILD_STR(python)"
+
+CFLAGS_attr.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_attr.o += -D"BINDIR=KBUILD_STR($(bindir_SQ))"
diff --git a/tools/perf/ui/Kbuild b/tools/perf/ui/Kbuild
index f687132..44ad988 100644
--- a/tools/perf/ui/Kbuild
+++ b/tools/perf/ui/Kbuild
@@ -12,3 +12,4 @@ obj-$(CONFIG_TUI)  += tui/
 obj-$(CONFIG_GTK2) += gtk/
 
 CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_setup.o += -D"LIBDIR=KBUILD_STR($(libdir_SQ))"
\ No newline at end of file
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
index 43bfcbf..03938aa 100644
--- a/tools/perf/ui/browsers/Kbuild
+++ b/tools/perf/ui/browsers/Kbuild
@@ -4,3 +4,5 @@ obj-$(CONFIG_TUI) += map.o
 obj-$(CONFIG_TUI) += scripts.o
 
 CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_map.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_scripts.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/gtk/Kbuild b/tools/perf/ui/gtk/Kbuild
index 6964926..83e3e58 100644
--- a/tools/perf/ui/gtk/Kbuild
+++ b/tools/perf/ui/gtk/Kbuild
@@ -5,3 +5,5 @@ obj-y += util.o
 obj-y += helpline.o
 obj-y += progress.o
 obj-y += annotate.o
+
+subdir-ccflags-y := $(GTK_CFLAGS)
\ No newline at end of file
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 10d5376..6fb42a6 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -6,6 +6,7 @@ obj-y += build-id.o
 obj-y += callchain.o
 obj-y += cgroup.o
 obj-y += color.o
+obj-y += comm.o
 obj-y += config.o
 obj-y += cpumap.o
 obj-y += ctype.o
@@ -38,6 +39,9 @@ obj-y += session.o
 obj-y += sigchain.o
 obj-y += sort.o
 obj-y += stat.o
+obj-y += record.o
+obj-y += srcline.o
+obj-y += data.o
 obj-y += strbuf.o
 obj-y += strfilter.o
 obj-y += string.o
@@ -54,7 +58,7 @@ obj-$(CONFIG_LIBELF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
-obj-y += sysfs.o
+obj-y += fs.o
 obj-y += target.o
 obj-y += thread.o
 obj-y += thread_map.o
@@ -106,8 +110,10 @@ $(src)/pmu-bison.o: $(src)/pmu-bison.c
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events.o  += -Wno-redundant-decls
 CFLAGS_pmu-flex.o  += -w
 CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
-CFLAGS_config.o += -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"'
-CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH='"$(perfexecdir_SQ)"' -DPREFIX='"$(prefix_SQ)"'
+CFLAGS_config.o += -D"ETC_PERFCONFIG=KBUILD_STR($(ETC_PERFCONFIG_SQ))"
+CFLAGS_exec_cmd.o += -D"PERF_EXEC_PATH=KBUILD_STR($(perfexecdir_SQ))"
+CFLAGS_exec_cmd.o += -D"PREFIX=KBUILD_STR($(prefix_SQ))"
diff --git a/tools/perf/util/scripting-engines/Kbuild b/tools/perf/util/scripting-engines/Kbuild
index b6360ee..9898d27 100644
--- a/tools/perf/util/scripting-engines/Kbuild
+++ b/tools/perf/util/scripting-engines/Kbuild
@@ -2,6 +2,10 @@ obj-$(CONFIG_LIBPERL)   += trace-event-perl.o
 obj-$(CONFIG_LIBPYTHON) += trace-event-python.o
 
 CFLAGS_trace-event-perl.o   := $(PERL_EMBED_CCOPTS)
+CFLAGS_trace-event-perl.o   += -Wno-redundant-decls -Wno-strict-prototypes 
+CFLAGS_trace-event-perl.o   += -Wno-unused-parameter -Wno-shadow -Wno-undef 
+CFLAGS_trace-event-perl.o   += -Wno-switch-default
 
 CFLAGS_trace-event-python.o := $(PYTHON_EMBED_CCOPTS)
-CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
+CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes 
+CFLAGS_trace-event-python.o += -Wno-unused-parameter -Wno-shadow
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 11/34] perf kbuild: update kbuild files according to last changes
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (9 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 10/34] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 12/34] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
                   ` (24 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Kbuild             |  2 +-
 tools/perf/Makefile.kbuild    | 30 +++++++++++++-----------------
 tools/perf/ui/browsers/Kbuild |  1 +
 tools/perf/util/Kbuild        |  1 +
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/tools/perf/Kbuild b/tools/perf/Kbuild
index 80b9184..16cb804 100644
--- a/tools/perf/Kbuild
+++ b/tools/perf/Kbuild
@@ -26,6 +26,7 @@ obj-$(CONFIG_BUILTIN_MEM)           += builtin-mem.o
 obj-$(CONFIG_BUILTIN_TEST)          += tests/
 
 obj-y += ../../lib/rbtree.o
+obj-y += ../lib/symbol/kallsyms.o
 
 obj-y += util/
 obj-y += ui/
@@ -34,7 +35,6 @@ obj-y += arch/
 obj-$(CONFIG_LIBPERL)   += scripts/perl/Perf-Trace-Util/
 obj-$(CONFIG_LIBPYTHON) += scripts/python/Perf-Trace-Util/
 
-
 CFLAGS_rbtree.o += -Wno-unused-parameter
 
 CFLAGS_perf.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 93a1a78..a759cd7 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -102,8 +102,9 @@ HOSTCC  = gcc
 FLEX    = flex
 BISON   = bison
 INSTALL = install
+PKG_CONFIG = pkg-config
 
-export AS LD CC CPP HOSTCC FLEX BISON
+export AS LD CC CPP HOSTCC FLEX BISON PKG_CONFIG
 
 # kbuild related config
 CONFIG_SHELL          := /bin/sh
@@ -128,14 +129,11 @@ CONFIG_DETECTED := $(obj-perf)/.config-detected
 export CONFIG_DETECTED
 
 # external .a libs
-LK_DIR          := $(srctree)/tools/lib/lk/
-TRACE_EVENT_DIR := $(srctree)/tools/lib/traceevent/
-
 LIBTRACEEVENT   := $(obj-kernel)/tools/lib/traceevent/libtraceevent.a
-LIBLK           := $(obj-kernel)/tools/lib/lk/liblk.a
-LIBS_A          := $(LIBTRACEEVENT) $(LIBLK)
+LIBAPIKFS       := $(obj-kernel)/tools/lib/api/libapikfs.a
+LIBS_A          := $(LIBTRACEEVENT) $(LIBAPIKFS)
 
-export TRACE_EVENT_DIR LK_DIR LIBTRACEEVENT LIBLK
+export LIBTRACEEVENT LIBAPIKFS
 
 all:
 
@@ -170,7 +168,7 @@ clean-dirs := $(addprefix _clean_, tools/perf/)
 $(clean-dirs):
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
 
-clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBLK)-clean
+clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean
 	$(Q)$(QUIET_CLEAN)
 	$(Q)rm -f $(obj-perf)/perf
 	$(Q)rm -f $(obj-perf)/common-cmds.h
@@ -277,15 +275,13 @@ $(LIBTRACEEVENT)-clean: FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
 	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
 
-PHONY += $(TRACE_EVENT_DIR) $(TRACE_EVENT_DIR)-clean
-
-$(LIBLK): FORCE
-	@mkdir -p $(obj-kernel)/tools/lib/lk
-	$(Q)$(MAKE) -C $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk
+$(LIBAPIKFS): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -C $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api
 
-$(LIBLK)-clean: FORCE
-	@mkdir -p $(obj-kernel)/tools/lib/lk
-	$(Q)$(MAKE) -sC $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk clean
+$(LIBAPIKFS)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api clean
 
 tools/perf/PERF-VERSION-FILE: FORCE
 	$(QUIET_GEN)$(SHELL_PATH) $(src-perf)/util/PERF-VERSION-GEN $(obj-perf)/
@@ -405,7 +401,7 @@ dummy := $(info DEBUG KCONFIG_AUTOHEADER    $(KCONFIG_AUTOHEADER))
 dummy := $(info DEBUG KCONFIG_AUTOCONFIG    $(KCONFIG_AUTOCONFIG))
 dummy := $(info DEBUG KCONFIG_AUTOCONFIGDEP $(KCONFIG_AUTOCONFIGDEP))
 dummy := $(info DEBUG TRACE_EVENT_DIR       $(TRACE_EVENT_DIR))
-dummy := $(info DEBUG LK_DIR                $(LK_DIR))
+dummy := $(info DEBUG LIBAPIKFS             $(LIBAPIKFS))
 endif
 
 endif  # skip-makefile
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
index 03938aa..3a5fd55 100644
--- a/tools/perf/ui/browsers/Kbuild
+++ b/tools/perf/ui/browsers/Kbuild
@@ -1,4 +1,5 @@
 obj-$(CONFIG_TUI) += annotate.o
+obj-$(CONFIG_TUI) += header.o
 obj-$(CONFIG_TUI) += hists.o
 obj-$(CONFIG_TUI) += map.o
 obj-$(CONFIG_TUI) += scripts.o
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 6fb42a6..4d0b6da 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -69,6 +69,7 @@ obj-y += values.o
 obj-y += xyarray.o
 obj-y += vdso.o
 obj-y += wrapper.o
+obj-y += trace-event.o
 obj-y += trace-event-info.o
 obj-y += trace-event-parse.o
 obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 12/34] perf kbuild: remove legacy slang-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (10 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 11/34] perf kbuild: update kbuild files according to last changes Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 13/34] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
                   ` (23 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_SLANG (replaced by CONFIG_LIBSLANG)
Remove HAVE_SLANG_SUPPORT from CFLAGS (replaced by CONFIG_LIBSLANG)
---
 tools/perf/Kconfig                    | 11 +++++++++--
 tools/perf/Makefile.kbuild            |  3 ++-
 tools/perf/config/Makefile            | 12 +++---------
 tools/perf/config/Makefile.fix-config | 16 ----------------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 tools/perf/ui/ui.h                    |  4 +++-
 tools/perf/util/annotate.h            |  4 +++-
 tools/perf/util/hist.h                |  4 +++-
 8 files changed, 23 insertions(+), 35 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 5f3a6b7..c91785a 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -30,7 +30,7 @@ config BUILTIN_TOP
 config BUILTIN_TRACE
 	bool "trace"
 	default n
-	depends on CONFIG_LIBAUDIT
+	depends on LIBAUDIT
         ---help---
 	  trace
 
@@ -147,6 +147,12 @@ endmenu
 
 menu "Libraries"
 
+config LIBSLANG
+	bool "Slang (libslang)"
+	default n
+        ---help---
+	  libslang
+
 config LIBAUDIT
 	bool "Audit (libaudit)"
 	default n
@@ -221,7 +227,8 @@ config STDIO
 	  stdio
 
 config TUI
-	bool "Tui (newt based)"
+	bool "Tui (slang based)"
+	depends on LIBSLANG
 	default n
         ---help---
 	  stdio
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index a759cd7..7d625ae 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -117,11 +117,12 @@ KCONFIG_TRISTATE      := $(obj-perf)/include/config/tristate.conf
 KCONFIG_AUTOHEADER    := $(obj-perf)/include/generated/autoconf.h
 KCONFIG_AUTOCONFIG    := $(KBUILD_AUTOCONF)
 KCONFIG_AUTOCONFIGDEP := $(KBUILD_AUTOCONF).cmd
+KCONFIG_SCRIPT        := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
 export CONFIG_SHELL
 export KBUILD_KCONFIG KBUILD_AUTOCONF
 export KCONFIG_CONFIG KCONFIG_TRISTATE KCONFIG_AUTOHEADER
-export KCONFIG_AUTOCONFIG KCONFIG_AUTOCONFIGDEP
+export KCONFIG_AUTOCONFIG KCONFIG_AUTOCONFIGDEP KCONFIG_SCRIPT
 
 # perf detected config
 CONFIG_DETECTED := $(obj-perf)/.config-detected
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index e10e8bf..fa07862 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -402,18 +402,13 @@ ifndef NO_LIBAUDIT
   endif
 endif
 
-ifdef NO_NEWT
-  NO_SLANG=1
-endif
-
-ifndef NO_SLANG
+ifdef CONFIG_LIBSLANG
   ifneq ($(feature-libslang), 1)
-    msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
-    NO_SLANG := 1
+    msg := $(warning slang not found, disables SLANG and TUI supports. Please install slang-devel or libslang-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBSLANG)
   else
     # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
     CFLAGS += -I/usr/include/slang
-    CFLAGS += -DHAVE_SLANG_SUPPORT
     EXTLIBS += -lslang
   endif
 endif
@@ -762,7 +757,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_NEWT)
 	$(call store,NO_GTK2)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 7f65fdb..a8e5539 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,22 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_NEWT
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_SLANG
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
 # NO_GTK2
 ifdef CONFIG_GTK2
 ifdef NO_GTK2
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 2ec91f3..18acc92 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_TUI
-NO_SLANG := 1
-endif
-
 ifndef CONFIG_GTK2
 NO_GTK2 := 1
 endif
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index ab88383..bba3a0e 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -5,6 +5,8 @@
 #include <stdbool.h>
 #include <linux/compiler.h>
 
+#include "generated/autoconf.h"
+
 extern pthread_mutex_t ui__lock;
 extern void *perf_gtk_handle;
 
@@ -13,7 +15,7 @@ extern int use_browser;
 void setup_browser(bool fallback_to_pager);
 void exit_browser(bool wait_for_ok);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int ui__init(void);
 void ui__exit(bool wait_for_ok);
 #else
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 56ad4f5..50aff7c 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -11,6 +11,8 @@
 #include <linux/rbtree.h>
 #include <pthread.h>
 
+#include "generated/autoconf.h"
+
 struct ins;
 
 struct ins_operands {
@@ -157,7 +159,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel, bool print_lines,
 			 bool full_paths, int min_pcnt, int max_lines);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int symbol__tui_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel,
 			 struct hist_browser_timer *hbt);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 1f1f513..0daa3a5 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -8,6 +8,8 @@
 #include "color.h"
 #include "ui/progress.h"
 
+#include "generated/autoconf.h"
+
 extern struct callchain_param callchain_param;
 
 struct hist_entry;
@@ -211,7 +213,7 @@ struct hist_browser_timer {
 	int refresh;
 };
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 #include "../ui/keysyms.h"
 int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
 			     struct hist_browser_timer *hbt);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 13/34] perf kbuild: remove legacy libaudit-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (11 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 12/34] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 14/34] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
                   ` (22 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_LIBAUDIT (replaced by CONFIG_LIBAUDIT)
Remove HAVE_LIBAUDIT_SUPPORT from CFLAGS (replaced by CONFIG_LIBAUDIT)
---
 tools/perf/config/Makefile            | 8 +++-----
 tools/perf/config/Makefile.fix-config | 8 --------
 tools/perf/config/Makefile.fix-legacy | 4 ----
 3 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index fa07862..96bb232 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -392,12 +392,11 @@ ifndef NO_LIBUNWIND
   LDFLAGS += $(LIBUNWIND_LDFLAGS)
 endif
 
-ifndef NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
-    msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
-    NO_LIBAUDIT := 1
+    msg := $(warning No libaudit.h found, disables LIBAUDIT support and 'trace' tool, please install audit-libs-devel or libaudit-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBAUDIT)
   else
-    CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
     EXTLIBS += -laudit
   endif
 endif
@@ -763,7 +762,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_BACKTRACE)
 	$(call store,NO_LIBNUMA)
-	$(call store,NO_LIBAUDIT)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index a8e5539..77f9840 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -69,14 +69,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
 endif
 endif
 
-# NO_LIBAUDIT
-ifdef CONFIG_LIBAUDIT
-ifdef NO_LIBAUDIT
-dummy := $(info Disabling CONFIG_LIBAUDIT)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
-endif
-endif
-
 # NO_LIBBIONIC
 ifdef CONFIG_BIONIC
 ifdef NO_LIBBIONIC
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 18acc92..ab72582 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -33,10 +33,6 @@ ifndef CONFIG_NUMA
 export NO_LIBNUMA := 1
 endif
 
-ifndef CONFIG_LIBAUDIT
-NO_LIBAUDIT := 1
-endif
-
 ifdef CONFIG_BIONIC
 NO_LIBBIONIC := 1
 endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 14/34] perf kbuild: remove legacy libgtk2-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (12 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 13/34] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 15/34] perf kbuild: remove legacy libperl-related " Alexis Berlemont
                   ` (21 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_GTK2 (replaced by CONFIG_LIBGTK2 or CONFIG_GTK2)
Remove HAVE_GTK2_SUPPORT from CFLAGS (replaced by CONFIG_LIBGTK2)
Remove HAVE_GTK_INFO_BAR_SUPPORT from CFLAGS (replaced by
CONFIG_LIBGTK2_INFOBAR)
---
 tools/perf/Kconfig                    | 13 +++++++++++++
 tools/perf/config/Makefile            |  8 +++-----
 tools/perf/config/Makefile.fix-config |  8 --------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 tools/perf/ui/gtk/browser.c           |  4 +++-
 tools/perf/ui/gtk/gtk.h               |  5 +++--
 tools/perf/ui/gtk/util.c              |  6 ++++--
 tools/perf/ui/setup.c                 |  6 ++++--
 8 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index c91785a..56f0fe3 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -159,6 +159,19 @@ config LIBAUDIT
         ---help---
 	  libaudit
 
+config LIBGTK2
+	bool "Gtk2 (libgtk2)"
+	default n
+        ---help---
+	  libgtk2
+
+config LIBGTK2_INFOBAR
+	bool "Gtk2 infobar (libgtk2)"
+	depends on LIBGTK2
+	default n
+        ---help---
+	  libgtk2-infobar
+
 config LIBPERL
 	bool "Perl"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 96bb232..040cdcc 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -412,16 +412,15 @@ ifdef CONFIG_LIBSLANG
   endif
 endif
 
-ifndef NO_GTK2
+ifdef CONFIG_LIBGTK2
   FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
   ifneq ($(feature-gtk2), 1)
     msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
-    NO_GTK2 := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2)
   else
     ifeq ($(feature-gtk2-infobar), 1)
-      GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2_INFOBAR)
     endif
-    CFLAGS += -DHAVE_GTK2_SUPPORT
     GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
     GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
     EXTLIBS += -ldl
@@ -756,7 +755,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_GTK2)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 77f9840..efe2ee7 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,14 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_GTK2
-ifdef CONFIG_GTK2
-ifdef NO_GTK2
-dummy := $(info Disabling CONFIG_GTK2)
-dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
-endif
-endif
-
 # NO_DEMANGLE
 ifdef CONFIG_DEMANGLE
 ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ab72582..ae69a1b 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_GTK2
-NO_GTK2 := 1
-endif
-
 ifndef CONFIG_DEMANGLE
 NO_DEMANGLE := 1
 endif
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c
index c24d912..f4df6a6 100644
--- a/tools/perf/ui/gtk/browser.c
+++ b/tools/perf/ui/gtk/browser.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../evlist.h"
 #include "../cache.h"
 #include "../evsel.h"
@@ -43,7 +45,7 @@ const char *perf_gtk__get_percent_color(double percent)
 	return NULL;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void)
 {
 	GtkWidget *info_bar;
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index 0a9173f..3762980 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -7,12 +7,13 @@
 #include <gtk/gtk.h>
 #pragma GCC diagnostic error "-Wstrict-prototypes"
 
+#include "generated/autoconf.h"
 
 struct perf_gtk_context {
 	GtkWidget *main_window;
 	GtkWidget *notebook;
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	GtkWidget *info_bar;
 	GtkWidget *message_label;
 #endif
@@ -42,7 +43,7 @@ void perf_gtk__resize_window(GtkWidget *window);
 const char *perf_gtk__get_percent_color(double percent);
 GtkWidget *perf_gtk__setup_statusbar(void);
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void);
 #else
 static inline GtkWidget *perf_gtk__setup_info_bar(void)
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index 52e7fc4..dde1615 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../util.h"
 #include "../../util/debug.h"
 #include "gtk.h"
@@ -52,7 +54,7 @@ static int perf_gtk__error(const char *format, va_list args)
 	return 0;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 static int perf_gtk__warning_info_bar(const char *format, va_list args)
 {
 	char *msg;
@@ -104,7 +106,7 @@ static int perf_gtk__warning_statusbar(const char *format, va_list args)
 
 struct perf_error_ops perf_gtk_eops = {
 	.error		= perf_gtk__error,
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	.warning	= perf_gtk__warning_info_bar,
 #else
 	.warning	= perf_gtk__warning_statusbar,
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index cb69740..b21e02a 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -1,6 +1,8 @@
 #include <pthread.h>
 #include <dlfcn.h>
 
+#include "generated/autoconf.h"
+
 #include "../util/cache.h"
 #include "../util/debug.h"
 #include "../util/hist.h"
@@ -8,7 +10,7 @@
 pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
 void *perf_gtk_handle;
 
-#ifdef HAVE_GTK2_SUPPORT
+#ifdef CONFIG_GTK2
 static int setup_gtk_browser(void)
 {
 	int (*perf_ui_init)(void);
@@ -55,7 +57,7 @@ out_close:
 
 	perf_gtk_handle = NULL;
 }
-#else
+#else 
 static inline int setup_gtk_browser(void) { return -1; }
 static inline void exit_gtk_browser(bool wait_for_ok __maybe_unused) {}
 #endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 15/34] perf kbuild: remove legacy libperl-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (13 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 14/34] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 16/34] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
                   ` (20 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_LIBPERL (replaced by CONFIG_LIBPERL)
---
 tools/perf/builtin-script.c             |  4 +++-
 tools/perf/config/Makefile              |  8 ++------
 tools/perf/config/Makefile.fix-config   |  8 --------
 tools/perf/config/Makefile.fix-legacy   |  4 ----
 tools/perf/util/trace-event-scripting.c | 10 +++++-----
 5 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9e9c91f..ff67f0d 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "builtin.h"
 
 #include "perf.h"
@@ -1362,7 +1364,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
 			 lang_dirent.d_name);
-#ifdef NO_LIBPERL
+#ifndef CONFIG_LIBPERL
 		if (strstr(lang_path, "perl"))
 			continue;
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 040cdcc..93c3321 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -430,9 +430,7 @@ endif
 grep-libs  = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
-ifdef NO_LIBPERL
-  CFLAGS += -DNO_LIBPERL
-else
+ifdef CONFIG_LIBPERL
   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
@@ -440,8 +438,7 @@ else
   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
 
   ifneq ($(feature-libperl), 1)
-    CFLAGS += -DNO_LIBPERL
-    NO_LIBPERL := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPERL)
   else
     LDFLAGS += $(PERL_EMBED_LDFLAGS)
     EXTLIBS += $(PERL_EMBED_LIBADD)
@@ -753,7 +750,6 @@ all:
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index efe2ee7..6402a47 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,14 +3,6 @@ include $(KCONFIG_CONFIG)
 
 CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
-# NO_LIBPERL
-ifdef CONFIG_LIBPERL
-ifdef NO_LIBPERL
-dummy := $(info Disabling CONFIG_LIBPERL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
-endif
-endif
-
 # NO_LIBPYTHON
 ifdef CONFIG_LIBPYTHON
 ifdef NO_LIBPYTHON
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ae69a1b..2e93006 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,10 +1,6 @@
 
 include $(KCONFIG_CONFIG)
 
-ifndef CONFIG_LIBPERL
-NO_LIBPERL := 1
-endif
-
 ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 57aaccc..51d8019 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -156,16 +156,16 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPERL
+#ifdef CONFIG_LIBPERL
+extern struct scripting_ops perl_scripting_ops;
+
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_unsupported_ops);
+	register_perl_scripting(&perl_scripting_ops);
 }
 #else
-extern struct scripting_ops perl_scripting_ops;
-
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_ops);
+	register_perl_scripting(&perl_scripting_unsupported_ops);
 }
 #endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 16/34] perf kbuild: remove legacy timerfd-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (14 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 15/34] perf kbuild: remove legacy libperl-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 17/34] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
                   ` (19 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove HAVE_TIMERFD_SUPPORT (replaced by CONFIG_TIMERFD)
---
 tools/perf/Kconfig         |  8 +++++++-
 tools/perf/builtin-kvm.c   | 13 +++++++------
 tools/perf/config/Makefile | 10 ++++++----
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 56f0fe3..76d0763 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -145,7 +145,7 @@ config BUILTIN_TEST
 
 endmenu
 
-menu "Libraries"
+menu "Libraries / Dependencies"
 
 config LIBSLANG
 	bool "Slang (libslang)"
@@ -184,6 +184,12 @@ config LIBPYTHON
         ---help---
 	  Python
 
+config TIMERFD
+	bool "Timer via file descriptor"
+	default n
+        ---help---
+	  Timer via file descriptor
+
 choice
 	prompt "Elf library"
 	default LIBELF
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0f1e5a2..d035253 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "perf.h"
 
@@ -20,7 +21,7 @@
 #include "util/data.h"
 
 #include <sys/prctl.h>
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
 #endif
 
@@ -339,7 +340,7 @@ static void init_kvm_event_record(struct perf_kvm_stat *kvm)
 		INIT_LIST_HEAD(&kvm->kvm_events_cache[i]);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static void clear_events_cache_stats(struct list_head *kvm_events_cache)
 {
 	struct list_head *head;
@@ -788,7 +789,7 @@ static void print_result(struct perf_kvm_stat *kvm)
 		pr_info("\nLost events: %" PRIu64 "\n\n", kvm->lost_events);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static int process_lost_event(struct perf_tool *tool,
 			      union perf_event *event __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
@@ -879,7 +880,7 @@ static bool verify_vcpu(int vcpu)
 	return true;
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 /* keeping the max events to a modest level to keep
  * the processing of samples per mmap smooth.
  */
@@ -1386,7 +1387,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 	return kvm_events_report_vcpu(kvm);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static struct perf_evlist *kvm_live_event_list(void)
 {
 	struct perf_evlist *evlist;
@@ -1601,7 +1602,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)
 	if (!strncmp(argv[1], "rep", 3))
 		return kvm_events_report(&kvm, argc - 1 , argv + 1);
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 	if (!strncmp(argv[1], "live", 4))
 		return kvm_events_live(&kvm, argc - 1 , argv + 1);
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 93c3321..33843b7 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -445,10 +445,12 @@ ifdef CONFIG_LIBPERL
   endif
 endif
 
-ifeq ($(feature-timerfd), 1)
-  CFLAGS += -DHAVE_TIMERFD_SUPPORT
-else
-  msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+ifdef CONFIG_TIMERFD
+  ifneq ($(feature-timerfd), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_TIMERFD)
+  else
+    msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+  endif
 endif
 
 disable-python = $(eval $(disable-python_code))
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 17/34] perf kbuild: remove legacy demangle-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (15 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 16/34] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 18/34] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
                   ` (18 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_DEMANGLE (replaced by CONFIG_DEMANGLE)
Remove HAVE_LIBBFD_SUPPORT (replaced by CONFIG_LIBBFD)
Remove HAVE_CPLUS_DEMANGLE_SUPPORT (replaced by CONFIG_LIBIBERTY_ONLY)
---
 tools/perf/Kconfig         | 28 ++++++++++++++++++++++------
 tools/perf/config/Makefile | 45 ++++++++++++++++++++++++---------------------
 tools/perf/util/srcline.c  |  8 +++++---
 tools/perf/util/symbol.h   | 25 +++++++++++++++++--------
 4 files changed, 68 insertions(+), 38 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 76d0763..ffc1d81 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -190,6 +190,28 @@ config TIMERFD
         ---help---
 	  Timer via file descriptor
 
+config DEMANGLE
+	bool "Demangle symbols"
+	default n
+        ---help---
+	  demangle
+
+choice DEMANGLE_DEPS
+       prompt "Demangle dependency(ies)"
+       depends on DEMANGLE
+       default LIBBFD
+
+config LIBBFD
+	bool "BFD + libiberty libraries"
+        ---help---
+	  Binary File Descriptor and libiberty libraries
+
+config LIBIBERTY_ONLY
+	bool "Libiberty only"
+        ---help---
+	  Libiberty
+endchoice
+
 choice
 	prompt "Elf library"
 	default LIBELF
@@ -223,12 +245,6 @@ config NUMA
         ---help---
 	  numa
 
-config DEMANGLE
-	bool "Demangle symbols"
-	default n
-        ---help---
-	  demangle
-
 config BIONIC
 	bool "Bionic support"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 33843b7..ff7f01c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -534,33 +534,36 @@ ifeq ($(feature-libbfd), 1)
   endif
 endif
 
-ifdef NO_DEMANGLE
-  CFLAGS += -DNO_DEMANGLE
-else
-  ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
-    EXTLIBS += -liberty
-    CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-  else
-    ifneq ($(feature-libbfd), 1)
-      ifneq ($(feature-liberty), 1)
-        ifneq ($(feature-liberty-z), 1)
-          # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
-          # or any of 'bfd iberty z' trinity
-          ifeq ($(feature-cplus-demangle), 1)
-            EXTLIBS += -liberty
-            CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-          else
-            msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
-            CFLAGS += -DNO_DEMANGLE
-          endif
+ifdef CONFIG_LIBBFD
+  ifneq ($(feature-libbfd), 1)
+    # TODO: there might be an issue here: feature-liberty and
+    # feature-liberty-z cannot be set; they can be set only if
+    # feature-libbfd is set
+    ifneq ($(feature-liberty), 1)
+      ifneq ($(feature-liberty-z), 1)
+        # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
+        # or any of 'bfd iberty z' trinity
+        ifeq ($(feature-cplus-demangle), 1)
+          EXTLIBS += -liberty
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBBFD)
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBIBERTY_ONLY)
+        else
+          msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
         endif
       endif
     endif
   endif
 endif
 
-ifneq ($(filter -lbfd,$(EXTLIBS)),)
-  CFLAGS += -DHAVE_LIBBFD_SUPPORT
+ifdef CONFIG_LIBIBERTY_ONLY
+  $(call feature_check,cplus-demangle)
+  ifeq ($(feature-cplus-demangle), 1)
+    EXTLIBS += -liberty
+  else
+    msg := $(warning No libiberty found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
+  endif
 endif
 
 ifndef NO_ON_EXIT
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index f3e4bc5..38df8f4 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -4,11 +4,13 @@
 
 #include <linux/kernel.h>
 
+#include "generated/autoconf.h"
+
 #include "util/dso.h"
 #include "util/util.h"
 #include "util/debug.h"
 
-#ifdef HAVE_LIBBFD_SUPPORT
+#ifdef CONFIG_LIBBFD
 
 /*
  * Implement addr2line using libbfd.
@@ -189,7 +191,7 @@ void dso__free_a2l(struct dso *dso)
 	dso->a2l = NULL;
 }
 
-#else /* HAVE_LIBBFD_SUPPORT */
+#else /* !CONFIG_LIBBFD */
 
 static int addr2line(const char *dso_name, unsigned long addr,
 		     char **file, unsigned int *line_nr,
@@ -242,7 +244,7 @@ void dso__free_a2l(struct dso *dso __maybe_unused)
 {
 }
 
-#endif /* HAVE_LIBBFD_SUPPORT */
+#endif /* CONFIG_LIBBFD */
 
 /*
  * Number of addr2line failures (without success) before disabling it for that
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 501e4e7..d8e886e 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,6 +1,8 @@
 #ifndef __PERF_SYMBOL
 #define __PERF_SYMBOL 1
 
+#include "generated/autoconf.h"
+
 #include <linux/types.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -21,26 +23,33 @@
 
 #include "dso.h"
 
-#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
+#ifdef CONFIG_DEMANGLE
+
+#ifdef CONFIG_LIBBFD
+
+#define PACKAGE 'perf'
+#include <bfd.h>
+
+#elif defined(CONFIG_LIBIBERTY_ONLY)
 extern char *cplus_demangle(const char *, int);
 
 static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
 {
 	return cplus_demangle(c, i);
 }
-#else
-#ifdef NO_DEMANGLE
+
+#else /* Unknown dependency */
+#error "Inconsistent demangling configuration"
+#endif
+
+#else /* !CONFIG_DEMANGLE */
 static inline char *bfd_demangle(void __maybe_unused *v,
 				 const char __maybe_unused *c,
 				 int __maybe_unused i)
 {
 	return NULL;
 }
-#else
-#define PACKAGE 'perf'
-#include <bfd.h>
-#endif
-#endif
+#endif /* CONFIG_DEMANGLE */
 
 /*
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 18/34] perf kbuild: remove legacy on_exit-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (16 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 17/34] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 19/34] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
                   ` (17 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove HAVE_ON_EXIT_SUPPORT (replaced by CONFIG_ON_EXIT)
---
 tools/perf/Kconfig          | 6 ++++++
 tools/perf/builtin-record.c | 4 +++-
 tools/perf/config/Makefile  | 6 +++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index ffc1d81..34a8b09 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -190,6 +190,12 @@ config TIMERFD
         ---help---
 	  Timer via file descriptor
 
+config ON_EXIT
+	bool "Support of on_exit() function"
+	default n
+        ---help---
+	  On exit support
+
 config DEMANGLE
 	bool "Demangle symbols"
 	default n
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 8ce62ef..372a812 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -5,6 +5,8 @@
  * (or a CPU, or a PID) into the perf.data output file - for
  * later analysis via perf report.
  */
+
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
@@ -30,7 +32,7 @@
 #include <sched.h>
 #include <sys/mman.h>
 
-#ifndef HAVE_ON_EXIT_SUPPORT
+#ifndef CONFIG_ON_EXIT
 #ifndef ATEXIT_MAX
 #define ATEXIT_MAX 32
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index ff7f01c..c128f30 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -566,9 +566,9 @@ ifdef CONFIG_LIBIBERTY_ONLY
   endif
 endif
 
-ifndef NO_ON_EXIT
-  ifeq ($(feature-on-exit), 1)
-    CFLAGS += -DHAVE_ON_EXIT_SUPPORT
+ifdef CONFIG_ON_EXIT
+  ifneq ($(feature-on-exit), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_ON_EXIT)
   endif
 endif
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 19/34] perf kbuild: remove legacy backtrace-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (17 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 18/34] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 20/34] perf kbuild: remove legacy numa-related " Alexis Berlemont
                   ` (16 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove HAVE_BACKTRACE_SUPPORT (replaced by CONFIG_BACKTRACE)
---
 tools/perf/Kconfig         | 1 -
 tools/perf/config/Makefile | 6 +++---
 tools/perf/util/util.c     | 5 +++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 34a8b09..fad1c48 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -244,7 +244,6 @@ config LIBUNWIND_DIR
         ---help---
 	  libunwind directory
 
-
 config NUMA
 	bool "Numa support (bench)"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c128f30..4a21452 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -572,9 +572,9 @@ ifdef CONFIG_ON_EXIT
   endif
 endif
 
-ifndef NO_BACKTRACE
-  ifeq ($(feature-backtrace), 1)
-    CFLAGS += -DHAVE_BACKTRACE_SUPPORT
+ifdef CONFIG_BACKTRACE
+  ifneq ($(feature-backtrace), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BACKTRACE)
   endif
 endif
 
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 9f66549..6b5db6d 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,8 +1,9 @@
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include <api/fs/fs.h>
 #include <sys/mman.h>
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 #include <execinfo.h>
 #endif
 #include <stdio.h>
@@ -237,7 +238,7 @@ int hex2u64(const char *ptr, u64 *long_val)
 }
 
 /* Obtain a backtrace and print it to stdout. */
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 void dump_stack(void)
 {
 	void *array[16];
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 20/34] perf kbuild: remove legacy numa-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (18 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 19/34] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 21/34] perf kbuild: remove legacy bionic-related " Alexis Berlemont
                   ` (15 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove HAVE_LIBNUMA_SUPPORT (replaced by CONFIG_LIBNUMA)
---
 tools/perf/Kconfig                    |  6 +++---
 tools/perf/bench/Kbuild               |  2 +-
 tools/perf/builtin-bench.c            |  5 +++--
 tools/perf/config/Makefile            |  8 ++------
 tools/perf/config/Makefile.fix-config | 16 ----------------
 tools/perf/config/Makefile.fix-legacy | 12 ------------
 6 files changed, 9 insertions(+), 40 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index fad1c48..2e285e5 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -244,11 +244,11 @@ config LIBUNWIND_DIR
         ---help---
 	  libunwind directory
 
-config NUMA
-	bool "Numa support (bench)"
+config LIBNUMA
+	bool "Libnuma support"
 	default n
         ---help---
-	  numa
+	  Libnuma
 
 config BIONIC
 	bool "Bionic support"
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
index 8883de9..57f87e8 100644
--- a/tools/perf/bench/Kbuild
+++ b/tools/perf/bench/Kbuild
@@ -3,7 +3,7 @@ obj-y += mem-memset.o
 obj-y += sched-messaging.o
 obj-y += sched-pipe.o
 
-obj-$(CONFIG_NUMA) += numa.o
+obj-$(CONFIG_LIBNUMA) += numa.o
 
 obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
 obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 1e6e777..162b9f5 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -14,6 +14,7 @@
  *  numa  ... NUMA scheduling and MM performance
  *  futex ... Futex performance
  */
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "util/util.h"
 #include "util/parse-options.h"
@@ -33,7 +34,7 @@ struct bench {
 	bench_fn_t	fn;
 };
 
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 static struct bench numa_benchmarks[] = {
 	{ "mem",	"Benchmark for NUMA workloads",			bench_numa		},
 	{ "all",	"Test all NUMA benchmarks",			NULL			},
@@ -72,7 +73,7 @@ struct collection {
 static struct collection collections[] = {
 	{ "sched",	"Scheduler and IPC benchmarks",			sched_benchmarks	},
 	{ "mem",	"Memory access benchmarks",			mem_benchmarks		},
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 	{ "numa",	"NUMA scheduling and MM benchmarks",		numa_benchmarks		},
 #endif
 	{"futex",       "Futex stressing benchmarks",                   futex_benchmarks        },
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 4a21452..770675f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -578,12 +578,11 @@ ifdef CONFIG_BACKTRACE
   endif
 endif
 
-ifndef NO_LIBNUMA
+ifdef CONFIG_LIBNUMA
   ifeq ($(feature-libnuma), 0)
     msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
-    NO_LIBNUMA := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBNUMA)
   else
-    CFLAGS += -DHAVE_LIBNUMA_SUPPORT
     EXTLIBS += -lnuma
   endif
 endif
@@ -756,11 +755,8 @@ all:
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_BACKTRACE)
-	$(call store,NO_LIBNUMA)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 6402a47..46842f9 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -37,22 +37,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
 endif
 endif
 
-# NO_BACKTRACE
-ifdef CONFIG_BACKTRACE
-ifdef NO_BACKTRACE
-dummy := $(info Disabling CONFIG_BACKTRACE)
-dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
-endif
-endif
-
-# NO_LIBNUMA
-ifdef CONFIG_NUMA
-ifdef NO_LIBNUMA
-dummy := $(info Disabling CONFIG_NUMA)
-dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
-endif
-endif
-
 # NO_LIBBIONIC
 ifdef CONFIG_BIONIC
 ifdef NO_LIBBIONIC
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 2e93006..15a328e 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -5,10 +5,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_DEMANGLE
-NO_DEMANGLE := 1
-endif
-
 ifndef CONFIG_LIBELF
 NO_LIBELF := 1
 endif
@@ -17,14 +13,6 @@ ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
 
-ifndef CONFIG_BACKTRACE
-NO_BACKTRACE := 1
-endif
-
-ifndef CONFIG_NUMA
-export NO_LIBNUMA := 1
-endif
-
 ifdef CONFIG_BIONIC
 NO_LIBBIONIC := 1
 endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 21/34] perf kbuild: remove legacy bionic-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (19 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 20/34] perf kbuild: remove legacy numa-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 22/34] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
                   ` (14 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_BIONIC (replaced by CONFIG_BIONIC)
---
 tools/perf/config/Makefile            | 4 +++-
 tools/perf/config/Makefile.fix-config | 8 --------
 tools/perf/config/Makefile.fix-legacy | 4 ----
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 770675f..f0f51cd 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -270,12 +270,14 @@ CFLAGS += -I$(LIB_INCLUDE)
 
 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
-ifndef NO_BIONIC
+ifdef CONFIG_BIONIC
   $(call feature_check,bionic)
   ifeq ($(feature-bionic), 1)
     BIONIC := 1
     EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
     EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
+  else
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BIONIC)
   endif
 endif
 
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 46842f9..5575a55 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -37,12 +37,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
 endif
 endif
 
-# NO_LIBBIONIC
-ifdef CONFIG_BIONIC
-ifdef NO_LIBBIONIC
-dummy := $(info Disabling CONFIG_BIONIC)
-dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 15a328e..00244f5 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -12,7 +12,3 @@ endif
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
-
-ifdef CONFIG_BIONIC
-NO_LIBBIONIC := 1
-endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 22/34] perf kbuild: remove legacy libelf-related build variables (1st part)
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (20 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 21/34] perf kbuild: remove legacy bionic-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 23/34] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
                   ` (13 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_LIBELF (replaced by CONFIG_LIBELF)
---
 tools/perf/Kconfig                    |  8 ++++++++
 tools/perf/config/Makefile            | 23 +++++++----------------
 tools/perf/config/Makefile.fix-config | 18 ------------------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 4 files changed, 15 insertions(+), 38 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 2e285e5..909a737 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -197,6 +197,7 @@ config ON_EXIT
 	  On exit support
 
 config DEMANGLE
+       depends on LIBELF
 	bool "Demangle symbols"
 	default n
         ---help---
@@ -233,7 +234,14 @@ choice
 	  builtin elf support
 endchoice
 
+config LIBDWARF
+        depends on LIBELF
+	bool "Dwarf (libdwarf)"
+        ---help---
+	  libdwarf
+
 config LIBUNWIND
+        depends on LIBELF
 	bool "User space libunwind callchains"
         ---help---
 	  libunwind
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f0f51cd..f280b80 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -281,12 +281,7 @@ ifdef CONFIG_BIONIC
   endif
 endif
 
-ifdef NO_LIBELF
-  NO_DWARF := 1
-  NO_DEMANGLE := 1
-  NO_LIBUNWIND := 1
-  NO_LIBDW_DWARF_UNWIND := 1
-else
+ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
       LIBC_SUPPORT := 1
@@ -296,16 +291,13 @@ else
     endif
     ifeq ($(LIBC_SUPPORT),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
-
-      NO_LIBELF := 1
-      NO_DWARF := 1
-      NO_DEMANGLE := 1
-      NO_LIBUNWIND := 1
-      NO_LIBDW_DWARF_UNWIND := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
+      $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
     else
       msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
     endif
   else
+    LIBELF = 1
     ifndef NO_LIBDW_DWARF_UNWIND
       ifneq ($(feature-libdw-dwarf-unwind),1)
         NO_LIBDW_DWARF_UNWIND := 1
@@ -317,9 +309,9 @@ else
       NO_DWARF := 1
     endif # Dwarf support
   endif # libelf support
-endif # NO_LIBELF
+endif # CONFIG_LIBELF
 
-ifndef NO_LIBELF
+ifeq ($(LIBELF), 1)
   CFLAGS += -DHAVE_LIBELF_SUPPORT
 
   ifeq ($(feature-libelf-mmap), 1)
@@ -343,7 +335,7 @@ ifndef NO_LIBELF
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
   endif # NO_DWARF
-endif # NO_LIBELF
+endif # LIBELF
 
 ifndef NO_LIBUNWIND
   ifneq ($(feature-libunwind), 1)
@@ -757,7 +749,6 @@ all:
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 5575a55..32a6701 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -11,24 +11,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_DEMANGLE
-ifdef CONFIG_DEMANGLE
-ifdef NO_DEMANGLE
-dummy := $(info Disabling CONFIG_DEMANGLE)
-dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
-endif
-endif
-
-# NO_LIBELF
-ifdef CONFIG_LIBELF
-ifdef NO_LIBELF
-dummy := $(info Disabling CONFIG_LIBELF)
-dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
-dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
-endif
-endif
-
 # NO_LIBUNWIND
 ifdef CONFIG_LIBUNWIND
 ifdef NO_LIBUNWIND
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 00244f5..e3eab7c 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -5,10 +5,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_LIBELF
-NO_LIBELF := 1
-endif
-
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 23/34] perf kbuild: remove legacy libelf-related build variables (2nd part)
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (21 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 22/34] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 24/34] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
                   ` (12 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove HAVE_LIBELF_SUPPORT (replaced by CONFIG_LIBELF)
Remove HAVE_LIBELF_MMAP_SUPPORT (replaced by CONFIG_LIBELF_MMAP)
Remove HAVE_LIBELF_GETPHDRNUM__SUPPORT (replaced by
CONFIG_LIBELF_GETPHDRNUM_)
---
 tools/perf/Kconfig                  | 16 ++++++++++++++++
 tools/perf/builtin-inject.c         |  2 +-
 tools/perf/config/Makefile          | 13 ++++++++-----
 tools/perf/perf.c                   |  2 +-
 tools/perf/util/generate-cmdlist.sh |  4 ++--
 tools/perf/util/map.c               |  3 ++-
 tools/perf/util/symbol-elf.c        |  3 ++-
 tools/perf/util/symbol.h            |  8 ++++----
 8 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 909a737..e228e26 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -234,8 +234,23 @@ choice
 	  builtin elf support
 endchoice
 
+config LIBELF_MMAP
+        depends on LIBELF
+	bool "Libelf mmap support"
+	default y
+        ---help---
+	  libdelf mmap
+
+config LIBELF_GETPHDRNUM
+        depends on LIBELF
+	default y
+	bool "Libelf getphdrnum support"
+        ---help---
+	  libdelf mmap
+
 config LIBDWARF
         depends on LIBELF
+	default n
 	bool "Dwarf (libdwarf)"
         ---help---
 	  libdwarf
@@ -243,6 +258,7 @@ config LIBDWARF
 config LIBUNWIND
         depends on LIBELF
 	bool "User space libunwind callchains"
+	default n
         ---help---
 	  libunwind
 
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 3a73875..6e7883b 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -229,7 +229,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool,
 				 * account this as unresolved.
 				 */
 			} else {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 				pr_warning("no symbols found in %s, maybe "
 					   "install a debug package?\n",
 					   al.map->dso->long_name);
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f280b80..c102e91 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -312,14 +312,17 @@ ifdef CONFIG_LIBELF
 endif # CONFIG_LIBELF
 
 ifeq ($(LIBELF), 1)
-  CFLAGS += -DHAVE_LIBELF_SUPPORT
 
-  ifeq ($(feature-libelf-mmap), 1)
-    CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-mmap), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
-  ifeq ($(feature-libelf-getphdrnum), 1)
-    CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-getphdrnum), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
   # include ARCH specific config
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 588221c..f9b919f 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -80,7 +80,7 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
 #endif
-#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
+#if defined CONFIG_LIBELF && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_KMEM
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 5d84ffc..a8dbdc2 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -30,7 +30,7 @@ do
      echo "#endif"
 done
 
-echo "#ifdef HAVE_LIBELF_SUPPORT"
+echo "#ifdef CONFIG_LIBELF"
 sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
@@ -45,5 +45,5 @@ do
      }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
-echo "#endif /* HAVE_LIBELF_SUPPORT */"
+echo "#endif /* CONFIG_LIBELF */"
 echo "};"
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 39cd2d0..82261f5 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include <errno.h>
 #include <inttypes.h>
@@ -174,7 +175,7 @@ int map__load(struct map *map, symbol_filter_t filter)
 		pr_warning(", continuing without symbols\n");
 		return -1;
 	} else if (nr == 0) {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 		const size_t len = strlen(name);
 		const size_t real_len = len - sizeof(DSO__DELETED);
 
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 6864661..1256595 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -5,12 +5,13 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include "vdso.h"
 #include <symbol/kallsyms.h>
 #include "debug.h"
 
-#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
+#ifndef CONFIG_LIBELF_GETPHDRNUM
 static int elf_getphdrnum(Elf *elf, size_t *dst)
 {
 	GElf_Ehdr gehdr;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index d8e886e..933cfd1 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -15,7 +15,7 @@
 #include <libgen.h>
 #include "build-id.h"
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 #include <libelf.h>
 #include <gelf.h>
 #endif
@@ -55,13 +55,13 @@ static inline char *bfd_demangle(void __maybe_unused *v,
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
  * for newer versions we can use mmap to reduce memory usage:
  */
-#ifdef HAVE_LIBELF_MMAP_SUPPORT
+#ifdef CONFIG_LIBELF_MMAP
 # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
 #else
 # define PERF_ELF_C_READ_MMAP ELF_C_READ
 #endif
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
 				GElf_Shdr *shp, const char *name, size_t *idx);
 #endif
@@ -205,7 +205,7 @@ struct symsrc {
 	int fd;
 	enum dso_binary_type type;
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 	Elf *elf;
 	GElf_Ehdr ehdr;
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 24/34] perf kbuild: remove legacy libdwarf-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (22 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 23/34] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 25/34] perf kbuild: remove legacy libunwind-related " Alexis Berlemont
                   ` (11 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_DWARF (replaced by CONFIG_LIBDWARF)
Remove HAVE_DWARF_SUPPORT (replaced by CONFIG_LIBDWARF)
---
 tools/perf/Kconfig                   | 13 ++++++
 tools/perf/arch/arm/Makefile         |  2 +-
 tools/perf/arch/powerpc/Makefile     |  2 +-
 tools/perf/arch/s390/Makefile        |  2 +-
 tools/perf/arch/sh/Makefile          |  2 +-
 tools/perf/arch/sparc/Makefile       |  2 +-
 tools/perf/arch/x86/Kbuild           |  1 +
 tools/perf/arch/x86/Makefile         |  6 +--
 tools/perf/arch/x86/tests/Kbuild     |  2 +
 tools/perf/arch/x86/util/Kbuild      |  3 +-
 tools/perf/builtin-probe.c           | 15 +++----
 tools/perf/builtin-record.c          | 10 ++---
 tools/perf/config/Makefile           | 76 +++++++++++++++++-------------------
 tools/perf/tests/builtin-test.c      |  3 +-
 tools/perf/tests/tests.h             |  4 +-
 tools/perf/util/Kbuild               |  3 +-
 tools/perf/util/include/dwarf-regs.h |  4 +-
 tools/perf/util/probe-event.c        |  6 +--
 tools/perf/util/probe-finder.h       |  5 ++-
 tools/perf/util/unwind.h             |  5 ++-
 20 files changed, 93 insertions(+), 73 deletions(-)
 create mode 100644 tools/perf/arch/x86/tests/Kbuild

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index e228e26..8da8409 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -255,6 +255,19 @@ config LIBDWARF
         ---help---
 	  libdwarf
 
+config LIBDWARF_UNWIND
+        depends on LIBDWARF
+	default y
+	bool "Dwarf unwind"
+        ---help---
+	  libdwarf unwind
+
+config LIBDWARF_DIR
+	string "libdwarf directory"
+	depends on LIBDWARF
+        ---help---
+	  libdwarf directory
+
 config LIBUNWIND
         depends on LIBELF
 	bool "User space libunwind callchains"
diff --git a/tools/perf/arch/arm/Makefile b/tools/perf/arch/arm/Makefile
index 67e9b3d..5f33855 100644
--- a/tools/perf/arch/arm/Makefile
+++ b/tools/perf/arch/arm/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index 744e629..3c57a2e 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sh/Makefile b/tools/perf/arch/sh/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sh/Makefile
+++ b/tools/perf/arch/sh/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sparc/Makefile b/tools/perf/arch/sparc/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sparc/Makefile
+++ b/tools/perf/arch/sparc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
index 52fd6fa..3b9a068 100644
--- a/tools/perf/arch/x86/Kbuild
+++ b/tools/perf/arch/x86/Kbuild
@@ -1 +1,2 @@
 obj-y += util/
+obj-y += tests/
\ No newline at end of file
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 1641542..238f75b 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,14 +1,12 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
 ifndef NO_LIBUNWIND
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
-ifndef NO_LIBDW_DWARF_UNWIND
+ifeq ($(LIBDWARF_UNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o
-endif
-ifndef NO_DWARF_UNWIND
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o
 endif
diff --git a/tools/perf/arch/x86/tests/Kbuild b/tools/perf/arch/x86/tests/Kbuild
new file mode 100644
index 0000000..31269b4
--- /dev/null
+++ b/tools/perf/arch/x86/tests/Kbuild
@@ -0,0 +1,2 @@
+obj-$(CONFIG_LIBDWARF_UNWIND) += regs_load.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += dwarf-unwind.o
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
index e033b94..0eed9c0 100644
--- a/tools/perf/arch/x86/util/Kbuild
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -1,4 +1,5 @@
 obj-y += dwarf-regs.o
 obj-y += header.o
 obj-y += tsc.o
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index cdcd4eb..71b8ecc 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "builtin.h"
 #include "util/util.h"
@@ -180,7 +181,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	if  (str && !params.target) {
 		if (!strcmp(opt->long_name, "exec"))
 			params.uprobes = true;
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		else if (!strcmp(opt->long_name, "module"))
 			params.uprobes = false;
 #endif
@@ -206,7 +207,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	return ret;
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 static int opt_show_lines(const struct option *opt __maybe_unused,
 			  const char *str, int unset __maybe_unused)
 {
@@ -296,7 +297,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
 		"perf probe [<options>] --del '[GROUP:]EVENT' ...",
 		"perf probe --list",
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"perf probe [<options>] --line 'LINEDESC'",
 		"perf probe [<options>] --vars 'PROBEPOINT'",
 #endif
@@ -310,7 +311,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
 		opt_del_probe_event),
 	OPT_CALLBACK('a', "add", NULL,
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT"
 		" [[NAME=]ARG ...]",
 #else
@@ -322,7 +323,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"\t\tFUNC:\tFunction name\n"
 		"\t\tOFF:\tOffset from function entry (in byte)\n"
 		"\t\t%return:\tPut the probe at function return\n"
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"\t\tSRC:\tSource code path\n"
 		"\t\tRL:\tRelative line number from function entry.\n"
 		"\t\tAL:\tAbsolute line number in file.\n"
@@ -335,7 +336,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		opt_add_probe_event),
 	OPT_BOOLEAN('f', "force", &params.force_add, "forcibly add events"
 		    " with existing name"),
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	OPT_CALLBACK('L', "line", NULL,
 		     "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]",
 		     "Show source code lines.", opt_show_lines),
@@ -450,7 +451,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		return ret;
 	}
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	if (params.show_lines) {
 		if (params.mod_events) {
 			pr_err("  Error: Don't use --line with"
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 372a812..1a832da 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -651,7 +651,7 @@ error:
 	return ret;
 }
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 static int get_stack_size(char *str, unsigned long *_size)
 {
 	char *endptr;
@@ -677,7 +677,7 @@ static int get_stack_size(char *str, unsigned long *_size)
 	       max_size, str);
 	return -1;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_LIBDWARF_UNWIND */
 
 int record_parse_callchain(const char *arg, struct record_opts *opts)
 {
@@ -706,7 +706,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				       "needed for -g fp\n");
 			break;
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 		/* Dwarf style */
 		} else if (!strncmp(name, "dwarf", sizeof("dwarf"))) {
 			const unsigned long default_stack_dump_size = 8192;
@@ -722,7 +722,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				ret = get_stack_size(tok, &size);
 				opts->stack_dump_size = size;
 			}
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_LIBDWARF_UNWIND */
 		} else {
 			pr_err("callchain: Unknown --call-graph option "
 			       "value: %s\n", arg);
@@ -825,7 +825,7 @@ static struct record record = {
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
 #else
 const char record_callchain_help[] = CALLCHAIN_HELP "fp";
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c102e91..fa5f4f8 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -35,14 +35,6 @@ ifeq ($(ARCH),arm)
   LIBUNWIND_LIBS = -lunwind -lunwind-arm
 endif
 
-# So far there's only x86 libdw unwind support merged in perf.
-# Disable it on all other architectures in case libdw unwind
-# support is detected in system. Add supported architectures
-# to the check.
-ifneq ($(ARCH),x86)
-  NO_LIBDW_DWARF_UNWIND := 1
-endif
-
 ifeq ($(LIBUNWIND_LIBS),)
   NO_LIBUNWIND := 1
 else
@@ -68,12 +60,10 @@ ifeq ($(NO_PERF_REGS),0)
   CFLAGS += -DHAVE_PERF_REGS_SUPPORT
 endif
 
-ifndef NO_LIBELF
-  # for linking with debug library, run like:
-  # make DEBUG=1 LIBDW_DIR=/opt/libdw/
-  ifdef LIBDW_DIR
-    LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
-    LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
+ifdef CONFIG_LIBELF
+  ifdef CONFIG_LIBDWARF_DIR
+    LIBDW_CFLAGS  := -I$(CONFIG_LIBDWARF_DIR)/include
+    LIBDW_LDFLAGS := -L$(CONFIG_LIBDWARF_DIR)/lib
   endif
   FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
@@ -298,16 +288,30 @@ ifdef CONFIG_LIBELF
     endif
   else
     LIBELF = 1
-    ifndef NO_LIBDW_DWARF_UNWIND
-      ifneq ($(feature-libdw-dwarf-unwind),1)
-        NO_LIBDW_DWARF_UNWIND := 1
-        msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
-      endif
-    endif
-    ifneq ($(feature-dwarf), 1)
-      msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
-      NO_DWARF := 1
-    endif # Dwarf support
+    ifdef CONFIG_LIBDWARF
+      ifneq ($(feature-dwarf), 1)
+        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
+      else
+        LIBDWARF = 1
+      endif # Dwarf support
+      ifdef CONFIG_LIBDWARF_UNWIND
+        # So far there's only x86 libdw unwind support merged in
+        # perf. Disable it on all other architectures in case libdw
+        # unwind support is detected in system. Add supported
+        # architectures to the check.
+        ifeq ($(ARCH),x86)
+          ifneq ($(feature-libdw-dwarf-unwind),1)
+            msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
+            $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+          else
+            LIBDWARF_UNWIND = 1
+          endif # Dwarf unwind support
+        else
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+        endif # Arch x86
+      endif # CONFIG_LIBDWARF_UNWIND 
+    endif  # CONFIG_LIBDWARF
   endif # libelf support
 endif # CONFIG_LIBELF
 
@@ -328,16 +332,16 @@ ifeq ($(LIBELF), 1)
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifndef NO_DWARF
+  ifeq ($(LIBDWARF), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
-      NO_DWARF := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
     else
-      CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
+      CFLAGS += $(LIBDW_CFLAGS)
       LDFLAGS += $(LIBDW_LDFLAGS)
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
-  endif # NO_DWARF
+  endif # LIBDWARF
 endif # LIBELF
 
 ifndef NO_LIBUNWIND
@@ -352,24 +356,16 @@ dwarf-post-unwind-text := BUG
 
 # setup DWARF post unwinder
 ifdef NO_LIBUNWIND
-  ifdef NO_LIBDW_DWARF_UNWIND
+  ifeq ($(LIBDWARF_UNWIND), 1)
+    dwarf-post-unwind-text := libdw
+  else
     msg := $(warning Disabling post unwind, no support found.);
     dwarf-post-unwind := 0
-  else
-    dwarf-post-unwind-text := libdw
   endif
 else
   dwarf-post-unwind-text := libunwind
   # Enable libunwind support by default.
-  ifndef NO_LIBDW_DWARF_UNWIND
-    NO_LIBDW_DWARF_UNWIND := 1
-  endif
-endif
-
-ifeq ($(dwarf-post-unwind),1)
-  CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
-else
-  NO_DWARF_UNWIND := 1
+  $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
 endif
 
 ifndef NO_LIBUNWIND
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index b11bf8a..5cc30d2 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -3,6 +3,7 @@
  *
  * Builtin regression testing command: ever growing number of sanity tests
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "intlist.h"
 #include "tests.h"
@@ -116,7 +117,7 @@ static struct test {
 		.func = test__parse_no_sample_id_all,
 	},
 #if defined(__x86_64__) || defined(__i386__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 	{
 		.desc = "Test dwarf unwind",
 		.func = test__dwarf_unwind,
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index a24795c..b939917 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -1,6 +1,8 @@
 #ifndef TESTS_H
 #define TESTS_H
 
+#include "generated/autoconf.h"
+
 #define TEST_ASSERT_VAL(text, cond)					 \
 do {									 \
 	if (!(cond)) {							 \
@@ -43,7 +45,7 @@ int test__parse_no_sample_id_all(void);
 int test__dwarf_unwind(void);
 
 #if defined(__x86_64__) || defined(__i386__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 struct thread;
 struct perf_sample;
 int test__arch_unwind_sample(struct perf_sample *sample,
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 4d0b6da..8fac37e 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -49,7 +49,8 @@ obj-y += strlist.o
 obj-y += svghelper.o
 obj-y += symbol.o
 
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
 
 obj-$(CONFIG_LIBELF) += symbol-elf.o
 obj-$(CONFIG_LIBELF) += dwarf-aux.o
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h
index 8f14965..93cd69c 100644
--- a/tools/perf/util/include/dwarf-regs.h
+++ b/tools/perf/util/include/dwarf-regs.h
@@ -1,7 +1,9 @@
 #ifndef _PERF_DWARF_REGS_H_
 #define _PERF_DWARF_REGS_H_
 
-#ifdef HAVE_DWARF_SUPPORT
+#include "generated/autoconf.h"
+
+#ifdef CONFIG_LIBDWARF
 const char *get_arch_regstr(unsigned int n);
 #endif
 
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 0d1542f..765307b 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -32,6 +32,7 @@
 #include <limits.h>
 #include <elf.h>
 
+#include "generated/autoconf.h"
 #include "util.h"
 #include "event.h"
 #include "strlist.h"
@@ -255,8 +256,7 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
 		clear_probe_trace_event(tevs + i);
 }
 
-#ifdef HAVE_DWARF_SUPPORT
-
+#ifdef CONFIG_LIBDWARF
 /* Open new debuginfo of given module */
 static struct debuginfo *open_debuginfo(const char *module)
 {
@@ -786,7 +786,7 @@ out:
 	return ret;
 }
 
-#else	/* !HAVE_DWARF_SUPPORT */
+#else	/* !CONFIG_LIBDWARF */
 
 static int
 find_perf_probe_point_from_dwarf(struct probe_trace_point *tp __maybe_unused,
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 92590b2..13cb054 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -2,6 +2,7 @@
 #define _PROBE_FINDER_H
 
 #include <stdbool.h>
+#include "generated/autoconf.h"
 #include "util.h"
 #include "intlist.h"
 #include "probe-event.h"
@@ -16,7 +17,7 @@ static inline int is_c_varname(const char *name)
 	return isalpha(name[0]) || name[0] == '_';
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 
 #include "dwarf-aux.h"
 
@@ -107,6 +108,6 @@ struct line_finder {
 	int			found;
 };
 
-#endif /* HAVE_DWARF_SUPPORT */
+#endif /* CONFIG_LIBDWARF */
 
 #endif /*_PROBE_FINDER_H */
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index b031316..681ad27 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -1,6 +1,7 @@
 #ifndef __UNWIND_H
 #define __UNWIND_H
 
+#include "generated/autoconf.h"
 #include "types.h"
 #include "event.h"
 #include "symbol.h"
@@ -13,7 +14,7 @@ struct unwind_entry {
 
 typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 			struct machine *machine,
 			struct thread *thread,
@@ -33,5 +34,5 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_LIBDWARF_UNWIND */
 #endif /* __UNWIND_H */
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 25/34] perf kbuild: remove legacy libunwind-related build variables
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (23 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 24/34] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 26/34] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
                   ` (10 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_UNWIND (replaced by CONFIG_LIBUNWIND)
Remove HAVE_LIBUNWIND_SUPPORT (replaced by CONFIG_LIBUNWIND)
Remove NO_LIBUNWIND_DEBUG_FRAME (replaced by
CONFIG_LIBUNWIND_DEBUG_FRAME)
---
 tools/perf/Kconfig                    | 37 +++++++++----
 tools/perf/arch/arm/Makefile          |  2 +-
 tools/perf/arch/x86/Makefile          |  2 +-
 tools/perf/arch/x86/tests/Kbuild      |  4 +-
 tools/perf/builtin-record.c           | 10 ++--
 tools/perf/config/Makefile            | 98 +++++++++++++++++++++--------------
 tools/perf/config/Makefile.fix-config |  8 ---
 tools/perf/config/Makefile.fix-legacy |  4 --
 tools/perf/util/unwind-libunwind.c    |  5 +-
 tools/perf/util/unwind.h              |  6 +--
 10 files changed, 102 insertions(+), 74 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 8da8409..15cebe9 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -255,26 +255,45 @@ config LIBDWARF
         ---help---
 	  libdwarf
 
-config LIBDWARF_UNWIND
-        depends on LIBDWARF
-	default y
-	bool "Dwarf unwind"
-        ---help---
-	  libdwarf unwind
-
 config LIBDWARF_DIR
 	string "libdwarf directory"
 	depends on LIBDWARF
         ---help---
 	  libdwarf directory
 
-config LIBUNWIND
+config UNWIND
         depends on LIBELF
-	bool "User space libunwind callchains"
+	bool "User space unwind callchains"
 	default n
         ---help---
+	  unwind
+
+choice UNWIND_DEPS
+       prompt "Unwind dependency"
+       depends on UNWIND
+       default LIBUNWIND
+
+config LIBUNWIND
+        depends on LIBELF
+	bool "Libunwind"
+        ---help---
 	  libunwind
 
+config LIBDWARF_UNWIND
+        depends on LIBDWARF
+	bool "Libdwarf unwind"
+        ---help---
+	  libdwarf unwind
+
+endchoice
+
+config LIBUNWIND_DEBUG_FRAME
+        depends on LIBUNWIND
+	bool "libunwind debug frame"
+	default y
+        ---help---
+	  libunwind debug frame
+
 config LIBUNWIND_DIR
 	string "libunwind directory"
 	depends on LIBUNWIND
diff --git a/tools/perf/arch/arm/Makefile b/tools/perf/arch/arm/Makefile
index 5f33855..04852ea 100644
--- a/tools/perf/arch/arm/Makefile
+++ b/tools/perf/arch/arm/Makefile
@@ -2,6 +2,6 @@ ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 238f75b..d37e641 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -2,7 +2,7 @@ ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
 ifeq ($(LIBDWARF_UNWIND), 1)
diff --git a/tools/perf/arch/x86/tests/Kbuild b/tools/perf/arch/x86/tests/Kbuild
index 31269b4..4717953 100644
--- a/tools/perf/arch/x86/tests/Kbuild
+++ b/tools/perf/arch/x86/tests/Kbuild
@@ -1,2 +1,2 @@
-obj-$(CONFIG_LIBDWARF_UNWIND) += regs_load.o
-obj-$(CONFIG_LIBDWARF_UNWIND) += dwarf-unwind.o
+obj-$(CONFIG_UNWIND) += regs_load.o
+obj-$(CONFIG_UNWIND) += dwarf-unwind.o
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 1a832da..decaf8a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -651,7 +651,7 @@ error:
 	return ret;
 }
 
-#ifdef CONFIG_LIBDWARF_UNWIND
+#ifdef CONFIG_UNWIND
 static int get_stack_size(char *str, unsigned long *_size)
 {
 	char *endptr;
@@ -677,7 +677,7 @@ static int get_stack_size(char *str, unsigned long *_size)
 	       max_size, str);
 	return -1;
 }
-#endif /* CONFIG_LIBDWARF_UNWIND */
+#endif /* CONFIG_UNWIND */
 
 int record_parse_callchain(const char *arg, struct record_opts *opts)
 {
@@ -706,7 +706,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				       "needed for -g fp\n");
 			break;
 
-#ifdef CONFIG_LIBDWARF_UNWIND
+#ifdef CONFIG_UNWIND
 		/* Dwarf style */
 		} else if (!strncmp(name, "dwarf", sizeof("dwarf"))) {
 			const unsigned long default_stack_dump_size = 8192;
@@ -722,7 +722,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				ret = get_stack_size(tok, &size);
 				opts->stack_dump_size = size;
 			}
-#endif /* CONFIG_LIBDWARF_UNWIND */
+#endif /* CONFIG_UNWIND */
 		} else {
 			pr_err("callchain: Unknown --call-graph option "
 			       "value: %s\n", arg);
@@ -825,7 +825,7 @@ static struct record record = {
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
 
-#ifdef CONFIG_LIBDWARF_UNWIND
+#ifdef CONFIG_UNWIND
 const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
 #else
 const char record_callchain_help[] = CALLCHAIN_HELP "fp";
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index fa5f4f8..7636084 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -36,14 +36,15 @@ ifeq ($(ARCH),arm)
 endif
 
 ifeq ($(LIBUNWIND_LIBS),)
-  NO_LIBUNWIND := 1
+  $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
+  LIBUNWIND = 1
   #
   # For linking with debug library, run like:
   #
   #   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
   #
-  ifdef LIBUNWIND_DIR
+  ifdef CONFIG_LIBUNWIND_DIR
     LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
     LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
   endif
@@ -302,7 +303,7 @@ ifdef CONFIG_LIBELF
         # architectures to the check.
         ifeq ($(ARCH),x86)
           ifneq ($(feature-libdw-dwarf-unwind),1)
-            msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
+            msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
             $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
           else
             LIBDWARF_UNWIND = 1
@@ -344,46 +345,68 @@ ifeq ($(LIBELF), 1)
   endif # LIBDWARF
 endif # LIBELF
 
-ifndef NO_LIBUNWIND
-  ifneq ($(feature-libunwind), 1)
-    msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
-    NO_LIBUNWIND := 1
+ifdef CONFIG_UNWIND
+  # CONFIG_LIBUNWIND is the default choice; so, if it is not
+  # available, let's try another one
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifneq ($(feature-libunwind), 1)
+        LIBUNWIND = 0
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
+        ifeq ($(LIBDWARF_UNWIND), 1)
+          msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
+        else
+          msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+        endif # LIBDWARF_UNWIND
+      else # feature-libunwind OK
+        EXTLIBS += $(LIBUNWIND_LIBS)
+        CFLAGS += $(LIBUNWIND_CFLAGS)
+        LDFLAGS += $(LIBUNWIND_LDFLAGS)
+      endif # feature-libunwind
+    endif # LIBUNWIND
+  endif # CONFIG_LIBUNWIND
+
+  # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
+  # choice); so, we disable CONFIG_UNWIND if it is not available
+  ifdef CONFIG_LIBDWARF_UNWIND
+    ifneq ($(LIBDWARF_UNWIND), 1)
+      msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+    endif
+  endif # CONFIG_LIBDWARF_UNWIND
+
+  # if libunwind is OK, let's check the option DEBUG_FRAME
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifeq ($(ARCH),arm)
+        $(call feature_check,libunwind-debug-frame)
+        ifneq ($(feature-libunwind-debug-frame), 1)
+          msg := $(warning No debug_frame support found in libunwind);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+        endif
+      else
+        # non-ARM has no dwarf_find_debug_frame() function:
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+      endif
+    endif
   endif
-endif
 
-dwarf-post-unwind := 1
-dwarf-post-unwind-text := BUG
+dwarf-post-unwind = 0
+dwarf-post-unwind-text = BUG
 
-# setup DWARF post unwinder
-ifdef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
+  dwarf-post-unwind := 1
+  dwarf-post-unwind-text := libunwind
+else
   ifeq ($(LIBDWARF_UNWIND), 1)
+    dwarf-post-unwind := 1
     dwarf-post-unwind-text := libdw
-  else
-    msg := $(warning Disabling post unwind, no support found.);
-    dwarf-post-unwind := 0
   endif
-else
-  dwarf-post-unwind-text := libunwind
-  # Enable libunwind support by default.
-  $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
-endif
+endif # LIBUNWIND
 
-ifndef NO_LIBUNWIND
-  ifeq ($(ARCH),arm)
-    $(call feature_check,libunwind-debug-frame)
-    ifneq ($(feature-libunwind-debug-frame), 1)
-      msg := $(warning No debug_frame support found in libunwind);
-      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
-    endif
-  else
-    # non-ARM has no dwarf_find_debug_frame() function:
-    CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
-  endif
-  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
-  EXTLIBS += $(LIBUNWIND_LIBS)
-  CFLAGS  += $(LIBUNWIND_CFLAGS)
-  LDFLAGS += $(LIBUNWIND_LDFLAGS)
-endif
+endif # CONFIG_UNWIND
 
 ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
@@ -746,10 +769,7 @@ all:
 	$(call store,PYTHON_EMBED_CCOPTS)
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
-	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 32a6701..273f793 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -11,12 +11,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_LIBUNWIND
-ifdef CONFIG_LIBUNWIND
-ifdef NO_LIBUNWIND
-dummy := $(info Disabling CONFIG_LIBUNWIND)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index e3eab7c..275b6d9 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -4,7 +4,3 @@ include $(KCONFIG_CONFIG)
 ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
-
-ifndef CONFIG_LIBUNWIND
-NO_LIBUNWIND := 1
-endif
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index bd5768d..0cc7cdc 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
+#include "generated/autoconf.h"
 #include "thread.h"
 #include "session.h"
 #include "perf_regs.h"
@@ -260,7 +261,7 @@ static int read_unwind_spec_eh_frame(struct dso *dso, struct machine *machine,
 	return ret;
 }
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 static int read_unwind_spec_debug_frame(struct dso *dso,
 					struct machine *machine, u64 *offset)
 {
@@ -319,7 +320,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
 						 need_unwind_info, arg);
 	}
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 	/* Check the .debug_frame section for unwinding info */
 	if (!read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
 		memset(&di, 0, sizeof(di));
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index 681ad27..0d82d29 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -14,13 +14,13 @@ struct unwind_entry {
 
 typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
 
-#ifdef CONFIG_LIBDWARF_UNWIND
+#ifdef CONFIG_UNWIND
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 			struct machine *machine,
 			struct thread *thread,
 			struct perf_sample *data, int max_stack);
 /* libunwind specific */
-#ifdef HAVE_LIBUNWIND_SUPPORT
+#ifdef CONFIG_LIBUNWIND
 int libunwind__arch_reg_id(int regnum);
 #endif
 #else
@@ -34,5 +34,5 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
-#endif /* CONFIG_LIBDWARF_UNWIND */
+#endif /* CONFIG__UNWIND */
 #endif /* __UNWIND_H */
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 26/34] perf kbuild: remove legacy libpython-related build variable
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (24 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 25/34] perf kbuild: remove legacy libunwind-related " Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 27/34] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
                   ` (9 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Remove NO_LIBPYTHON (replaced by CONFIG_LIBPYTHON)
---
 tools/perf/builtin-script.c             |  2 +-
 tools/perf/config/Makefile              | 43 +++++++++++----------------------
 tools/perf/config/Makefile.fix-config   |  8 ------
 tools/perf/config/Makefile.fix-legacy   |  4 ---
 tools/perf/util/trace-event-scripting.c |  3 ++-
 5 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ff67f0d..3e59b24 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1368,7 +1368,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 		if (strstr(lang_path, "perl"))
 			continue;
 #endif
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 		if (strstr(lang_path, "python"))
 			continue;
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 7636084..b043c0e 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -469,27 +469,24 @@ ifdef CONFIG_TIMERFD
   endif
 endif
 
-disable-python = $(eval $(disable-python_code))
-define disable-python_code
-  CFLAGS += -DNO_LIBPYTHON
-  $(if $(1),$(warning No $(1) was found))
-  $(warning Python support will not be built)
-  NO_LIBPYTHON := 1
-endef
-
-override PYTHON := \
-  $(call get-executable-or-default,PYTHON,python)
+ifdef CONFIG_LIBPYTHON
 
-ifndef PYTHON
-  $(call disable-python,python interpreter)
-else
+  disable-python = $(eval $(disable-python_code))
+  define disable-python_code
+    $(if $(1),$(warning No $(1) was found))
+    $(warning Python support will not be built)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPYTHON)
+  endef
 
-  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+  override PYTHON := \
+    $(call get-executable-or-default,PYTHON,python)
 
-  ifdef NO_LIBPYTHON
-    $(call disable-python)
+  ifndef PYTHON
+    $(call disable-python,python interpreter)
   else
 
+    PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
     override PYTHON_CONFIG := \
       $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
 
@@ -510,18 +507,7 @@ else
       else
 
         ifneq ($(feature-libpython-version), 1)
-          $(warning Python 3 is not yet supported; please set)
-          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
-          $(warning If you also have Python 2 installed, then)
-          $(warning try something like:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make PYTHON=python2)
-          $(warning $(and ,))
-          $(warning Otherwise, disable Python support entirely:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make NO_LIBPYTHON=1)
-          $(warning $(and ,))
-          $(error   $(and ,))
+          $(call disable-python,python2 interpreter)
         else
           LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
           EXTLIBS += $(PYTHON_EMBED_LIBADD)
@@ -769,7 +755,6 @@ all:
 	$(call store,PYTHON_EMBED_CCOPTS)
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
-	$(call store,NO_LIBPYTHON)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 273f793..3f0e33e 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,12 +3,4 @@ include $(KCONFIG_CONFIG)
 
 CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
-# NO_LIBPYTHON
-ifdef CONFIG_LIBPYTHON
-ifdef NO_LIBPYTHON
-dummy := $(info Disabling CONFIG_LIBPYTHON)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 275b6d9..431c9bf 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,6 +1,2 @@
 
 include $(KCONFIG_CONFIG)
-
-ifndef CONFIG_LIBPYTHON
-NO_LIBPYTHON := 1
-endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 51d8019..4a70ef7 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <errno.h>
 
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
@@ -93,7 +94,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 void setup_python_scripting(void)
 {
 	register_python_scripting(&python_scripting_unsupported_ops);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 27/34] perf kbuild: add generated Kconfig build-test cases
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (25 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 26/34] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 28/34] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
                   ` (8 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

Thanks to the python module kconfiglib, we were able to generate build
configurations. The set is, of course, not exhaustive but for each
option, all the possible states are tested.

This commit contains also a few changes so that all tests pass...
---
 tools/perf/Kconfig                                 | 115 +++++++++++----------
 tools/perf/Makefile                                |   2 +-
 tools/perf/Makefile.kbuild                         |   2 +-
 tools/perf/builtin-annotate.c                      |   8 +-
 tools/perf/builtin-kvm.c                           |  19 ++--
 tools/perf/builtin-mem.c                           |   3 +-
 tools/perf/builtin-report.c                        |   3 +
 tools/perf/builtin-top.c                           |  15 ++-
 tools/perf/tests/configs/MINIMAL_config            |  56 ++++++++++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  67 ++++++++++++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  67 ++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  67 ++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  67 ++++++++++++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  65 ++++++++++++
 tools/perf/tests/configs/NO_GTK2_config            |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBNUMA_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBPERL_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  66 ++++++++++++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBUNWIND_config       |  65 ++++++++++++
 tools/perf/tests/configs/NO_STDIO_config           |  67 ++++++++++++
 tools/perf/tests/configs/NO_TIMERFD_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_TUI_config             |  67 ++++++++++++
 tools/perf/tests/configs/REF_config                |  67 ++++++++++++
 tools/perf/tests/make                              |  65 +++---------
 tools/perf/ui/setup.c                              |   6 +-
 tools/perf/util/Kbuild                             |   9 +-
 53 files changed, 2924 insertions(+), 118 deletions(-)
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/REF_config

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 15cebe9..aff6208 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -23,38 +23,39 @@ config BUILTIN_STAT
 
 config BUILTIN_TOP
 	bool "top"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  top
 
 config BUILTIN_TRACE
 	bool "trace"
-	default n
-	depends on LIBAUDIT
+	default y
+	depends on BUILTIN_RECORD && LIBAUDIT
         ---help---
 	  trace
 
 config BUILTIN_ANNOTATE
 	bool "annotate"
-	default n
+	default y
         ---help---
 	  annotate
 
 config BUILTIN_BENCH
 	bool "bench"
-	default n
+	default y
         ---help---
 	  bench
 
 config BUILTIN_BUILDID_CACHE
 	bool "buildid-cache"
-	default n
+	default y
         ---help---
 	  buildid-cache
 
 config BUILTIN_BUILDID_LIST
 	bool "buildid-list"
-	default n
+	default y
         ---help---
 	  buildid-list
 
@@ -66,7 +67,7 @@ config BUILTIN_DIFF
 
 config BUILTIN_EVLIST
 	bool "evlist"
-	default n
+	default y
         ---help---
 	  evlist
 
@@ -78,62 +79,71 @@ config BUILTIN_HELP
 
 config BUILTIN_INJECT
 	bool "inject"
-	default n
+	default y
         ---help---
 	  inject
 
 config BUILTIN_KMEM
 	bool "kmem"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  kmem
 
 config BUILTIN_KVM
 	bool "kvm"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT && \
+		BUILTIN_RECORD && BUILTIN_BUILDID_LIST && \
+		BUILTIN_TOP && BUILTIN_DIFF && BUILTIN_STAT
         ---help---
 	  kvm
 
 config BUILTIN_LIST
 	bool "list"
-	default n
+	default y
         ---help---
 	  list
 
 config BUILTIN_LOCK
 	bool "lock"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  lock
 
 config BUILTIN_PROBE
 	bool "probe"
-	default n
+	default y
 	depends on LIBELF
         ---help---
 	  probe
 
 config BUILTIN_SCHED
 	bool "sched"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  sched
 
 config BUILTIN_SCRIPT
 	bool "script"
 	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  script
 
 config BUILTIN_TIMECHART
 	bool "timechart"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  timechart
 
 config BUILTIN_MEM
 	bool "mem"
 	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  mem
 
@@ -145,61 +155,85 @@ config BUILTIN_TEST
 
 endmenu
 
+menu "GUI"
+
+config STDIO
+	bool "Terminal"
+	default y
+        ---help---
+	  stdio
+
+config TUI
+	bool "Tui (slang based)"
+	depends on LIBSLANG
+	default y
+        ---help---
+	  stdio
+
+config GTK2
+	bool "Gtk2"
+	default y
+	depends on LIBGTK2
+        ---help---
+	  stdio
+
+endmenu
+
 menu "Libraries / Dependencies"
 
 config LIBSLANG
 	bool "Slang (libslang)"
-	default n
+	default y
         ---help---
 	  libslang
 
 config LIBAUDIT
 	bool "Audit (libaudit)"
-	default n
+	default y
         ---help---
 	  libaudit
 
 config LIBGTK2
 	bool "Gtk2 (libgtk2)"
-	default n
+	default y
         ---help---
 	  libgtk2
 
 config LIBGTK2_INFOBAR
 	bool "Gtk2 infobar (libgtk2)"
 	depends on LIBGTK2
-	default n
+	default y
         ---help---
 	  libgtk2-infobar
 
 config LIBPERL
 	bool "Perl"
-	default n
+	default y
         ---help---
 	  Perl
 
 config LIBPYTHON
 	bool "Python"
-	default n
+	default y
         ---help---
 	  Python
 
 config TIMERFD
 	bool "Timer via file descriptor"
-	default n
+	default y
         ---help---
 	  Timer via file descriptor
 
 config ON_EXIT
 	bool "Support of on_exit() function"
-	default n
+	default y
         ---help---
 	  On exit support
 
 config DEMANGLE
        depends on LIBELF
 	bool "Demangle symbols"
-	default n
+	default y
         ---help---
 	  demangle
 
@@ -250,7 +284,7 @@ config LIBELF_GETPHDRNUM
 
 config LIBDWARF
         depends on LIBELF
-	default n
+	default y
 	bool "Dwarf (libdwarf)"
         ---help---
 	  libdwarf
@@ -264,7 +298,7 @@ config LIBDWARF_DIR
 config UNWIND
         depends on LIBELF
 	bool "User space unwind callchains"
-	default n
+	default y
         ---help---
 	  unwind
 
@@ -302,7 +336,7 @@ config LIBUNWIND_DIR
 
 config LIBNUMA
 	bool "Libnuma support"
-	default n
+	default y
         ---help---
 	  Libnuma
 
@@ -314,29 +348,6 @@ config BIONIC
 
 endmenu
 
-menu "GUI"
-
-config STDIO
-	bool "Terminal"
-	default y
-        ---help---
-	  stdio
-
-config TUI
-	bool "Tui (slang based)"
-	depends on LIBSLANG
-	default n
-        ---help---
-	  stdio
-
-config GTK2
-	bool "Gtk2"
-	default n
-        ---help---
-	  stdio
-
-endmenu
-
 menu "Build"
 config DEBUG
 	bool "Compile with debug info"
@@ -352,7 +363,7 @@ config DEBUG_PARSER
 
 config BACKTRACE
 	bool "Compile with dump_stack support"
-	default n
+	default y
         ---help---
 	  dump_stack support
 
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index cb2e586..4512f16 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -55,7 +55,7 @@ define print_msg
 endef
 
 define make
-  @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
+  @$(MAKE) -f Makefile.kbuild --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
 endef
 
 #
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 7d625ae..2f980f7 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -43,7 +43,7 @@ export QUIET_BISON QUIET_FLEX
 
 ifeq ($(KBUILD_SRC),)
 
-ifeq ("$(origin O)", "command line")
+ifneq ($(O),)
 KBUILD_OUTPUT := $(O)
 else
 KBUILD_OUTPUT := $(objtree)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0da603b..96a6cad 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -114,7 +115,7 @@ static void hists__find_annotations(struct hists *hists,
 				    struct perf_evsel *evsel,
 				    struct perf_annotate *ann)
 {
-	struct rb_node *nd = rb_first(&hists->entries), *next;
+	struct rb_node *nd = rb_first(&hists->entries);
 	int key = K_RIGHT;
 
 	while (nd) {
@@ -153,7 +154,9 @@ find_next:
 
 			/* skip missing symbols */
 			nd = rb_next(nd);
+#ifdef CONFIG_TUI
 		} else if (use_browser == 1) {
+                        struct rb_node *next = NULL;
 			key = hist_entry__tui_annotate(he, evsel, NULL);
 			switch (key) {
 			case -1:
@@ -172,6 +175,7 @@ find_next:
 
 			if (next != NULL)
 				nd = next;
+#endif /* CONFIG_TUI */
 		} else {
 			hist_entry__tty_annotate(he, evsel, ann);
 			nd = rb_next(nd);
@@ -314,7 +318,9 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
+#ifdef CONFIG_TUI
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
+#endif /* CONFIG_TUI */
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index d035253..17eb07e 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1719,20 +1719,25 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	if (!strncmp(argv[0], "rec", 3))
 		return __cmd_record(file_name, argc, argv);
-	else if (!strncmp(argv[0], "rep", 3))
+
+	if (!strncmp(argv[0], "rep", 3))
 		return __cmd_report(file_name, argc, argv);
-	else if (!strncmp(argv[0], "diff", 4))
+
+	if (!strncmp(argv[0], "diff", 4))
 		return cmd_diff(argc, argv, NULL);
-	else if (!strncmp(argv[0], "top", 3))
+
+	if (!strncmp(argv[0], "top", 3))
 		return cmd_top(argc, argv, NULL);
-	else if (!strncmp(argv[0], "buildid-list", 12))
+
+	if (!strncmp(argv[0], "buildid-list", 12))
 		return __cmd_buildid_list(file_name, argc, argv);
+
 #if defined(__i386__) || defined(__x86_64__)
-	else if (!strncmp(argv[0], "stat", 4))
+	if (!strncmp(argv[0], "stat", 4))
 		return kvm_cmd_stat(file_name, argc, argv);
 #endif
-	else
-		usage_with_options(kvm_usage, kvm_options);
+
+        usage_with_options(kvm_usage, kvm_options);
 
 	return 0;
 }
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 2e3ade69..693f0cb 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "perf.h"
 
@@ -238,7 +239,7 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
 		return __cmd_record(argc, argv);
 	else if (!strncmp(argv[0], "rep", 3))
 		return report_events(argc, argv, &mem);
-	else
+        else
 		usage_with_options(mem_usage, mem_options);
 
 	return 0;
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c8f2113..e2c433f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -448,6 +449,7 @@ static int report__browse_hists(struct report *rep)
 	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
 
 	switch (use_browser) {
+#ifdef CONFIG_TUI
 	case 1:
 		ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
 						    rep->min_percent,
@@ -459,6 +461,7 @@ static int report__browse_hists(struct report *rep)
 		if (ret != K_SWITCH_INPUT_DATA)
 			ret = 0;
 		break;
+#endif /* CONFIG_TUI */
 	case 2:
 		ret = report__gtk_browse_hists(rep, help);
 		break;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 65aaa5b..0dd0278 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -17,6 +17,7 @@
  *
  * Released under the GPL v2. (and only v2, not any later version)
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
@@ -544,6 +545,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 	return ret;
 }
 
+#ifdef CONFIG_TUI
 static void perf_top__sort_new_samples(void *arg)
 {
 	struct perf_top *t = arg;
@@ -586,6 +588,7 @@ static void *display_thread_tui(void *arg)
 	done = 1;
 	return NULL;
 }
+#endif /* CONFIG_TUI */
 
 static void *display_thread(void *arg)
 {
@@ -898,9 +901,12 @@ static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
 	return 0;
 }
 
+typedef void* (*display_fn_t)(void*);
+
 static int __cmd_top(struct perf_top *top)
 {
 	struct record_opts *opts = &top->record_opts;
+        display_fn_t display_fn = display_thread;
 	pthread_t thread;
 	int ret;
 
@@ -946,8 +952,13 @@ static int __cmd_top(struct perf_top *top)
 	perf_top__mmap_read(top);
 
 	ret = -1;
-	if (pthread_create(&thread, NULL, (use_browser > 0 ? display_thread_tui :
-							    display_thread), top)) {
+
+#ifdef CONFIG_TUI
+        if (use_browser > 0)
+            display_fn = display_thread_tui;
+#endif
+
+	if (pthread_create(&thread, NULL, display_fn, top)) {
 		ui__error("Could not create display thread.\n");
 		goto out_delete;
 	}
diff --git a/tools/perf/tests/configs/MINIMAL_config b/tools/perf/tests/configs/MINIMAL_config
new file mode 100644
index 0000000..722282a
--- /dev/null
+++ b/tools/perf/tests/configs/MINIMAL_config
@@ -0,0 +1,56 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# The perf configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBGTK2 is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+# CONFIG_LIBELF is not set
+CONFIG_LIBELF_MINIMAL=y
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BACKTRACE_config b/tools/perf/tests/configs/NO_BACKTRACE_config
new file mode 100644
index 0000000..f44b4f9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BACKTRACE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+# CONFIG_BACKTRACE is not set
diff --git a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
new file mode 100644
index 0000000..5fdce32
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+# CONFIG_BUILTIN_ANNOTATE is not set
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
new file mode 100644
index 0000000..99d601e
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+# CONFIG_BUILTIN_BENCH is not set
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
new file mode 100644
index 0000000..edcee97
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
new file mode 100644
index 0000000..3043178
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
new file mode 100644
index 0000000..f553f96
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+# CONFIG_BUILTIN_DIFF is not set
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
new file mode 100644
index 0000000..8198a9d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_HELP_config b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
new file mode 100644
index 0000000..d897913
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+# CONFIG_BUILTIN_HELP is not set
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
new file mode 100644
index 0000000..3322780
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
new file mode 100644
index 0000000..0cb7cba
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+# CONFIG_BUILTIN_KMEM is not set
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KVM_config b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
new file mode 100644
index 0000000..d7849bc
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+# CONFIG_BUILTIN_KVM is not set
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
new file mode 100644
index 0000000..3eed298d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+# CONFIG_BUILTIN_LIST is not set
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
new file mode 100644
index 0000000..6347efd
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+# CONFIG_BUILTIN_LOCK is not set
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_MEM_config b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
new file mode 100644
index 0000000..d432c6a
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+# CONFIG_BUILTIN_MEM is not set
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
new file mode 100644
index 0000000..6dd2f14
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+# CONFIG_BUILTIN_PROBE is not set
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
new file mode 100644
index 0000000..e5bca7c
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+# CONFIG_BUILTIN_RECORD is not set
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
new file mode 100644
index 0000000..1d27667
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+# CONFIG_BUILTIN_REPORT is not set
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
new file mode 100644
index 0000000..7944d9b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
new file mode 100644
index 0000000..52d4121
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+# CONFIG_BUILTIN_SCRIPT is not set
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_STAT_config b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
new file mode 100644
index 0000000..2486420
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+# CONFIG_BUILTIN_STAT is not set
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TEST_config b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
new file mode 100644
index 0000000..1c52914
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
new file mode 100644
index 0000000..143a60d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TOP_config b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
new file mode 100644
index 0000000..188bcf2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
new file mode 100644
index 0000000..114d210
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+# CONFIG_BUILTIN_TRACE is not set
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_DEMANGLE_config b/tools/perf/tests/configs/NO_DEMANGLE_config
new file mode 100644
index 0000000..2aaaf20
--- /dev/null
+++ b/tools/perf/tests/configs/NO_DEMANGLE_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+# CONFIG_DEMANGLE is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_GTK2_config b/tools/perf/tests/configs/NO_GTK2_config
new file mode 100644
index 0000000..e1989c2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_GTK2_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+# CONFIG_GTK2 is not set
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBAUDIT_config b/tools/perf/tests/configs/NO_LIBAUDIT_config
new file mode 100644
index 0000000..b8fa6a2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBAUDIT_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+# CONFIG_LIBAUDIT is not set
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBDWARF_config b/tools/perf/tests/configs/NO_LIBDWARF_config
new file mode 100644
index 0000000..a5e33a1
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBDWARF_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+# CONFIG_LIBDWARF is not set
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBELF_MMAP_config b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
new file mode 100644
index 0000000..d8755ea
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+# CONFIG_LIBELF_MMAP is not set
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
new file mode 100644
index 0000000..81cd6a2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+# CONFIG_LIBGTK2_INFOBAR is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_config b/tools/perf/tests/configs/NO_LIBGTK2_config
new file mode 100644
index 0000000..a52e89d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+# CONFIG_LIBGTK2 is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBNUMA_config b/tools/perf/tests/configs/NO_LIBNUMA_config
new file mode 100644
index 0000000..9b3c1f8
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBNUMA_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPERL_config b/tools/perf/tests/configs/NO_LIBPERL_config
new file mode 100644
index 0000000..4c6d6be
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPERL_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+# CONFIG_LIBPERL is not set
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPYTHON_config b/tools/perf/tests/configs/NO_LIBPYTHON_config
new file mode 100644
index 0000000..6624bbf
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPYTHON_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+# CONFIG_LIBPYTHON is not set
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBSLANG_config b/tools/perf/tests/configs/NO_LIBSLANG_config
new file mode 100644
index 0000000..5bc0f98
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBSLANG_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
new file mode 100644
index 0000000..ca571d3
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBUNWIND_DEBUG_FRAME is not set
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_config b/tools/perf/tests/configs/NO_LIBUNWIND_config
new file mode 100644
index 0000000..6cc2c7c
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+# CONFIG_LIBUNWIND is not set
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_STDIO_config b/tools/perf/tests/configs/NO_STDIO_config
new file mode 100644
index 0000000..2f92b2d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_STDIO_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+# CONFIG_STDIO is not set
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TIMERFD_config b/tools/perf/tests/configs/NO_TIMERFD_config
new file mode 100644
index 0000000..4b54af8
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TIMERFD_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TUI_config b/tools/perf/tests/configs/NO_TUI_config
new file mode 100644
index 0000000..b95b982
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TUI_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/REF_config b/tools/perf/tests/configs/REF_config
new file mode 100644
index 0000000..bbaab9f
--- /dev/null
+++ b/tools/perf/tests/configs/REF_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 2f92d6e..2aa2ed7 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -11,34 +11,16 @@ else
 lib = lib
 endif
 
+list = $(shell ls $1 2>/dev/null)
 has = $(shell which $1 2>/dev/null)
 
 # standard single make variable specified
 make_clean_all      := clean all
 make_python_perf_so := python/perf.so
-make_debug          := DEBUG=1
-make_no_libperl     := NO_LIBPERL=1
-make_no_libpython   := NO_LIBPYTHON=1
-make_no_scripts     := NO_LIBPYTHON=1 NO_LIBPERL=1
-make_no_newt        := NO_NEWT=1
-make_no_slang       := NO_SLANG=1
-make_no_gtk2        := NO_GTK2=1
-make_no_ui          := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
-make_no_demangle    := NO_DEMANGLE=1
-make_no_libelf      := NO_LIBELF=1
-make_no_libunwind   := NO_LIBUNWIND=1
-make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1
-make_no_backtrace   := NO_BACKTRACE=1
-make_no_libnuma     := NO_LIBNUMA=1
-make_no_libaudit    := NO_LIBAUDIT=1
-make_no_libbionic   := NO_LIBBIONIC=1
 make_tags           := tags
 make_cscope         := cscope
 make_help           := help
 make_doc            := doc
-make_perf_o           := perf.o
-make_util_map_o       := util/map.o
-make_util_pmu_bison_o := util/pmu-bison.o
 make_install        := install
 make_install_bin    := install-bin
 make_install_doc    := install-doc
@@ -48,37 +30,11 @@ make_install_info   := install-info
 make_install_pdf    := install-pdf
 make_static         := LDFLAGS=-static
 
-# all the NO_* variable combined
-make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
-make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
-make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
-make_minimal        += NO_LIBDW_DWARF_UNWIND=1
-
 # $(run) contains all available tests
 run := make_pure
 run += make_clean_all
-run += make_python_perf_so
-run += make_debug
-run += make_no_libperl
-run += make_no_libpython
-run += make_no_scripts
-run += make_no_newt
-run += make_no_slang
-run += make_no_gtk2
-run += make_no_ui
-run += make_no_demangle
-run += make_no_libelf
-run += make_no_libunwind
-run += make_no_libdw_dwarf_unwind
-run += make_no_backtrace
-run += make_no_libnuma
-run += make_no_libaudit
-run += make_no_libbionic
 run += make_help
 run += make_doc
-run += make_perf_o
-run += make_util_map_o
-run += make_util_pmu_bison_o
 run += make_install
 run += make_install_bin
 # FIXME 'install-*' commented out till they're fixed
@@ -87,7 +43,6 @@ run += make_install_bin
 # run += make_install_html
 # run += make_install_info
 # run += make_install_pdf
-run += make_minimal
 run += make_static
 
 ifneq ($(call has,ctags),)
@@ -104,6 +59,10 @@ run_O := $(addsuffix _O,$(run))
 # disable some tests for O=...
 run_O := $(filter-out make_python_perf_so_O,$(run_O))
 
+# $(run_CONFIGS) is a set of automatically-generated Kconfig
+# configurations
+run_CONFIGS := $(call list,$(PERF)/tests/configs/)
+
 # define test for each compile as 'test_NAME' variable
 # with the test itself as a value
 test_make_tags   = test -f tags
@@ -221,13 +180,23 @@ $(run_O):
 	rm -rf $$TMP_O \
 	rm -rf $$TMP_DEST
 
+$(run_CONFIGS):
+	$(call clean)
+	@TMP_DEST=$$(mktemp -d); \
+	cmd="cd $(PERF) && cp tests/configs/$@ .config && make -f $(MK) JOBS=1 DESTDIR=$$TMP_DEST $($@)"; \
+	echo "- $@: $$cmd" && echo $$cmd > $@ && \
+	( eval $$cmd ) >> $@ 2>&1; \
+	echo "  test: $(call test,$@)" >> $@ 2>&1; \
+	$(call test,$@) && \
+	rm -f $@ \
+	rm -rf $$TMP_DEST
+
 tarpkg:
 	@cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1
-	
 
-all: $(run) $(run_O) tarpkg
+all: $(run) $(run_O) $(run_CONFIGS) tarpkg
 	@echo OK
 
 out: $(run_O)
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index b21e02a..7079459 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -79,11 +79,13 @@ void setup_browser(bool fallback_to_pager)
 		       PERF_GTK_DSO);
 		sleep(1);
 		/* fall through */
+#ifdef CONFIG_TUI
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
 		/* fall through */
+#endif
 	default:
 		use_browser = 0;
 		if (fallback_to_pager)
@@ -100,11 +102,11 @@ void exit_browser(bool wait_for_ok __maybe_unused)
 	case 2:
 		exit_gtk_browser(wait_for_ok);
 		break;
-
+#ifdef CONFIG_TUI
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-
+#endif
 	default:
 		break;
 	}
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 8fac37e..234937f 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -53,9 +53,10 @@ obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
 obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
 
 obj-$(CONFIG_LIBELF) += symbol-elf.o
-obj-$(CONFIG_LIBELF) += dwarf-aux.o
 obj-$(CONFIG_LIBELF) += probe-event.o
-obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBDWARF) += dwarf-aux.o
+obj-$(CONFIG_LIBDWARF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
@@ -76,7 +77,7 @@ obj-y += trace-event-parse.o
 obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
 obj-y += trace-event-read.o
 
-obj-y += scripting-engines/
+obj-$(CONFIG_BUILTIN_SCRIPT) += scripting-engines/
 
 define bison
 $(Q)echo '  BI      $@'
@@ -101,6 +102,8 @@ $(obj)/parse-events-flex.c: $(src)/parse-events.l $(obj)/parse-events-bison.c
 $(src)/parse-events-flex.o: $(src)/parse-events-flex.c
 $(src)/parse-events-bison.o: $(src)/parse-events-bison.c
 
+$(src)/parse-events.o: $(src)/parse-events-flex.o
+
 $(src)/pmu-bison.c: $(src)/pmu.y
 	$(call bison,perf_pmu_)
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 28/34] perf kbuild: fix installation of traceevent plugins
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (26 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 27/34] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 29/34] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
                   ` (7 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Makefile.kbuild | 10 +++++++---
 tools/perf/config/Makefile |  1 +
 tools/perf/tests/make      |  3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 2f980f7..5c034ad 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -92,7 +92,7 @@ export src-perf obj-perf
 
 OUTPUT := $(obj-perf)/
 
-export OUTPUT
+export OUTPUT DESTDIR
 
 AS      = as
 LD      = ld
@@ -214,6 +214,7 @@ export PARSER_DEBUG_BISON
 export PARSER_DEBUG_FLEX
 export ETC_PERFCONFIG_SQ
 export libdir_SQ
+export plugindir_SQ
 export PYTHON_EMBED_CCOPTS
 export PERL_EMBED_CCOPTS
 export GTK_CFLAGS
@@ -276,6 +277,9 @@ $(LIBTRACEEVENT)-clean: FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
 	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
 
+$(LIBTRACEEVENT)-install: $(LIBTRACEEVENT) FORCE
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent plugin_dir=$(plugindir_SQ) install
+
 $(LIBAPIKFS): FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/api
 	$(Q)$(MAKE) -C $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api
@@ -335,13 +339,13 @@ install-bin: all
 	$(INSTALL) $(src-perf)/scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
 	$(INSTALL) $(src-perf)/scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
-	$(INSTALL) $(src-perf)/bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+	$(INSTALL) $(src-perf)/perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
 	$(INSTALL) $(src-perf)/tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
 	$(INSTALL) $(src-perf)/tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
 
-install: install-bin try-install-man
+install: install-bin try-install-man $(LIBTRACEEVENT)-install
 
 DOC_TARGETS := doc man html info pdf
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index b043c0e..ccade54 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -759,6 +759,7 @@ all:
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
 	$(call store,libdir_SQ)
+	$(call store,plugindir_SQ)
 	$(call store,perfexec_instdir_SQ)
 	$(call store,sysconfdir_SQ)
 	$(call store,GTK_CFLAGS)
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 2aa2ed7..fa60836 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -15,6 +15,7 @@ list = $(shell ls $1 2>/dev/null)
 has = $(shell which $1 2>/dev/null)
 
 # standard single make variable specified
+make_pure           := 
 make_clean_all      := clean all
 make_python_perf_so := python/perf.so
 make_tags           := tags
@@ -142,7 +143,7 @@ test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
 test_default = test -x $(PERF)/perf
 test = $(if $(test_$1),$(test_$1),$(test_default))
 
-test_default_O = test -x $$TMP_O/perf
+test_default_O = test -x $$TMP_O/tools/perf/perf
 test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
 
 all:
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 29/34] perf kbuild: fix tarpkg target in tests/make
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (27 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 28/34] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 30/34] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
                   ` (6 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/MANIFEST | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index c0c87c8..dcb06e8 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -1,3 +1,4 @@
+scripts
 tools/perf
 tools/scripts
 tools/lib/traceevent
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 30/34] perf kbuild: update Kbuild files with new and removed sources
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (28 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 29/34] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 31/34] perf kbuild: update build test configurations Alexis Berlemont
                   ` (5 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/bench/Kbuild | 3 +++
 tools/perf/util/Kbuild  | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
index 57f87e8..863646a 100644
--- a/tools/perf/bench/Kbuild
+++ b/tools/perf/bench/Kbuild
@@ -2,6 +2,9 @@ obj-y += mem-memcpy.o
 obj-y += mem-memset.o
 obj-y += sched-messaging.o
 obj-y += sched-pipe.o
+obj-y += futex-hash.o
+obj-y += futex-requeue.o
+obj-y += futex-wake.o
 
 obj-$(CONFIG_LIBNUMA) += numa.o
 
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 234937f..6e02080 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -48,6 +48,8 @@ obj-y += string.o
 obj-y += strlist.o
 obj-y += svghelper.o
 obj-y += symbol.o
+obj-y += perf_regs.o
+
 
 obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
 obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
@@ -60,7 +62,6 @@ obj-$(CONFIG_LIBDWARF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
-obj-y += fs.o
 obj-y += target.o
 obj-y += thread.o
 obj-y += thread_map.o
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 31/34] perf kbuild: update build test configurations
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (29 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 30/34] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 32/34] perf kbuild: relocate the configs generating script Alexis Berlemont
                   ` (4 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Makefile.kbuild                         |  2 +-
 tools/perf/tests/configs/MINIMAL_config            |  4 +++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  2 ++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  2 ++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  2 ++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  | 11 ++------
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  6 ++--
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  2 ++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  2 ++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  2 ++
 tools/perf/tests/configs/NO_GTK2_config            |  2 ++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  2 ++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  1 +
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  2 ++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  2 ++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  3 +-
 tools/perf/tests/configs/NO_LIBNUMA_config         |  2 ++
 tools/perf/tests/configs/NO_LIBPERL_config         |  2 ++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  2 ++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  2 ++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  2 ++
 tools/perf/tests/configs/NO_STDIO_config           |  2 ++
 tools/perf/tests/configs/NO_TIMERFD_config         |  2 ++
 tools/perf/tests/configs/NO_TUI_config             |  2 ++
 .../{NO_LIBUNWIND_config => NO_UNWIND_config}      |  2 +-
 tools/perf/tests/configs/REF_config                |  2 ++
 tools/perf/tests/configs/generate.py               | 33 ++++++++++++++++++++++
 tools/perf/tests/make                              |  7 +++--
 45 files changed, 123 insertions(+), 22 deletions(-)
 rename tools/perf/tests/configs/{NO_LIBUNWIND_config => NO_UNWIND_config} (97%)
 create mode 100644 tools/perf/tests/configs/generate.py

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 5c034ad..f3bffdf 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -262,7 +262,7 @@ $(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/comm
 PHONY += all scripts_basic
 
 $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
-	$(Q)$(MAKE) $(build)=tools/perf
+	$(Q)$(MAKE) LDFLAGS="" $(build)=tools/perf
 
 LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
diff --git a/tools/perf/tests/configs/MINIMAL_config b/tools/perf/tests/configs/MINIMAL_config
index 722282a..6e04dc6 100644
--- a/tools/perf/tests/configs/MINIMAL_config
+++ b/tools/perf/tests/configs/MINIMAL_config
@@ -43,8 +43,12 @@ CONFIG_STDIO=y
 # CONFIG_LIBPYTHON is not set
 # CONFIG_TIMERFD is not set
 CONFIG_ON_EXIT=y
+# CONFIG_LIBBFD is not set
+# CONFIG_LIBIBERTY_ONLY is not set
 # CONFIG_LIBELF is not set
 CONFIG_LIBELF_MINIMAL=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_LIBDWARF_UNWIND is not set
 # CONFIG_LIBNUMA is not set
 # CONFIG_BIONIC is not set
 
diff --git a/tools/perf/tests/configs/NO_BACKTRACE_config b/tools/perf/tests/configs/NO_BACKTRACE_config
index f44b4f9..ea186e2 100644
--- a/tools/perf/tests/configs/NO_BACKTRACE_config
+++ b/tools/perf/tests/configs/NO_BACKTRACE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
index 5fdce32..5f87818 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
index 99d601e..1597197 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
index edcee97..6d3c29f 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
index 3043178..a4d048a 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
index f553f96..c780d43 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
index 8198a9d..95f11fb 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_HELP_config b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
index d897913..76753a9 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_HELP_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
index 3322780..2052081 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
index 0cb7cba..bda50b7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KVM_config b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
index d7849bc..4dee035 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_KVM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
index 3eed298d..e58f913 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_LIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
index 6347efd..f8f362d 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_MEM_config b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
index d432c6a..d1288e94 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_MEM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
index 6dd2f14..7d51c98 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
index e5bca7c..8e15038 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
@@ -5,8 +5,6 @@
 # CONFIG_BUILTIN_RECORD is not set
 CONFIG_BUILTIN_REPORT=y
 CONFIG_BUILTIN_STAT=y
-CONFIG_BUILTIN_TOP=y
-CONFIG_BUILTIN_TRACE=y
 CONFIG_BUILTIN_ANNOTATE=y
 CONFIG_BUILTIN_BENCH=y
 CONFIG_BUILTIN_BUILDID_CACHE=y
@@ -15,15 +13,8 @@ CONFIG_BUILTIN_DIFF=y
 CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
-CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
-CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
-CONFIG_BUILTIN_SCHED=y
-CONFIG_BUILTIN_SCRIPT=y
-CONFIG_BUILTIN_TIMECHART=y
-CONFIG_BUILTIN_MEM=y
 CONFIG_BUILTIN_TEST=y
 
 #
@@ -53,7 +44,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
index 1d27667..369e951 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
@@ -5,7 +5,6 @@
 CONFIG_BUILTIN_RECORD=y
 # CONFIG_BUILTIN_REPORT is not set
 CONFIG_BUILTIN_STAT=y
-CONFIG_BUILTIN_TOP=y
 CONFIG_BUILTIN_TRACE=y
 CONFIG_BUILTIN_ANNOTATE=y
 CONFIG_BUILTIN_BENCH=y
@@ -16,14 +15,11 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
-CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
 CONFIG_BUILTIN_SCHED=y
 CONFIG_BUILTIN_SCRIPT=y
 CONFIG_BUILTIN_TIMECHART=y
-CONFIG_BUILTIN_MEM=y
 CONFIG_BUILTIN_TEST=y
 
 #
@@ -53,7 +49,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
index 7944d9b..deda613 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
index 52d4121..fb8cd00 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_STAT_config b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
index 2486420..b0d35f7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_STAT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TEST_config b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
index 1c52914..7270364 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TEST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
index 143a60d..41d21f9 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TOP_config b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
index 188bcf2..fa231f7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TOP_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
index 114d210..8ca377b 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_DEMANGLE_config b/tools/perf/tests/configs/NO_DEMANGLE_config
index 2aaaf20..e2a79e3 100644
--- a/tools/perf/tests/configs/NO_DEMANGLE_config
+++ b/tools/perf/tests/configs/NO_DEMANGLE_config
@@ -51,7 +51,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_GTK2_config b/tools/perf/tests/configs/NO_GTK2_config
index e1989c2..a806529 100644
--- a/tools/perf/tests/configs/NO_GTK2_config
+++ b/tools/perf/tests/configs/NO_GTK2_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBAUDIT_config b/tools/perf/tests/configs/NO_LIBAUDIT_config
index b8fa6a2..57f2b8b 100644
--- a/tools/perf/tests/configs/NO_LIBAUDIT_config
+++ b/tools/perf/tests/configs/NO_LIBAUDIT_config
@@ -52,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBDWARF_config b/tools/perf/tests/configs/NO_LIBDWARF_config
index a5e33a1..fed5c65 100644
--- a/tools/perf/tests/configs/NO_LIBDWARF_config
+++ b/tools/perf/tests/configs/NO_LIBDWARF_config
@@ -52,6 +52,7 @@ CONFIG_LIBELF=y
 CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 # CONFIG_LIBDWARF is not set
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
diff --git a/tools/perf/tests/configs/NO_LIBELF_MMAP_config b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
index d8755ea..b774b34 100644
--- a/tools/perf/tests/configs/NO_LIBELF_MMAP_config
+++ b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
index 81cd6a2..272087c 100644
--- a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
+++ b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_config b/tools/perf/tests/configs/NO_LIBGTK2_config
index a52e89d..d4324ac 100644
--- a/tools/perf/tests/configs/NO_LIBGTK2_config
+++ b/tools/perf/tests/configs/NO_LIBGTK2_config
@@ -31,7 +31,6 @@ CONFIG_BUILTIN_TEST=y
 #
 CONFIG_STDIO=y
 CONFIG_TUI=y
-CONFIG_GTK2=y
 
 #
 # Libraries / Dependencies
@@ -52,7 +51,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBNUMA_config b/tools/perf/tests/configs/NO_LIBNUMA_config
index 9b3c1f8..a3492dc 100644
--- a/tools/perf/tests/configs/NO_LIBNUMA_config
+++ b/tools/perf/tests/configs/NO_LIBNUMA_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 # CONFIG_LIBNUMA is not set
diff --git a/tools/perf/tests/configs/NO_LIBPERL_config b/tools/perf/tests/configs/NO_LIBPERL_config
index 4c6d6be..e430e7e 100644
--- a/tools/perf/tests/configs/NO_LIBPERL_config
+++ b/tools/perf/tests/configs/NO_LIBPERL_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBPYTHON_config b/tools/perf/tests/configs/NO_LIBPYTHON_config
index 6624bbf..9bddfcf 100644
--- a/tools/perf/tests/configs/NO_LIBPYTHON_config
+++ b/tools/perf/tests/configs/NO_LIBPYTHON_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBSLANG_config b/tools/perf/tests/configs/NO_LIBSLANG_config
index 5bc0f98..deebd36 100644
--- a/tools/perf/tests/configs/NO_LIBSLANG_config
+++ b/tools/perf/tests/configs/NO_LIBSLANG_config
@@ -52,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
index ca571d3..03bc63b 100644
--- a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 # CONFIG_LIBUNWIND_DEBUG_FRAME is not set
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_STDIO_config b/tools/perf/tests/configs/NO_STDIO_config
index 2f92b2d..48889d9 100644
--- a/tools/perf/tests/configs/NO_STDIO_config
+++ b/tools/perf/tests/configs/NO_STDIO_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_TIMERFD_config b/tools/perf/tests/configs/NO_TIMERFD_config
index 4b54af8..dace6d9 100644
--- a/tools/perf/tests/configs/NO_TIMERFD_config
+++ b/tools/perf/tests/configs/NO_TIMERFD_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_TUI_config b/tools/perf/tests/configs/NO_TUI_config
index b95b982..55cd95b 100644
--- a/tools/perf/tests/configs/NO_TUI_config
+++ b/tools/perf/tests/configs/NO_TUI_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_config b/tools/perf/tests/configs/NO_UNWIND_config
similarity index 97%
rename from tools/perf/tests/configs/NO_LIBUNWIND_config
rename to tools/perf/tests/configs/NO_UNWIND_config
index 6cc2c7c..6a3fbc5 100644
--- a/tools/perf/tests/configs/NO_LIBUNWIND_config
+++ b/tools/perf/tests/configs/NO_UNWIND_config
@@ -53,7 +53,7 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
-# CONFIG_LIBUNWIND is not set
+# CONFIG_UNWIND is not set
 CONFIG_LIBNUMA=y
 # CONFIG_BIONIC is not set
 
diff --git a/tools/perf/tests/configs/REF_config b/tools/perf/tests/configs/REF_config
index bbaab9f..30d1c3d 100644
--- a/tools/perf/tests/configs/REF_config
+++ b/tools/perf/tests/configs/REF_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/generate.py b/tools/perf/tests/configs/generate.py
new file mode 100644
index 0000000..68954d0
--- /dev/null
+++ b/tools/perf/tests/configs/generate.py
@@ -0,0 +1,33 @@
+import sys
+import itertools
+import kconfiglib
+
+# Load Kconfig pattern
+ref_config = kconfiglib.Config(sys.argv[1])
+
+# Generate defconfig (by default, all options are set to y)
+ref_config.write_config('REF_config')
+
+# Get all the symbols
+symbols = dict([(s.get_name(), s) for s in ref_config.get_symbols()])
+
+# Remove odd symbols
+symbols.pop('y', None)
+symbols.pop('m', None)
+symbols.pop('n', None)
+
+# Remove choice-related symbols
+choices = ref_config.get_choices()
+items = [c.get_items() for c in choices]
+names = [i.get_name() for i in itertools.chain.from_iterable(items)]
+for name in names:
+    symbols.pop(name, None)
+    
+for name in symbols:
+    symbol = symbols[name]
+    if symbol.get_value() != 'y':
+        continue
+    symbol.set_user_value('n')
+    filename = 'NO_' + name + '_config'
+    ref_config.write_config(filename)
+    symbol.set_user_value('y')
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index fa60836..8b9bf01 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -44,7 +44,7 @@ run += make_install_bin
 # run += make_install_html
 # run += make_install_info
 # run += make_install_pdf
-run += make_static
+# run += make_static
 
 ifneq ($(call has,ctags),)
 run += make_tags
@@ -197,7 +197,10 @@ tarpkg:
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1
 
-all: $(run) $(run_O) $(run_CONFIGS) tarpkg
+#all: $(run) $(run_O) $(run_CONFIGS) tarpkg
+#	@echo OK
+
+all: $(run_CONFIGS) tarpkg
 	@echo OK
 
 out: $(run_O)
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 32/34] perf kbuild: relocate the configs generating script
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (30 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 31/34] perf kbuild: update build test configurations Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 33/34] perf kbuild: minor changes Alexis Berlemont
                   ` (3 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/tests/{configs/generate.py => generate_configs.py} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename tools/perf/tests/{configs/generate.py => generate_configs.py} (100%)

diff --git a/tools/perf/tests/configs/generate.py b/tools/perf/tests/generate_configs.py
similarity index 100%
rename from tools/perf/tests/configs/generate.py
rename to tools/perf/tests/generate_configs.py
-- 
1.9.2


^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 33/34] perf kbuild: minor changes
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (31 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 32/34] perf kbuild: relocate the configs generating script Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-13 22:03 ` [PATCH 34/34] perf kbuild: remove Makefile.perf Alexis Berlemont
                   ` (2 subsequent siblings)
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

* Correctly rename internal makefile variables
* Remove makefiles in tools/perf/config which became empty
---
 tools/perf/Makefile.kbuild            |  1 -
 tools/perf/arch/x86/Makefile          |  2 +-
 tools/perf/config/Makefile            | 40 +++++++++++++++++------------------
 tools/perf/config/Makefile.fix-config |  6 ------
 tools/perf/config/Makefile.fix-legacy |  2 --
 5 files changed, 21 insertions(+), 30 deletions(-)
 delete mode 100644 tools/perf/config/Makefile.fix-config
 delete mode 100644 tools/perf/config/Makefile.fix-legacy

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index f3bffdf..1774bea 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -158,7 +158,6 @@ $(CONFIG_DETECTED): $(KCONFIG_CONFIG)
 # no need to include auto.conf.cmd, because .config
 # is the only dependency here
 $(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
-	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
 	$(Q)mkdir -p $(obj-perf)/include/config
 	$(Q)mkdir -p $(obj-perf)/include/generated
 	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index d37e641..f95187e 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,4 +1,4 @@
-ifeq ($(LIBDWARF), 1)
+ifeq ($(config-libdwarf), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index ccade54..d85500f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -38,7 +38,7 @@ endif
 ifeq ($(LIBUNWIND_LIBS),)
   $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
-  LIBUNWIND = 1
+  config-libunwind = 1
   #
   # For linking with debug library, run like:
   #
@@ -71,7 +71,7 @@ ifdef CONFIG_LIBELF
 endif
 
 ifdef KCONFIG_CONFIG
-include $(src-perf)/config/Makefile.fix-legacy
+include $(KCONFIG_CONFIG)
 endif
 
 # include ARCH specific config
@@ -275,12 +275,12 @@ endif
 ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
     ifeq ($(BIONIC),1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
-    ifeq ($(LIBC_SUPPORT),1)
+    ifeq ($(config-libc),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
       $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
@@ -288,13 +288,13 @@ ifdef CONFIG_LIBELF
       msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
     endif
   else
-    LIBELF = 1
+    config-libelf = 1
     ifdef CONFIG_LIBDWARF
       ifneq ($(feature-dwarf), 1)
         msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
       else
-        LIBDWARF = 1
+        config-libdwarf = 1
       endif # Dwarf support
       ifdef CONFIG_LIBDWARF_UNWIND
         # So far there's only x86 libdw unwind support merged in
@@ -306,7 +306,7 @@ ifdef CONFIG_LIBELF
             msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
             $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
           else
-            LIBDWARF_UNWIND = 1
+            config-libdwarf-unwind = 1
           endif # Dwarf unwind support
         else
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
@@ -316,7 +316,7 @@ ifdef CONFIG_LIBELF
   endif # libelf support
 endif # CONFIG_LIBELF
 
-ifeq ($(LIBELF), 1)
+ifeq ($(config-libelf), 1)
 
   ifdef CONFIG_LIBELF_MMAP
     ifneq ($(feature-libelf-mmap), 1)
@@ -324,16 +324,16 @@ ifeq ($(LIBELF), 1)
     endif
   endif
 
-  ifdef CONFIG_LIBELF_MMAP
+  ifdef CONFIG_LIBELF_GETPHDRNUM
     ifneq ($(feature-libelf-getphdrnum), 1)
-      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_GETPHDRNUM)
     endif
   endif
 
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifeq ($(LIBDWARF), 1)
+  ifeq ($(config-libdwarf), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
@@ -349,17 +349,17 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBUNWIND is the default choice; so, if it is not
   # available, let's try another one
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifneq ($(feature-libunwind), 1)
-        LIBUNWIND = 0
+        config-libunwind = 0
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
-        ifeq ($(LIBDWARF_UNWIND), 1)
+        ifeq ($(config-libdwarf-unwind), 1)
           msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
         else
           msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
-        endif # LIBDWARF_UNWIND
+        endif # config-libdwarf-unwind
       else # feature-libunwind OK
         EXTLIBS += $(LIBUNWIND_LIBS)
         CFLAGS += $(LIBUNWIND_CFLAGS)
@@ -371,7 +371,7 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
   # choice); so, we disable CONFIG_UNWIND if it is not available
   ifdef CONFIG_LIBDWARF_UNWIND
-    ifneq ($(LIBDWARF_UNWIND), 1)
+    ifneq ($(config-libdwarf-unwind), 1)
       msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
     endif
@@ -379,7 +379,7 @@ ifdef CONFIG_UNWIND
 
   # if libunwind is OK, let's check the option DEBUG_FRAME
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifeq ($(ARCH),arm)
         $(call feature_check,libunwind-debug-frame)
         ifneq ($(feature-libunwind-debug-frame), 1)
@@ -396,11 +396,11 @@ ifdef CONFIG_UNWIND
 dwarf-post-unwind = 0
 dwarf-post-unwind-text = BUG
 
-ifeq ($(LIBUNWIND), 1)
+ifeq ($(config-libunwind), 1)
   dwarf-post-unwind := 1
   dwarf-post-unwind-text := libunwind
 else
-  ifeq ($(LIBDWARF_UNWIND), 1)
+  ifeq ($(config-libdwarf-unwind), 1)
     dwarf-post-unwind := 1
     dwarf-post-unwind-text := libdw
   endif
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
deleted file mode 100644
index 3f0e33e..0000000
--- a/tools/perf/config/Makefile.fix-config
+++ /dev/null
@@ -1,6 +0,0 @@
-include $(CONFIG_DETECTED)
-include $(KCONFIG_CONFIG)
-
-CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
-
-all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
deleted file mode 100644
index 431c9bf..0000000
--- a/tools/perf/config/Makefile.fix-legacy
+++ /dev/null
@@ -1,2 +0,0 @@
-
-include $(KCONFIG_CONFIG)
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 34/34] perf kbuild: remove Makefile.perf
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (32 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 33/34] perf kbuild: minor changes Alexis Berlemont
@ 2014-05-13 22:03 ` Alexis Berlemont
  2014-05-14  2:15 ` [PATCH 00/34] perf and kconfig / kbuild David Ahern
  2014-05-15  8:05 ` [PATCH 00/34] perf and kconfig / kbuild Jiri Olsa
  35 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-13 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, acme, dsahern, mingo

---
 tools/perf/Makefile.perf | 930 -----------------------------------------------
 1 file changed, 930 deletions(-)
 delete mode 100644 tools/perf/Makefile.perf

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
deleted file mode 100644
index 5c666b87..0000000
--- a/tools/perf/Makefile.perf
+++ /dev/null
@@ -1,930 +0,0 @@
-include ../scripts/Makefile.include
-
-# The default target of this Makefile is...
-all:
-
-include config/utilities.mak
-
-# Define V to have a more verbose compile.
-#
-# Define VF to have a more verbose feature check output.
-#
-# Define O to save output files in a separate directory.
-#
-# Define ARCH as name of target architecture if you want cross-builds.
-#
-# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
-#
-# Define NO_LIBPERL to disable perl script extension.
-#
-# Define NO_LIBPYTHON to disable python script extension.
-#
-# Define PYTHON to point to the python binary if the default
-# `python' is not correct; for example: PYTHON=python2
-#
-# Define PYTHON_CONFIG to point to the python-config binary if
-# the default `$(PYTHON)-config' is not correct.
-#
-# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
-#
-# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
-#
-# Define LDFLAGS=-static to build a static binary.
-#
-# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
-#
-# Define NO_DWARF if you do not want debug-info analysis feature at all.
-#
-# Define WERROR=0 to disable treating any warnings as errors.
-#
-# Define NO_NEWT if you do not want TUI support. (deprecated)
-#
-# Define NO_SLANG if you do not want TUI support.
-#
-# Define NO_GTK2 if you do not want GTK+ GUI support.
-#
-# Define NO_DEMANGLE if you do not want C++ symbol demangling.
-#
-# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
-#
-# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
-# backtrace post unwind.
-#
-# Define NO_BACKTRACE if you do not want stack backtrace debug feature
-#
-# Define NO_LIBNUMA if you do not want numa perf benchmark
-#
-# Define NO_LIBAUDIT if you do not want libaudit support
-#
-# Define NO_LIBBIONIC if you do not want bionic support
-#
-# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
-# for dwarf backtrace post unwind.
-
-ifeq ($(srctree),)
-srctree := $(patsubst %/,%,$(dir $(shell pwd)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
-#$(info Determined 'srctree' to be $(srctree))
-endif
-
-ifneq ($(objtree),)
-#$(info Determined 'objtree' to be $(objtree))
-endif
-
-ifneq ($(OUTPUT),)
-#$(info Determined 'OUTPUT' to be $(OUTPUT))
-endif
-
-$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
-	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
-	@touch $(OUTPUT)PERF-VERSION-FILE
-
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-PKG_CONFIG = $(CROSS_COMPILE)pkg-config
-
-RM      = rm -f
-LN      = ln -f
-MKDIR   = mkdir
-FIND    = find
-INSTALL = install
-FLEX    = flex
-BISON   = bison
-STRIP   = strip
-
-LIB_DIR          = $(srctree)/tools/lib/api/
-TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
-
-# include config/Makefile by default and rule out
-# non-config cases
-config := 1
-
-NON_CONFIG_TARGETS := clean TAGS tags cscope help
-
-ifdef MAKECMDGOALS
-ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
-  config := 0
-endif
-endif
-
-ifeq ($(config),1)
-include config/Makefile
-endif
-
-export prefix bindir sharedir sysconfdir DESTDIR
-
-# sparse is architecture-neutral, which means that we need to tell it
-# explicitly what architecture to check for. Fix this up for yours..
-SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
-
-# Guard against environment variables
-BUILTIN_OBJS =
-LIB_H =
-LIB_OBJS =
-GTK_OBJS =
-PYRF_OBJS =
-SCRIPT_SH =
-
-SCRIPT_SH += perf-archive.sh
-
-grep-libs = $(filter -l%,$(1))
-strip-libs = $(filter-out -l%,$(1))
-
-ifneq ($(OUTPUT),)
-  TE_PATH=$(OUTPUT)
-ifneq ($(subdir),)
-  LIB_PATH=$(OUTPUT)/../lib/api/
-else
-  LIB_PATH=$(OUTPUT)
-endif
-else
-  TE_PATH=$(TRACE_EVENT_DIR)
-  LIB_PATH=$(LIB_DIR)
-endif
-
-LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
-export LIBTRACEEVENT
-
-LIBAPIKFS = $(LIB_PATH)libapikfs.a
-export LIBAPIKFS
-
-# python extension build directories
-PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
-PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
-PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
-export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
-
-python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
-
-PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
-PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPIKFS)
-
-$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
-	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
-	  --quiet build_ext; \
-	mkdir -p $(OUTPUT)python && \
-	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
-#
-# No Perl scripts right now:
-#
-
-SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
-
-#
-# Single 'perf' binary right now:
-#
-PROGRAMS += $(OUTPUT)perf
-
-# what 'all' will build and 'install' will install, in perfexecdir
-ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
-
-# what 'all' will build but not install in perfexecdir
-OTHER_PROGRAMS = $(OUTPUT)perf
-
-# Set paths to tools early so that they can be used for version tests.
-ifndef SHELL_PATH
-  SHELL_PATH = /bin/sh
-endif
-ifndef PERL_PATH
-  PERL_PATH = /usr/bin/perl
-endif
-
-export PERL_PATH
-
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
-
-$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
-	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
-
-$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
-
-$(OUTPUT)util/pmu-bison.c: util/pmu.y
-	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
-
-$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
-$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
-
-LIB_FILE=$(OUTPUT)libperf.a
-
-LIB_H += ../lib/symbol/kallsyms.h
-LIB_H += ../../include/uapi/linux/perf_event.h
-LIB_H += ../../include/linux/rbtree.h
-LIB_H += ../../include/linux/list.h
-LIB_H += ../../include/uapi/linux/const.h
-LIB_H += ../include/linux/hash.h
-LIB_H += ../../include/linux/stringify.h
-LIB_H += util/include/linux/bitmap.h
-LIB_H += util/include/linux/bitops.h
-LIB_H += ../include/linux/compiler.h
-LIB_H += util/include/linux/const.h
-LIB_H += util/include/linux/ctype.h
-LIB_H += util/include/linux/kernel.h
-LIB_H += util/include/linux/list.h
-LIB_H += util/include/linux/export.h
-LIB_H += util/include/linux/poison.h
-LIB_H += util/include/linux/rbtree.h
-LIB_H += util/include/linux/rbtree_augmented.h
-LIB_H += util/include/linux/string.h
-LIB_H += util/include/linux/types.h
-LIB_H += util/include/linux/linkage.h
-LIB_H += util/include/asm/asm-offsets.h
-LIB_H += ../include/asm/bug.h
-LIB_H += util/include/asm/byteorder.h
-LIB_H += util/include/asm/hweight.h
-LIB_H += util/include/asm/swab.h
-LIB_H += util/include/asm/system.h
-LIB_H += util/include/asm/uaccess.h
-LIB_H += util/include/dwarf-regs.h
-LIB_H += util/include/asm/dwarf2.h
-LIB_H += util/include/asm/cpufeature.h
-LIB_H += util/include/asm/unistd_32.h
-LIB_H += util/include/asm/unistd_64.h
-LIB_H += perf.h
-LIB_H += util/annotate.h
-LIB_H += util/cache.h
-LIB_H += util/callchain.h
-LIB_H += util/build-id.h
-LIB_H += util/debug.h
-LIB_H += util/pmu.h
-LIB_H += util/event.h
-LIB_H += util/evsel.h
-LIB_H += util/evlist.h
-LIB_H += util/exec_cmd.h
-LIB_H += util/types.h
-LIB_H += util/levenshtein.h
-LIB_H += util/machine.h
-LIB_H += util/map.h
-LIB_H += util/parse-options.h
-LIB_H += util/parse-events.h
-LIB_H += util/quote.h
-LIB_H += util/util.h
-LIB_H += util/xyarray.h
-LIB_H += util/header.h
-LIB_H += util/help.h
-LIB_H += util/session.h
-LIB_H += util/strbuf.h
-LIB_H += util/strlist.h
-LIB_H += util/strfilter.h
-LIB_H += util/svghelper.h
-LIB_H += util/tool.h
-LIB_H += util/run-command.h
-LIB_H += util/sigchain.h
-LIB_H += util/dso.h
-LIB_H += util/symbol.h
-LIB_H += util/color.h
-LIB_H += util/values.h
-LIB_H += util/sort.h
-LIB_H += util/hist.h
-LIB_H += util/comm.h
-LIB_H += util/thread.h
-LIB_H += util/thread_map.h
-LIB_H += util/trace-event.h
-LIB_H += util/probe-finder.h
-LIB_H += util/dwarf-aux.h
-LIB_H += util/probe-event.h
-LIB_H += util/pstack.h
-LIB_H += util/cpumap.h
-LIB_H += util/top.h
-LIB_H += $(ARCH_INCLUDE)
-LIB_H += util/cgroup.h
-LIB_H += $(LIB_INCLUDE)traceevent/event-parse.h
-LIB_H += util/target.h
-LIB_H += util/rblist.h
-LIB_H += util/intlist.h
-LIB_H += util/perf_regs.h
-LIB_H += util/unwind.h
-LIB_H += util/vdso.h
-LIB_H += ui/helpline.h
-LIB_H += ui/progress.h
-LIB_H += ui/util.h
-LIB_H += ui/ui.h
-LIB_H += util/data.h
-
-LIB_OBJS += $(OUTPUT)util/abspath.o
-LIB_OBJS += $(OUTPUT)util/alias.o
-LIB_OBJS += $(OUTPUT)util/annotate.o
-LIB_OBJS += $(OUTPUT)util/build-id.o
-LIB_OBJS += $(OUTPUT)util/config.o
-LIB_OBJS += $(OUTPUT)util/ctype.o
-LIB_OBJS += $(OUTPUT)util/pmu.o
-LIB_OBJS += $(OUTPUT)util/environment.o
-LIB_OBJS += $(OUTPUT)util/event.o
-LIB_OBJS += $(OUTPUT)util/evlist.o
-LIB_OBJS += $(OUTPUT)util/evsel.o
-LIB_OBJS += $(OUTPUT)util/exec_cmd.o
-LIB_OBJS += $(OUTPUT)util/help.o
-LIB_OBJS += $(OUTPUT)util/kallsyms.o
-LIB_OBJS += $(OUTPUT)util/levenshtein.o
-LIB_OBJS += $(OUTPUT)util/parse-options.o
-LIB_OBJS += $(OUTPUT)util/parse-events.o
-LIB_OBJS += $(OUTPUT)util/path.o
-LIB_OBJS += $(OUTPUT)util/rbtree.o
-LIB_OBJS += $(OUTPUT)util/bitmap.o
-LIB_OBJS += $(OUTPUT)util/hweight.o
-LIB_OBJS += $(OUTPUT)util/run-command.o
-LIB_OBJS += $(OUTPUT)util/quote.o
-LIB_OBJS += $(OUTPUT)util/strbuf.o
-LIB_OBJS += $(OUTPUT)util/string.o
-LIB_OBJS += $(OUTPUT)util/strlist.o
-LIB_OBJS += $(OUTPUT)util/strfilter.o
-LIB_OBJS += $(OUTPUT)util/top.o
-LIB_OBJS += $(OUTPUT)util/usage.o
-LIB_OBJS += $(OUTPUT)util/wrapper.o
-LIB_OBJS += $(OUTPUT)util/sigchain.o
-LIB_OBJS += $(OUTPUT)util/dso.o
-LIB_OBJS += $(OUTPUT)util/symbol.o
-LIB_OBJS += $(OUTPUT)util/symbol-elf.o
-LIB_OBJS += $(OUTPUT)util/color.o
-LIB_OBJS += $(OUTPUT)util/pager.o
-LIB_OBJS += $(OUTPUT)util/header.o
-LIB_OBJS += $(OUTPUT)util/callchain.o
-LIB_OBJS += $(OUTPUT)util/values.o
-LIB_OBJS += $(OUTPUT)util/debug.o
-LIB_OBJS += $(OUTPUT)util/machine.o
-LIB_OBJS += $(OUTPUT)util/map.o
-LIB_OBJS += $(OUTPUT)util/pstack.o
-LIB_OBJS += $(OUTPUT)util/session.o
-LIB_OBJS += $(OUTPUT)util/comm.o
-LIB_OBJS += $(OUTPUT)util/thread.o
-LIB_OBJS += $(OUTPUT)util/thread_map.o
-LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
-LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
-LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
-LIB_OBJS += $(OUTPUT)util/pmu-flex.o
-LIB_OBJS += $(OUTPUT)util/pmu-bison.o
-LIB_OBJS += $(OUTPUT)util/trace-event-read.o
-LIB_OBJS += $(OUTPUT)util/trace-event-info.o
-LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
-LIB_OBJS += $(OUTPUT)util/trace-event.o
-LIB_OBJS += $(OUTPUT)util/svghelper.o
-LIB_OBJS += $(OUTPUT)util/sort.o
-LIB_OBJS += $(OUTPUT)util/hist.o
-LIB_OBJS += $(OUTPUT)util/probe-event.o
-LIB_OBJS += $(OUTPUT)util/util.o
-LIB_OBJS += $(OUTPUT)util/xyarray.o
-LIB_OBJS += $(OUTPUT)util/cpumap.o
-LIB_OBJS += $(OUTPUT)util/cgroup.o
-LIB_OBJS += $(OUTPUT)util/target.o
-LIB_OBJS += $(OUTPUT)util/rblist.o
-LIB_OBJS += $(OUTPUT)util/intlist.o
-LIB_OBJS += $(OUTPUT)util/vdso.o
-LIB_OBJS += $(OUTPUT)util/stat.o
-LIB_OBJS += $(OUTPUT)util/record.o
-LIB_OBJS += $(OUTPUT)util/srcline.o
-LIB_OBJS += $(OUTPUT)util/data.o
-
-LIB_OBJS += $(OUTPUT)ui/setup.o
-LIB_OBJS += $(OUTPUT)ui/helpline.o
-LIB_OBJS += $(OUTPUT)ui/progress.o
-LIB_OBJS += $(OUTPUT)ui/util.o
-LIB_OBJS += $(OUTPUT)ui/hist.o
-LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
-
-LIB_OBJS += $(OUTPUT)arch/common.o
-
-LIB_OBJS += $(OUTPUT)tests/parse-events.o
-LIB_OBJS += $(OUTPUT)tests/dso-data.o
-LIB_OBJS += $(OUTPUT)tests/attr.o
-LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
-LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
-LIB_OBJS += $(OUTPUT)tests/perf-record.o
-LIB_OBJS += $(OUTPUT)tests/rdpmc.o
-LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
-LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
-LIB_OBJS += $(OUTPUT)tests/pmu.o
-LIB_OBJS += $(OUTPUT)tests/hists_link.o
-LIB_OBJS += $(OUTPUT)tests/python-use.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
-LIB_OBJS += $(OUTPUT)tests/task-exit.o
-LIB_OBJS += $(OUTPUT)tests/sw-clock.o
-ifeq ($(ARCH),x86)
-LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
-endif
-LIB_OBJS += $(OUTPUT)tests/code-reading.o
-LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
-LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
-ifndef NO_DWARF_UNWIND
-ifeq ($(ARCH),x86)
-LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o
-endif
-endif
-
-BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
-BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
-# Benchmark modules
-BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
-BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
-ifeq ($(RAW_ARCH),x86_64)
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
-endif
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
-
-BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
-BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
-BUILTIN_OBJS += $(OUTPUT)builtin-help.o
-BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
-BUILTIN_OBJS += $(OUTPUT)builtin-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-record.o
-BUILTIN_OBJS += $(OUTPUT)builtin-report.o
-BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
-BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
-BUILTIN_OBJS += $(OUTPUT)builtin-top.o
-BUILTIN_OBJS += $(OUTPUT)builtin-script.o
-BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
-BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
-BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
-BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
-BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
-
-PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT)
-
-# We choose to avoid "if .. else if .. else .. endif endif"
-# because maintaining the nesting to match is a pain.  If
-# we had "elif" things would have been much nicer...
-
--include arch/$(ARCH)/Makefile
-
-ifneq ($(OUTPUT),)
-  CFLAGS += -I$(OUTPUT)
-endif
-
-ifdef NO_LIBELF
-EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
-
-# Remove ELF/DWARF dependent codes
-LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
-
-BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
-
-# Use minimal symbol handling
-LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
-
-else # NO_LIBELF
-ifndef NO_DWARF
-  LIB_OBJS += $(OUTPUT)util/probe-finder.o
-  LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
-endif # NO_DWARF
-endif # NO_LIBELF
-
-ifndef NO_LIBDW_DWARF_UNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libdw.o
-  LIB_H += util/unwind-libdw.h
-endif
-
-ifndef NO_LIBUNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o
-endif
-LIB_OBJS += $(OUTPUT)tests/keep-tracking.o
-
-ifndef NO_LIBAUDIT
-  BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
-endif
-
-ifndef NO_SLANG
-  LIB_OBJS += $(OUTPUT)ui/browser.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/map.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/header.o
-  LIB_OBJS += $(OUTPUT)ui/tui/setup.o
-  LIB_OBJS += $(OUTPUT)ui/tui/util.o
-  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
-  LIB_OBJS += $(OUTPUT)ui/tui/progress.o
-  LIB_H += ui/tui/tui.h
-  LIB_H += ui/browser.h
-  LIB_H += ui/browsers/map.h
-  LIB_H += ui/keysyms.h
-  LIB_H += ui/libslang.h
-endif
-
-ifndef NO_GTK2
-  ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
-
-  GTK_OBJS += $(OUTPUT)ui/gtk/browser.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/hists.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/setup.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/util.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/helpline.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/progress.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/annotate.o
-
-install-gtk: $(OUTPUT)libperf-gtk.so
-	$(call QUIET_INSTALL, 'GTK UI') \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
-		$(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
-endif
-
-ifndef NO_LIBPERL
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
-  LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
-endif
-
-ifndef NO_LIBPYTHON
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-  LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-endif
-
-ifeq ($(NO_PERF_REGS),0)
-  ifeq ($(ARCH),x86)
-    LIB_H += arch/x86/include/perf_regs.h
-  endif
-  LIB_OBJS += $(OUTPUT)util/perf_regs.o
-endif
-
-ifndef NO_LIBNUMA
-  BUILTIN_OBJS += $(OUTPUT)bench/numa.o
-endif
-
-ifdef ASCIIDOC8
-  export ASCIIDOC8
-endif
-
-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
-
-export INSTALL SHELL_PATH
-
-### Build rules
-
-SHELL = $(SHELL_PATH)
-
-all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
-
-please_set_SHELL_PATH_to_a_more_modern_shell:
-	@$$(:)
-
-shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
-
-strip: $(PROGRAMS) $(OUTPUT)perf
-	$(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
-
-$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		$(CFLAGS) -c $(filter %.c,$^) -o $@
-
-$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
-               $(BUILTIN_OBJS) $(LIBS) -o $@
-
-$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H)
-	$(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
-
-$(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS)
-
-$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
-
-$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
-
-$(SCRIPTS) : % : %.sh
-	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
-
-# These can record PERF_VERSION
-$(OUTPUT)perf.o perf.spec \
-	$(SCRIPTS) \
-	: $(OUTPUT)PERF-VERSION-FILE
-
-.SUFFIXES:
-
-#
-# If a target does not match any of the later rules then prefix it by $(OUTPUT)
-# This makes targets like 'make O=/tmp/perf perf.o' work in a natural way.
-#
-ifneq ($(OUTPUT),)
-%.o: $(OUTPUT)%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-util/%.o: $(OUTPUT)util/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-bench/%.o: $(OUTPUT)bench/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-tests/%.o: $(OUTPUT)tests/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-endif
-
-# These two need to be here so that when O= is not used they take precedence
-# over the general rule for .o
-
-$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
-
-$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
-
-$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
-$(OUTPUT)%.o: %.S
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.s: %.S
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-
-$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
-		'-DPREFIX="$(prefix_SQ)"' \
-		$<
-
-$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		-DPYTHONPATH='"$(OUTPUT)python"' \
-		-DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/dwarf-unwind.o: tests/dwarf-unwind.c
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -fno-optimize-sibling-calls $<
-
-$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)ui/setup.o: ui/setup.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DLIBDIR='"$(libdir_SQ)"' $<
-
-$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-
-$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
-
-$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
-
-$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
-
-$(OUTPUT)perf-%: %.o $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
-
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
-$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
-
-# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
-# we depend the various files onto their directories.
-DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS)
-DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
-# no need to add flex objects, because they depend on bison ones
-DIRECTORY_DEPS += $(OUTPUT)util/parse-events-bison.c
-DIRECTORY_DEPS += $(OUTPUT)util/pmu-bison.c
-
-OUTPUT_DIRECTORIES := $(sort $(dir $(DIRECTORY_DEPS)))
-
-$(DIRECTORY_DEPS): | $(OUTPUT_DIRECTORIES)
-# In the second step, we make a rule to actually create these directories
-$(OUTPUT_DIRECTORIES):
-	$(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
-
-$(LIB_FILE): $(LIB_OBJS)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
-
-# libtraceevent.a
-TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch])
-
-LIBTRACEEVENT_FLAGS  = $(QUIET_SUBDIR1) O=$(OUTPUT)
-LIBTRACEEVENT_FLAGS += CFLAGS="-g -Wall $(EXTRA_CFLAGS)"
-LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
-
-$(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins
-
-$(LIBTRACEEVENT)-clean:
-	$(call QUIET_CLEAN, libtraceevent)
-	@$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
-
-install-traceevent-plugins: $(LIBTRACEEVENT)
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) install_plugins
-
-LIBAPIKFS_SOURCES = $(wildcard $(LIB_PATH)fs/*.[ch])
-
-# if subdir is set, we've been called from above so target has been built
-# already
-$(LIBAPIKFS): $(LIBAPIKFS_SOURCES)
-ifeq ($(subdir),)
-	$(QUIET_SUBDIR0)$(LIB_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libapikfs.a
-endif
-
-$(LIBAPIKFS)-clean:
-ifeq ($(subdir),)
-	$(call QUIET_CLEAN, libapikfs)
-	@$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
-endif
-
-help:
-	@echo 'Perf make targets:'
-	@echo '  doc		- make *all* documentation (see below)'
-	@echo '  man		- make manpage documentation (access with man <foo>)'
-	@echo '  html		- make html documentation'
-	@echo '  info		- make GNU info documentation (access with info <foo>)'
-	@echo '  pdf		- make pdf documentation'
-	@echo '  TAGS		- use etags to make tag information for source browsing'
-	@echo '  tags		- use ctags to make tag information for source browsing'
-	@echo '  cscope	- use cscope to make interactive browsing database'
-	@echo ''
-	@echo 'Perf install targets:'
-	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
-	@echo '  HINT: use "make prefix=<path> <install target>" to install to a particular'
-	@echo '        path like make prefix=/usr/local install install-doc'
-	@echo '  install	- install compiled binaries'
-	@echo '  install-doc	- install *all* documentation'
-	@echo '  install-man	- install manpage documentation'
-	@echo '  install-html	- install html documentation'
-	@echo '  install-info	- install GNU info documentation'
-	@echo '  install-pdf	- install pdf documentation'
-	@echo ''
-	@echo '  quick-install-doc	- alias for quick-install-man'
-	@echo '  quick-install-man	- install the documentation quickly'
-	@echo '  quick-install-html	- install the html documentation quickly'
-	@echo ''
-	@echo 'Perf maintainer targets:'
-	@echo '  clean			- clean all binary objects and build output'
-
-
-DOC_TARGETS := doc man html info pdf
-
-INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
-INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
-
-# 'make doc' should call 'make -C Documentation all'
-$(DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
-
-TAGS:
-	$(RM) TAGS
-	$(FIND) . -name '*.[hcS]' -print | xargs etags -a
-
-tags:
-	$(RM) tags
-	$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
-
-cscope:
-	$(RM) cscope*
-	$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
-
-### Detect prefix changes
-TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
-             $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):$(plugindir_SQ)
-
-$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
-	@FLAGS='$(TRACK_CFLAGS)'; \
-	    if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
-		echo 1>&2 "  FLAGS:   * new build flags or prefix"; \
-		echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
-            fi
-
-### Testing rules
-
-# GNU make supports exporting all variables by "export" without parameters.
-# However, the environment gets quite big, and some programs have problems
-# with that.
-
-check: $(OUTPUT)common-cmds.h
-	if sparse; \
-	then \
-		for i in *.c */*.c; \
-		do \
-			sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
-		done; \
-	else \
-		exit 1; \
-	fi
-
-### Installation rules
-
-install-gtk:
-
-install-bin: all install-gtk
-	$(call QUIET_INSTALL, binaries) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
-	$(call QUIET_INSTALL, libexec) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-	$(call QUIET_INSTALL, perf-archive) \
-		$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-ifndef NO_LIBPERL
-	$(call QUIET_INSTALL, perl-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \
-		$(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
-endif
-ifndef NO_LIBPYTHON
-	$(call QUIET_INSTALL, python-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \
-		$(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \
-		$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
-endif
-	$(call QUIET_INSTALL, perf_completion-script) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
-		$(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
-	$(call QUIET_INSTALL, tests) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
-		$(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
-
-install: install-bin try-install-man install-traceevent-plugins
-
-install-python_ext:
-	$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
-
-# 'make install-doc' should call 'make -C Documentation install'
-$(INSTALL_DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
-
-### Cleaning rules
-
-#
-# This is here, not in config/Makefile, because config/Makefile does
-# not get included for the clean target:
-#
-config-clean:
-	$(call QUIET_CLEAN, config)
-	@$(MAKE) -C config/feature-checks clean >/dev/null
-
-clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
-	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
-	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
-	$(python-clean)
-
-#
-# Trick: if ../../.git does not exist - we are building out of tree for example,
-# then force version regeneration:
-#
-ifeq ($(wildcard ../../.git/HEAD),)
-    GIT-HEAD-PHONY = ../../.git/HEAD
-else
-    GIT-HEAD-PHONY =
-endif
-
-.PHONY: all install clean config-clean strip install-gtk
-.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS
-
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* Re: [PATCH 00/34] perf and kconfig / kbuild
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (33 preceding siblings ...)
  2014-05-13 22:03 ` [PATCH 34/34] perf kbuild: remove Makefile.perf Alexis Berlemont
@ 2014-05-14  2:15 ` David Ahern
  2014-05-17 15:39   ` Alexis Berlemont
  2014-05-15  8:05 ` [PATCH 00/34] perf and kconfig / kbuild Jiri Olsa
  35 siblings, 1 reply; 98+ messages in thread
From: David Ahern @ 2014-05-14  2:15 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel; +Cc: jolsa, acme, mingo

On 5/13/14, 4:02 PM, Alexis Berlemont wrote:
> Hello,
>
> A few months ago, I tried to make a proposal to introduce Kconfig in
> perf's generation procedure.
> (cf. https://lkml.org/lkml/2013/12/20/511)
>
> I started from David Ahern's work; I was not aware that Jiri Olsa
> pushed further the idea and proposed an alternative which integrated
> kbuild too.
>
> So, here is another proposal based on Jiri Olsa work (from April 2013).
> * Most of the NO_* and HAVE_* makefile variables were removed on
>    behalf of Kconfig's ones (CONFIG_*); perf source code was modified
>    accordingly;
> * These changes make the glue files tools/perf/config/Makefile.fix-* useless
> * The build test cases now relies on generated configuration files (in
>    tools/perf/tests/configs);
>

Thanks for picking this up. I skimmed through all of the patches and 
conceptually looks good. I doubt I will have time for a detailed review 
any time soon.

Looks like they apply to Linus' top of tree but with a few errors -- see 
below. You should always run checkpatch.pl before sending out:

Applying: kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
Applying: kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
Applying: perf tools: Kbuild builtin source related fixies
Applying: perf tools: Kbuild source related fixies
Applying: perf tools: Add kbuild support into Makefile.kbuild
Applying: perf kbuild: fix recursive invocation of config/features-checks
Applying: perf kbuild: store in config-detected missing variables 
(libdir, ...)
Applying: perf kbuild: remove useless #ifdef directives
Applying: perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
Applying: perf kbuild: add missing files and missing flags in Kbuild files
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:30: trailing 
whitespace.
CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:137: trailing 
whitespace.
CFLAGS_trace-event-perl.o   += -Wno-redundant-decls -Wno-strict-prototypes
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:138: trailing 
whitespace.
CFLAGS_trace-event-perl.o   += -Wno-unused-parameter -Wno-shadow -Wno-undef
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:143: trailing 
whitespace.
CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes
warning: 4 lines applied after fixing whitespace errors.
Applying: perf kbuild: update kbuild files according to last changes
Applying: perf kbuild: remove legacy slang-related build variables
Applying: perf kbuild: remove legacy libaudit-related build variables
Applying: perf kbuild: remove legacy libgtk2-related build variables
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:204: trailing 
whitespace.
#else
warning: 1 line applied after fixing whitespace errors.
Applying: perf kbuild: remove legacy libperl-related build variables
Applying: perf kbuild: remove legacy timerfd-related build variable
Applying: perf kbuild: remove legacy demangle-related build variables
Applying: perf kbuild: remove legacy on_exit-related build variable
Applying: perf kbuild: remove legacy backtrace-related build variable
Applying: perf kbuild: remove legacy numa-related build variable
Applying: perf kbuild: remove legacy bionic-related build variable
Applying: perf kbuild: remove legacy libelf-related build variables (1st 
part)
Applying: perf kbuild: remove legacy libelf-related build variables (2nd 
part)
Applying: perf kbuild: remove legacy libdwarf-related build variables
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:342: trailing 
whitespace.
       endif # CONFIG_LIBDWARF_UNWIND
warning: 1 line applied after fixing whitespace errors.
Applying: perf kbuild: remove legacy libunwind-related build variables
Applying: perf kbuild: remove legacy libpython-related build variable
Applying: perf kbuild: add generated Kconfig build-test cases
Applying: perf kbuild: fix installation of traceevent plugins
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:74: trailing 
whitespace.
make_pure           :=
warning: 1 line applied after fixing whitespace errors.
Applying: perf kbuild: fix tarpkg target in tests/make
Applying: perf kbuild: update Kbuild files with new and removed sources
Applying: perf kbuild: update build test configurations
/Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:773: trailing 
whitespace.

warning: 1 line applied after fixing whitespace errors.
Applying: perf kbuild: relocate the configs generating script
Applying: perf kbuild: minor changes
Applying: perf kbuild: remove Makefile.perf

David


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
  2014-05-13 22:02 ` [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Alexis Berlemont
@ 2014-05-14  5:00   ` Sam Ravnborg
  0 siblings, 0 replies; 98+ messages in thread
From: Sam Ravnborg @ 2014-05-14  5:00 UTC (permalink / raw)
  To: Alexis Berlemont
  Cc: linux-kernel, Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra,
	Ingo Molnar, Paul Mackerras, Corey Ashford, Frederic Weisbecker,
	Namhyung Kim, Borislav Petkov, Michal Marek, linux-kbuild,
	Stephane Eranian

On Wed, May 14, 2014 at 12:02:56AM +0200, Alexis Berlemont wrote:
> From: Jiri Olsa <jolsa@redhat.com>
> 
> Introducing KBUILD_AUTOCONF variable for auto.conf include
> allowing to specify custom auto.conf file.

What do you need this for?
And please remember to documet this variable in Documentation/kbuild/...

Have you considered to let kbuild use KCONFIG_AUTOCONFIG that is already
used by kconfig for the same purpose?

	Sam

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
  2014-05-13 22:02 ` [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Alexis Berlemont
@ 2014-05-14  5:02   ` Sam Ravnborg
  2014-05-14 10:17   ` Michal Marek
  1 sibling, 0 replies; 98+ messages in thread
From: Sam Ravnborg @ 2014-05-14  5:02 UTC (permalink / raw)
  To: Alexis Berlemont
  Cc: linux-kernel, Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra,
	Ingo Molnar, Paul Mackerras, Corey Ashford, Frederic Weisbecker,
	Namhyung Kim, Borislav Petkov, Michal Marek, linux-kbuild,
	Stephane Eranian

On Wed, May 14, 2014 at 12:02:57AM +0200, Alexis Berlemont wrote:
> From: Jiri Olsa <jolsa@redhat.com>
> 
> Introducing KCONFIG_AUTOCONFIGDEP variable for conf tool
> allowing to specify custom auto.conf.cmd file.

The change looks good at it complments what we already have of overrides.
But please document this in Documentation/kbuild/...

	Sam

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
  2014-05-13 22:02 ` [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Alexis Berlemont
  2014-05-14  5:02   ` Sam Ravnborg
@ 2014-05-14 10:17   ` Michal Marek
  1 sibling, 0 replies; 98+ messages in thread
From: Michal Marek @ 2014-05-14 10:17 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel
  Cc: Jiri Olsa, acme, dsahern, mingo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, linux-kbuild, Stephane Eranian

On 2014-05-14 00:02, Alexis Berlemont wrote:
> From: Jiri Olsa <jolsa@redhat.com>
> 
> Introducing KCONFIG_AUTOCONFIGDEP variable for conf tool
> allowing to specify custom auto.conf.cmd file.
> 
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: linux-kbuild@vger.kernel.org
> Cc: Stephane Eranian <eranian@google.com>
> ---
>  scripts/kconfig/confdata.c | 11 ++++++++++-
>  scripts/kconfig/lkc.h      |  1 +
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index f88d90f..7afb2a7 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -75,6 +75,14 @@ const char *conf_get_autoconfig_name(void)
>  	return name ? name : "include/config/auto.conf";
>  }
>  
> +const char *conf_get_autoconfigdep_name(void)
> +{
> +	char *name = getenv("KCONFIG_AUTOCONFIGDEP");
> +
> +	return name ? name : "include/config/auto.conf.cmd";
> +}

In both the kernel and perf usage case, the name of the dep file will be
$KCONFIG_AUTOCONFIG.dep. buildroot does not seem to use it at all. So
I'd just append the .cmd suffix here instead of introducing another knob.

Michal

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 00/34] perf and kconfig / kbuild
  2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
                   ` (34 preceding siblings ...)
  2014-05-14  2:15 ` [PATCH 00/34] perf and kconfig / kbuild David Ahern
@ 2014-05-15  8:05 ` Jiri Olsa
  35 siblings, 0 replies; 98+ messages in thread
From: Jiri Olsa @ 2014-05-15  8:05 UTC (permalink / raw)
  To: Alexis Berlemont; +Cc: linux-kernel, acme, dsahern, mingo

On Wed, May 14, 2014 at 12:02:55AM +0200, Alexis Berlemont wrote:
> Hello, 
> 
> A few months ago, I tried to make a proposal to introduce Kconfig in
> perf's generation procedure.
> (cf. https://lkml.org/lkml/2013/12/20/511)
> 
> I started from David Ahern's work; I was not aware that Jiri Olsa
> pushed further the idea and proposed an alternative which integrated
> kbuild too.

hi,
I'll try to review this till end of the week

thanks,
jirka

> 
> So, here is another proposal based on Jiri Olsa work (from April 2013). 
> * Most of the NO_* and HAVE_* makefile variables were removed on
>   behalf of Kconfig's ones (CONFIG_*); perf source code was modified
>   accordingly;
> * These changes make the glue files tools/perf/config/Makefile.fix-* useless
> * The build test cases now relies on generated configuration files (in
>   tools/perf/tests/configs); 
> 
> Hope this helps,
> 
> Alexis.
> 
> Alexis Berlemont (29):
>   perf kbuild: fix recursive invocation of config/features-checks
>   perf kbuild: store in config-detected missing variables (libdir, ...)
>   perf kbuild: remove useless #ifdef directives
>   perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
>   perf kbuild: add missing files and missing flags in Kbuild files
>   perf kbuild: update kbuild files according to last changes
>   perf kbuild: remove legacy slang-related build variables
>   perf kbuild: remove legacy libaudit-related build variables
>   perf kbuild: remove legacy libgtk2-related build variables
>   perf kbuild: remove legacy libperl-related build variables
>   perf kbuild: remove legacy timerfd-related build variable
>   perf kbuild: remove legacy demangle-related build variables
>   perf kbuild: remove legacy on_exit-related build variable
>   perf kbuild: remove legacy backtrace-related build variable
>   perf kbuild: remove legacy numa-related build variable
>   perf kbuild: remove legacy bionic-related build variable
>   perf kbuild: remove legacy libelf-related build variables (1st part)
>   perf kbuild: remove legacy libelf-related build variables (2nd part)
>   perf kbuild: remove legacy libdwarf-related build variables
>   perf kbuild: remove legacy libunwind-related build variables
>   perf kbuild: remove legacy libpython-related build variable
>   perf kbuild: add generated Kconfig build-test cases
>   perf kbuild: fix installation of traceevent plugins
>   perf kbuild: fix tarpkg target in tests/make
>   perf kbuild: update Kbuild files with new and removed sources
>   perf kbuild: update build test configurations
>   perf kbuild: relocate the configs generating script
>   perf kbuild: minor changes
>   perf kbuild: remove Makefile.perf
> 
> Jiri Olsa (5):
>   kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
>   kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
>   perf tools: Kbuild builtin source related fixies
>   perf tools: Kbuild source related fixies
>   perf tools: Add kbuild support into Makefile.kbuild
> 
>  scripts/Makefile.build                             |   3 +-
>  scripts/kconfig/confdata.c                         |  11 +-
>  scripts/kconfig/lkc.h                              |   1 +
>  tools/perf/Kbuild                                  |  47 ++
>  tools/perf/Kconfig                                 | 370 ++++++++
>  tools/perf/MANIFEST                                |   1 +
>  tools/perf/Makefile                                |   2 +-
>  tools/perf/Makefile.kbuild                         | 414 +++++++++
>  tools/perf/Makefile.perf                           | 930 ---------------------
>  tools/perf/arch/Kbuild                             |   3 +
>  tools/perf/arch/arm/Makefile                       |   4 +-
>  tools/perf/arch/powerpc/Makefile                   |   2 +-
>  tools/perf/arch/s390/Makefile                      |   2 +-
>  tools/perf/arch/sh/Makefile                        |   2 +-
>  tools/perf/arch/sparc/Makefile                     |   2 +-
>  tools/perf/arch/x86/Kbuild                         |   2 +
>  tools/perf/arch/x86/Makefile                       |   8 +-
>  tools/perf/arch/x86/tests/Kbuild                   |   2 +
>  tools/perf/arch/x86/util/Kbuild                    |   5 +
>  tools/perf/bench/Kbuild                            |  12 +
>  tools/perf/builtin-annotate.c                      |   8 +-
>  tools/perf/builtin-bench.c                         |   5 +-
>  tools/perf/builtin-cmds.h                          |  31 +
>  tools/perf/builtin-help.c                          |   1 +
>  tools/perf/builtin-inject.c                        |   2 +-
>  tools/perf/builtin-kvm.c                           |  32 +-
>  tools/perf/builtin-lock.c                          |   4 +-
>  tools/perf/builtin-mem.c                           |   3 +-
>  tools/perf/builtin-probe.c                         |  15 +-
>  tools/perf/builtin-record.c                        |  14 +-
>  tools/perf/builtin-report.c                        |   3 +
>  tools/perf/builtin-sched.c                         |   2 +
>  tools/perf/builtin-script.c                        |   6 +-
>  tools/perf/builtin-top.c                           |  15 +-
>  tools/perf/config/Makefile                         | 397 +++++----
>  tools/perf/config/defconfig                        |  54 ++
>  tools/perf/perf.c                                  |  53 +-
>  tools/perf/perf.h                                  |   2 +
>  tools/perf/scripts/perl/Perf-Trace-Util/Kbuild     |   3 +
>  tools/perf/scripts/python/Perf-Trace-Util/Kbuild   |   5 +
>  tools/perf/tests/Kbuild                            |  34 +
>  tools/perf/tests/builtin-test.c                    |   3 +-
>  tools/perf/tests/configs/MINIMAL_config            |  60 ++
>  tools/perf/tests/configs/NO_BACKTRACE_config       |  69 ++
>  .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  69 ++
>  .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  69 ++
>  .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  68 ++
>  tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  68 ++
>  tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  60 ++
>  tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  65 ++
>  tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  68 ++
>  tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  69 ++
>  .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  69 ++
>  tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  68 ++
>  tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  69 ++
>  tools/perf/tests/configs/NO_DEMANGLE_config        |  67 ++
>  tools/perf/tests/configs/NO_GTK2_config            |  69 ++
>  tools/perf/tests/configs/NO_LIBAUDIT_config        |  68 ++
>  tools/perf/tests/configs/NO_LIBDWARF_config        |  67 ++
>  tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  69 ++
>  tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  69 ++
>  tools/perf/tests/configs/NO_LIBGTK2_config         |  67 ++
>  tools/perf/tests/configs/NO_LIBNUMA_config         |  69 ++
>  tools/perf/tests/configs/NO_LIBPERL_config         |  69 ++
>  tools/perf/tests/configs/NO_LIBPYTHON_config       |  69 ++
>  tools/perf/tests/configs/NO_LIBSLANG_config        |  68 ++
>  .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  69 ++
>  tools/perf/tests/configs/NO_STDIO_config           |  69 ++
>  tools/perf/tests/configs/NO_TIMERFD_config         |  69 ++
>  tools/perf/tests/configs/NO_TUI_config             |  69 ++
>  tools/perf/tests/configs/NO_UNWIND_config          |  65 ++
>  tools/perf/tests/configs/REF_config                |  69 ++
>  tools/perf/tests/generate_configs.py               |  33 +
>  tools/perf/tests/make                              |  73 +-
>  tools/perf/tests/tests.h                           |   4 +-
>  tools/perf/ui/Kbuild                               |  15 +
>  tools/perf/ui/browsers/Kbuild                      |   9 +
>  tools/perf/ui/browsers/scripts.c                   |   4 +
>  tools/perf/ui/gtk/Kbuild                           |   9 +
>  tools/perf/ui/gtk/browser.c                        |   4 +-
>  tools/perf/ui/gtk/gtk.h                            |   5 +-
>  tools/perf/ui/gtk/util.c                           |   6 +-
>  tools/perf/ui/setup.c                              |  14 +-
>  tools/perf/ui/stdio/Kbuild                         |   1 +
>  tools/perf/ui/tui/Kbuild                           |   4 +
>  tools/perf/ui/ui.h                                 |   4 +-
>  tools/perf/util/Kbuild                             | 125 +++
>  tools/perf/util/PERF-VERSION-GEN                   |   4 +
>  tools/perf/util/annotate.h                         |   4 +-
>  tools/perf/util/generate-cmdlist.sh                |  22 +-
>  tools/perf/util/hist.h                             |   4 +-
>  tools/perf/util/include/dwarf-regs.h               |   4 +-
>  tools/perf/util/map.c                              |   3 +-
>  tools/perf/util/probe-event.c                      |   6 +-
>  tools/perf/util/probe-finder.h                     |   5 +-
>  tools/perf/util/scripting-engines/Kbuild           |  11 +
>  tools/perf/util/setup.py                           |   8 +-
>  tools/perf/util/srcline.c                          |   8 +-
>  tools/perf/util/symbol-elf.c                       |   3 +-
>  tools/perf/util/symbol.h                           |  33 +-
>  tools/perf/util/trace-event-scripting.c            |  13 +-
>  tools/perf/util/unwind-libunwind.c                 |   5 +-
>  tools/perf/util/unwind.h                           |   7 +-
>  tools/perf/util/util.c                             |   5 +-
>  116 files changed, 4556 insertions(+), 1274 deletions(-)
>  create mode 100644 tools/perf/Kbuild
>  create mode 100644 tools/perf/Kconfig
>  create mode 100644 tools/perf/Makefile.kbuild
>  delete mode 100644 tools/perf/Makefile.perf
>  create mode 100644 tools/perf/arch/Kbuild
>  create mode 100644 tools/perf/arch/x86/Kbuild
>  create mode 100644 tools/perf/arch/x86/tests/Kbuild
>  create mode 100644 tools/perf/arch/x86/util/Kbuild
>  create mode 100644 tools/perf/bench/Kbuild
>  create mode 100644 tools/perf/builtin-cmds.h
>  create mode 100644 tools/perf/config/defconfig
>  create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
>  create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
>  create mode 100644 tools/perf/tests/Kbuild
>  create mode 100644 tools/perf/tests/configs/MINIMAL_config
>  create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
>  create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
>  create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
>  create mode 100644 tools/perf/tests/configs/NO_GTK2_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
>  create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
>  create mode 100644 tools/perf/tests/configs/NO_STDIO_config
>  create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
>  create mode 100644 tools/perf/tests/configs/NO_TUI_config
>  create mode 100644 tools/perf/tests/configs/NO_UNWIND_config
>  create mode 100644 tools/perf/tests/configs/REF_config
>  create mode 100644 tools/perf/tests/generate_configs.py
>  create mode 100644 tools/perf/ui/Kbuild
>  create mode 100644 tools/perf/ui/browsers/Kbuild
>  create mode 100644 tools/perf/ui/gtk/Kbuild
>  create mode 100644 tools/perf/ui/stdio/Kbuild
>  create mode 100644 tools/perf/ui/tui/Kbuild
>  create mode 100644 tools/perf/util/Kbuild
>  create mode 100644 tools/perf/util/scripting-engines/Kbuild
> 
> -- 
> 1.9.2
> 

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 00/34] perf and kconfig / kbuild
  2014-05-14  2:15 ` [PATCH 00/34] perf and kconfig / kbuild David Ahern
@ 2014-05-17 15:39   ` Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 00/32] perf and kconfig kbuild (2nd try) Alexis Berlemont
                       ` (32 more replies)
  0 siblings, 33 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-05-17 15:39 UTC (permalink / raw)
  To: David Ahern
  Cc: linux-kernel, Jiri Olsa, Arnaldo Carvalho de Melo, Ingo Molnar

Hello,

Sorry for the late reply,

On Wed, May 14, 2014 at 4:15 AM, David Ahern <dsahern@gmail.com> wrote:
> On 5/13/14, 4:02 PM, Alexis Berlemont wrote:
>>
>> Hello,
>>
>> A few months ago, I tried to make a proposal to introduce Kconfig in
>> perf's generation procedure.
>> (cf. https://lkml.org/lkml/2013/12/20/511)
>>
>> I started from David Ahern's work; I was not aware that Jiri Olsa
>> pushed further the idea and proposed an alternative which integrated
>> kbuild too.
>>
>> So, here is another proposal based on Jiri Olsa work (from April 2013).
>> * Most of the NO_* and HAVE_* makefile variables were removed on
>>    behalf of Kconfig's ones (CONFIG_*); perf source code was modified
>>    accordingly;
>> * These changes make the glue files tools/perf/config/Makefile.fix-*
>> useless
>> * The build test cases now relies on generated configuration files (in
>>    tools/perf/tests/configs);
>>
>
> Thanks for picking this up. I skimmed through all of the patches and
> conceptually looks good. I doubt I will have time for a detailed review any
> time soon.
>
> Looks like they apply to Linus' top of tree but with a few errors -- see
> below. You should always run checkpatch.pl before sending out:

Sorry, I indeed did not run checkpatch. I will come back with a cleaner version.

>
> Applying: kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include
> Applying: kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool
> Applying: perf tools: Kbuild builtin source related fixies
> Applying: perf tools: Kbuild source related fixies
> Applying: perf tools: Add kbuild support into Makefile.kbuild
> Applying: perf kbuild: fix recursive invocation of config/features-checks
> Applying: perf kbuild: store in config-detected missing variables (libdir,
> ...)
> Applying: perf kbuild: remove useless #ifdef directives
> Applying: perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
> Applying: perf kbuild: add missing files and missing flags in Kbuild files
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:30: trailing
> whitespace.
> CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:137: trailing
> whitespace.
> CFLAGS_trace-event-perl.o   += -Wno-redundant-decls -Wno-strict-prototypes
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:138: trailing
> whitespace.
> CFLAGS_trace-event-perl.o   += -Wno-unused-parameter -Wno-shadow -Wno-undef
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:143: trailing
> whitespace.
> CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes
> warning: 4 lines applied after fixing whitespace errors.
> Applying: perf kbuild: update kbuild files according to last changes
> Applying: perf kbuild: remove legacy slang-related build variables
> Applying: perf kbuild: remove legacy libaudit-related build variables
> Applying: perf kbuild: remove legacy libgtk2-related build variables
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:204: trailing
> whitespace.
> #else
> warning: 1 line applied after fixing whitespace errors.
> Applying: perf kbuild: remove legacy libperl-related build variables
> Applying: perf kbuild: remove legacy timerfd-related build variable
> Applying: perf kbuild: remove legacy demangle-related build variables
> Applying: perf kbuild: remove legacy on_exit-related build variable
> Applying: perf kbuild: remove legacy backtrace-related build variable
> Applying: perf kbuild: remove legacy numa-related build variable
> Applying: perf kbuild: remove legacy bionic-related build variable
> Applying: perf kbuild: remove legacy libelf-related build variables (1st
> part)
> Applying: perf kbuild: remove legacy libelf-related build variables (2nd
> part)
> Applying: perf kbuild: remove legacy libdwarf-related build variables
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:342: trailing
> whitespace.
>       endif # CONFIG_LIBDWARF_UNWIND
> warning: 1 line applied after fixing whitespace errors.
> Applying: perf kbuild: remove legacy libunwind-related build variables
> Applying: perf kbuild: remove legacy libpython-related build variable
> Applying: perf kbuild: add generated Kconfig build-test cases
> Applying: perf kbuild: fix installation of traceevent plugins
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:74: trailing
> whitespace.
> make_pure           :=
> warning: 1 line applied after fixing whitespace errors.
> Applying: perf kbuild: fix tarpkg target in tests/make
> Applying: perf kbuild: update Kbuild files with new and removed sources
> Applying: perf kbuild: update build test configurations
> /Users/dsa/sw/perf/ahern.git/.git/rebase-apply/patch:773: trailing
> whitespace.
>
> warning: 1 line applied after fixing whitespace errors.
> Applying: perf kbuild: relocate the configs generating script
> Applying: perf kbuild: minor changes
> Applying: perf kbuild: remove Makefile.perf
>
> David
>

Alexis.

^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 00/32] perf and kconfig kbuild (2nd try)
  2014-05-17 15:39   ` Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-04  1:59       ` David Ahern
  2014-06-03 22:05     ` [PATCH 01/32] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
                       ` (31 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Hello,

Sorry the delay between my answers.

Here is another draft proposal. The changes are few:
* checkpatch.pl is ok with these patches (Kconfig documentation added,
  style-related issues fixed, ... sorry)
* Sam Ravnborg and Michal Marek made some comments on the introduction
  of the variables KBUILD_AUTOCONF and KCONFIG_AUTOCONFIGDEP
  variables. I updated the first two patches according to their ideas:
  $KCONFIG_AUTOCONFIG replaces $KBUILD_AUTOCONF and
  $KCONFIG_AUTOCONFIGDEP was replaced by ${KCONFIG_AUTOCONFIG}.cmd
  (confdata.c was updated accordingly).

Alexis.

Alexis Berlemont (29):
  kbuild: add support of custom paths for "auto.conf*" files
  perf kbuild: fix recursive invocation of config/features-checks
  perf kbuild: store in config-detected missing variables (libdir, ...)
  perf kbuild: remove useless #ifdef directives
  perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
  perf kbuild: add missing files and missing flags in Kbuild files
  perf kbuild: update kbuild files according to last changes
  perf kbuild: remove legacy slang-related build variables
  perf kbuild: remove legacy libaudit-related build variables
  perf kbuild: remove legacy libgtk2-related build variables
  perf kbuild: remove legacy libperl-related build variables
  perf kbuild: remove legacy timerfd-related build variable
  perf kbuild: remove legacy demangle-related build variables
  perf kbuild: remove legacy on_exit-related build variable
  perf kbuild: remove legacy backtrace-related build variable
  perf kbuild: remove legacy numa-related build variable
  perf kbuild: remove legacy bionic-related build variable
  perf kbuild: remove legacy libelf-related build variables (1st part)
  perf kbuild: remove legacy libelf-related build variables (2nd part)
  perf kbuild: remove legacy libdwarf-related build variables
  perf kbuild: remove legacy libpython-related build variable
  perf kbuild: add generated Kconfig build-test cases
  perf kbuild: fix installation of traceevent plugins
  perf kbuild: fix tarpkg target in tests/make
  perf kbuild: update Kbuild files with new and removed sources
  perf kbuild: update build test configurations
  perf kbuild: relocate the configs generating script
  perf kbuild: minor changes
  perf kbuild: remove Makefile.perf

Jiri Olsa (3):
  perf tools: Kbuild builtin source related fixies
  perf tools: Kbuild source related fixies
  perf tools: Add kbuild support into Makefile.kbuild

 scripts/Makefile.build                             |   3 +-
 scripts/kconfig/confdata.c                         |  27 +-
 scripts/kconfig/lkc.h                              |   1 +
 tools/perf/Kbuild                                  |  47 ++
 tools/perf/Kconfig                                 | 390 +++++++++
 tools/perf/MANIFEST                                |   1 +
 tools/perf/Makefile                                |   2 +-
 tools/perf/Makefile.kbuild                         | 409 +++++++++
 tools/perf/Makefile.perf                           | 930 ---------------------
 tools/perf/arch/Kbuild                             |   3 +
 tools/perf/arch/arm/Makefile                       |   4 +-
 tools/perf/arch/powerpc/Makefile                   |   2 +-
 tools/perf/arch/s390/Makefile                      |   2 +-
 tools/perf/arch/sh/Makefile                        |   2 +-
 tools/perf/arch/sparc/Makefile                     |   2 +-
 tools/perf/arch/x86/Kbuild                         |   2 +
 tools/perf/arch/x86/Makefile                       |   8 +-
 tools/perf/arch/x86/tests/Kbuild                   |   2 +
 tools/perf/arch/x86/util/Kbuild                    |   5 +
 tools/perf/bench/Kbuild                            |  12 +
 tools/perf/builtin-annotate.c                      |   8 +-
 tools/perf/builtin-bench.c                         |   5 +-
 tools/perf/builtin-cmds.h                          |  31 +
 tools/perf/builtin-help.c                          |   1 +
 tools/perf/builtin-inject.c                        |   2 +-
 tools/perf/builtin-kvm.c                           |  32 +-
 tools/perf/builtin-lock.c                          |   4 +-
 tools/perf/builtin-mem.c                           |   1 +
 tools/perf/builtin-probe.c                         |  15 +-
 tools/perf/builtin-record.c                        |  14 +-
 tools/perf/builtin-report.c                        |   3 +
 tools/perf/builtin-sched.c                         |   2 +
 tools/perf/builtin-script.c                        |   6 +-
 tools/perf/builtin-top.c                           |  19 +-
 tools/perf/config/Makefile                         | 397 +++++----
 tools/perf/config/defconfig                        |  54 ++
 tools/perf/perf.c                                  |  53 +-
 tools/perf/perf.h                                  |   2 +
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild     |   3 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild   |   5 +
 tools/perf/tests/Kbuild                            |  34 +
 tools/perf/tests/builtin-test.c                    |   3 +-
 tools/perf/tests/configs/MINIMAL_config            |  60 ++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  69 ++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  60 ++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  65 ++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  69 ++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  69 ++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  67 ++
 tools/perf/tests/configs/NO_GTK2_config            |  69 ++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  68 ++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  67 ++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  67 ++
 tools/perf/tests/configs/NO_LIBNUMA_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPERL_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  69 ++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  68 ++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  69 ++
 tools/perf/tests/configs/NO_STDIO_config           |  69 ++
 tools/perf/tests/configs/NO_TIMERFD_config         |  69 ++
 tools/perf/tests/configs/NO_TUI_config             |  69 ++
 tools/perf/tests/configs/NO_UNWIND_config          |  65 ++
 tools/perf/tests/configs/REF_config                |  69 ++
 tools/perf/tests/generate_configs.py               |  33 +
 tools/perf/tests/make                              |  73 +-
 tools/perf/tests/tests.h                           |   4 +-
 tools/perf/ui/Kbuild                               |  15 +
 tools/perf/ui/browsers/Kbuild                      |   9 +
 tools/perf/ui/browsers/scripts.c                   |   4 +
 tools/perf/ui/gtk/Kbuild                           |   9 +
 tools/perf/ui/gtk/browser.c                        |   4 +-
 tools/perf/ui/gtk/gtk.h                            |   5 +-
 tools/perf/ui/gtk/util.c                           |   6 +-
 tools/perf/ui/setup.c                              |  12 +-
 tools/perf/ui/stdio/Kbuild                         |   1 +
 tools/perf/ui/tui/Kbuild                           |   4 +
 tools/perf/ui/ui.h                                 |   4 +-
 tools/perf/util/Kbuild                             | 125 +++
 tools/perf/util/PERF-VERSION-GEN                   |   4 +
 tools/perf/util/annotate.h                         |   4 +-
 tools/perf/util/generate-cmdlist.sh                |  22 +-
 tools/perf/util/hist.h                             |   4 +-
 tools/perf/util/include/dwarf-regs.h               |   4 +-
 tools/perf/util/map.c                              |   3 +-
 tools/perf/util/probe-event.c                      |   6 +-
 tools/perf/util/probe-finder.h                     |   5 +-
 tools/perf/util/scripting-engines/Kbuild           |  11 +
 tools/perf/util/setup.py                           |   8 +-
 tools/perf/util/srcline.c                          |   8 +-
 tools/perf/util/symbol-elf.c                       |   3 +-
 tools/perf/util/symbol.h                           |  33 +-
 tools/perf/util/trace-event-scripting.c            |  13 +-
 tools/perf/util/unwind-libunwind.c                 |   5 +-
 tools/perf/util/unwind.h                           |   7 +-
 tools/perf/util/util.c                             |   5 +-
 116 files changed, 4587 insertions(+), 1274 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 delete mode 100644 tools/perf/Makefile.perf
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/tests/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/builtin-cmds.h
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/NO_UNWIND_config
 create mode 100644 tools/perf/tests/configs/REF_config
 create mode 100644 tools/perf/tests/generate_configs.py
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

-- 
1.9.3


^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 01/32] kbuild: add support of custom paths for "auto.conf*" files
  2014-05-17 15:39   ` Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 00/32] perf and kconfig kbuild (2nd try) Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 02/32] perf tools: Kbuild builtin source related fixies Alexis Berlemont
                       ` (30 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

In the scripts/Makefile.build, use KCONFIG_AUTOCONFIG to include a
custom path for the "auto.conf" file.

The "*conf" programs were modified so as to work with the environment
variable KCONFIG_AUTOCONFIG.
---
 scripts/Makefile.build     |  3 ++-
 scripts/kconfig/confdata.c | 27 ++++++++++++++++++++++++++-
 scripts/kconfig/lkc.h      |  1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 003bc26..49517ef 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -31,7 +31,8 @@ subdir-asflags-y :=
 subdir-ccflags-y :=
 
 # Read auto.conf if it exists, otherwise ignore
--include include/config/auto.conf
+kconfig-autoconfig := $(if $(KCONFIG_AUTOCONFIG),$(KCONFIG_AUTOCONFIG),include/config/auto.conf)
+-include $(kconfig-autoconfig)
 
 include scripts/Kbuild.include
 
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index f88d90f..d4d8920 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -75,6 +75,27 @@ const char *conf_get_autoconfig_name(void)
 	return name ? name : "include/config/auto.conf";
 }
 
+#define PATH_MAXLENGTH 4096
+const char *conf_get_autoconfigdep_name(void)
+{
+	static char res_value[PATH_MAXLENGTH];
+
+	char *name = getenv("KCONFIG_AUTOCONFIG");
+
+	if (name == NULL)
+		name = "include/config/auto.conf.cmd";
+	if (strlen(name) > PATH_MAXLENGTH - 5)
+		name = NULL;
+	else {
+		res_value[0] = 0;
+		strncpy(res_value, name, PATH_MAXLENGTH);
+		strcat(res_value, ".cmd");
+		name = res_value;
+	}
+
+	return name;
+}
+
 static char *conf_expand_value(const char *in)
 {
 	struct symbol *sym;
@@ -953,7 +974,11 @@ int conf_write_autoconf(void)
 
 	sym_clear_all_valid();
 
-	file_write_dep("include/config/auto.conf.cmd");
+	name = conf_get_autoconfigdep_name();
+	if (name == NULL)
+		return 1;
+
+	file_write_dep(name);
 
 	if (conf_split_config())
 		return 1;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index d5daa7a..ac99004 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -84,6 +84,7 @@ const char *zconf_curname(void);
 /* confdata.c */
 const char *conf_get_configname(void);
 const char *conf_get_autoconfig_name(void);
+const char *conf_get_autoconfigdep_name(void);
 char *conf_get_default_confname(void);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 02/32] perf tools: Kbuild builtin source related fixies
  2014-05-17 15:39   ` Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 00/32] perf and kconfig kbuild (2nd try) Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 01/32] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-04  6:58       ` Paul Bolle
  2014-06-03 22:05     ` [PATCH 03/32] perf tools: Kbuild " Alexis Berlemont
                       ` (29 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Ingo Molnar, Paul Mackerras, Corey Ashford,
	Frederic Weisbecker, Namhyung Kim, Borislav Petkov, linux-kbuild,
	Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding CONFIG_BUILTIN_* defines to govern builtin commands.
This will be usefull for kbuild process switch.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-cmds.h           | 27 ++++++++++++++++++++++
 tools/perf/builtin-help.c           |  1 +
 tools/perf/perf.c                   | 45 +++++++++++++++++++++++++++++++++++--
 tools/perf/util/generate-cmdlist.sh | 10 +++++++++
 4 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/builtin-cmds.h

diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
new file mode 100644
index 0000000..fec342a
--- /dev/null
+++ b/tools/perf/builtin-cmds.h
@@ -0,0 +1,27 @@
+#ifndef BUILTIN_CMDS_H
+#define BUILTIN_CMDS_H
+
+#define CONFIG_BUILTIN_REPORT 1
+#define CONFIG_BUILTIN_SCRIPT 1
+#define CONFIG_BUILTIN_BENCH 1
+#define CONFIG_BUILTIN_SCHED 1
+#define CONFIG_BUILTIN_TRACE 1
+#define CONFIG_BUILTIN_TOP 1
+#define CONFIG_BUILTIN_RECORD 1
+#define CONFIG_BUILTIN_BUILDID_LIST 1
+#define CONFIG_BUILTIN_INJECT 1
+#define CONFIG_BUILTIN_LOCK 1
+#define CONFIG_BUILTIN_KVM 1
+#define CONFIG_BUILTIN_BUILDID_CACHE 1
+#define CONFIG_BUILTIN_EVLIST 1
+#define CONFIG_BUILTIN_KMEM 1
+#define CONFIG_BUILTIN_STAT 1
+#define CONFIG_BUILTIN_DIFF 1
+#define CONFIG_BUILTIN_ANNOTATE 1
+#define CONFIG_BUILTIN_TIMECHART 1
+#define CONFIG_BUILTIN_LIST 1
+#define CONFIG_BUILTIN_HELP 1
+#define CONFIG_BUILTIN_PROBE 1
+#define CONFIG_BUILTIN_MEM 1
+
+#endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 178b88a..b6c78a6 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -7,6 +7,7 @@
 #include "util/cache.h"
 #include "builtin.h"
 #include "util/exec_cmd.h"
+#include "builtin-cmds.h"
 #include "common-cmds.h"
 #include "util/parse-options.h"
 #include "util/run-command.h"
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 431798a..c39470b 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -7,6 +7,7 @@
  * perf top, perf record, perf report, etc.) are started.
  */
 #include "builtin.h"
+#include "builtin-cmds.h"
 
 #include "util/exec_cmd.h"
 #include "util/cache.h"
@@ -33,34 +34,74 @@ struct cmd_struct {
 };
 
 static struct cmd_struct commands[] = {
+#ifdef CONFIG_BUILTIN_BUILDID_CACHE
 	{ "buildid-cache", cmd_buildid_cache, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_BUILDID_LIST
 	{ "buildid-list", cmd_buildid_list, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_DIFF
 	{ "diff",	cmd_diff,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_EVLIST
 	{ "evlist",	cmd_evlist,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_HELP
 	{ "help",	cmd_help,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LIST
 	{ "list",	cmd_list,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_RECORD
 	{ "record",	cmd_record,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_REPORT
 	{ "report",	cmd_report,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_BENCH
 	{ "bench",	cmd_bench,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_STAT
 	{ "stat",	cmd_stat,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TIMECHART
 	{ "timechart",	cmd_timechart,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TOP
 	{ "top",	cmd_top,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_ANNOTATE
 	{ "annotate",	cmd_annotate,	0 },
+#endif
 	{ "version",	cmd_version,	0 },
+#ifdef CONFIG_BUILTIN_SCRIPT
 	{ "script",	cmd_script,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
-#ifdef HAVE_LIBELF_SUPPORT
+#endif
+#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_KMEM
 	{ "kmem",	cmd_kmem,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LOCK
 	{ "lock",	cmd_lock,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
+#endif
 	{ "test",	cmd_test,	0 },
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_INJECT
 	{ "inject",	cmd_inject,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_MEM
 	{ "mem",	cmd_mem,	0 },
+#endif
 };
 
 struct pager_config {
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d..05ee30f 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+function cfg()
+{
+     cfg=`echo $1 | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
+     echo "$cfg"
+}
+
 echo "/* Automatically generated by $0 */
 struct cmdname_help
 {
@@ -13,6 +19,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -20,6 +27,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
@@ -27,6 +35,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -34,6 +43,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
 echo "};"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 03/32] perf tools: Kbuild source related fixies
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (2 preceding siblings ...)
  2014-06-03 22:05     ` [PATCH 02/32] perf tools: Kbuild builtin source related fixies Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-04  1:49       ` David Ahern
  2014-06-03 22:05     ` [PATCH 04/32] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
                       ` (28 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Ingo Molnar, Paul Mackerras, Corey Ashford,
	Frederic Weisbecker, Namhyung Kim, Borislav Petkov, linux-kbuild,
	Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Fixing several sources config dependencies to allow
separate config builds.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-lock.c        |  4 +++-
 tools/perf/builtin-sched.c       |  2 ++
 tools/perf/perf.c                |  6 ++++++
 tools/perf/perf.h                |  2 ++
 tools/perf/ui/browsers/scripts.c |  4 ++++
 tools/perf/ui/setup.c            | 10 +++++++++-
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index c852c7a..b255c20 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -992,9 +992,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
 				usage_with_options(report_usage, report_options);
 		}
 		rc = __cmd_report(false);
+#ifdef CONFIG_BULTIN_SCRIPT
 	} else if (!strcmp(argv[0], "script")) {
 		/* Aliased to 'perf script' */
-		return cmd_script(argc, argv, prefix);
+		rc = cmd_script(argc, argv, prefix);
+#endif
 	} else if (!strcmp(argv[0], "info")) {
 		if (argc) {
 			argc = parse_options(argc, argv,
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 9ac0a49..cb77a4e 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1741,11 +1741,13 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (!argc)
 		usage_with_options(sched_usage, sched_options);
 
+#ifdef CONFIG_BULTIN_SCRIPT
 	/*
 	 * Aliased to 'perf script' for now:
 	 */
 	if (!strcmp(argv[0], "script"))
 		return cmd_script(argc, argv, prefix);
+#endif
 
 	symbol__init();
 	if (!strncmp(argv[0], "rec", 3)) {
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index c39470b..74a1269 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -92,7 +92,9 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_TEST
 	{ "test",	cmd_test,	0 },
+#endif
 #if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
@@ -543,13 +545,17 @@ int main(int argc, const char **argv)
 	} else {
 		/* The user didn't specify a command; give them help */
 		printf("\n usage: %s\n\n", perf_usage_string);
+#ifdef CONFIG_BUILTIN_HELP
 		list_common_cmds_help();
 		printf("\n %s\n\n", perf_more_info_string);
+#endif
 		goto out;
 	}
 	cmd = argv[0];
 
+#ifdef CONFIG_BUILTIN_TEST
 	test_attr__init();
+#endif
 
 	/*
 	 * We use PATH to find perf commands, but we prepend some higher
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 5c11eca..8487a30 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -221,8 +221,10 @@ sys_perf_event_open(struct perf_event_attr *attr,
 	fd = syscall(__NR_perf_event_open, attr, pid, cpu,
 		     group_fd, flags);
 
+#ifdef CONFIG_BUILTIN_TEST
 	if (unlikely(test_attr__enabled))
 		test_attr__open(attr, pid, cpu, fd, group_fd, flags);
+#endif
 
 	return fd;
 }
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index 402d2bd..128988d 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -59,7 +59,11 @@ static int list_scripts(char *script_name)
 		paths[i] = names[i] + SCRIPT_NAMELEN;
 	}
 
+#ifdef CONFIG_BUILTIN_SCRIPT
 	num = find_scripts(names, paths);
+#else
+	num = 0;
+#endif
 	if (num > 0) {
 		choice = ui__popup_menu(num, names);
 		if (choice < num && choice >= 0) {
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 5df5140..66ecd08 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -71,16 +71,20 @@ void setup_browser(bool fallback_to_pager)
 
 	switch (use_browser) {
 	case 2:
+#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		if (setup_gtk_browser() == 0)
 			break;
 		printf("GTK browser requested but could not find %s\n",
 		       PERF_GTK_DSO);
 		sleep(1);
+#endif
 		/* fall through */
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
+#endif
 		/* fall through */
 	default:
 		use_browser = 0;
@@ -92,16 +96,20 @@ void setup_browser(bool fallback_to_pager)
 	}
 }
 
-void exit_browser(bool wait_for_ok)
+void exit_browser(bool wait_for_ok __maybe_unused)
 {
 	switch (use_browser) {
 	case 2:
+#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		exit_gtk_browser(wait_for_ok);
 		break;
+#endif
 
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
+#endif
 
 	default:
 		break;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 04/32] perf tools: Add kbuild support into Makefile.kbuild
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (3 preceding siblings ...)
  2014-06-03 22:05     ` [PATCH 03/32] perf tools: Kbuild " Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-03 22:05     ` [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
                       ` (27 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Ingo Molnar, Paul Mackerras, Corey Ashford,
	Frederic Weisbecker, Namhyung Kim, Borislav Petkov, linux-kbuild,
	Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding kbuild support into Makefile.kbuild. The 'legacy'
Makefile still stays untouched as it was.

It's possible to use kbuild by running 'make -f Makefile.kbuild'
with any option supported by 'legacy' Makefile.

We now have 2 config files:
  '.config' - user configured setup
  '.config-detected' - system detected setup

The '.config-detected' affects '.config' and if there's
configured feature in '.config' which was not detected
it is automatically disabled.

The '.config-detected' is re/created if:
  - there's no '.config-detected'
  - '.config' was changed

In a cleaned tree the perf is built with 'allyesconfig'
having disabled all non-detected features, just as it is
done now.

You can change '.config' via:
  make -f Makefile.kbuild menuconfig

There's difference for O=DIR build. The DIR is populated
based on kernel source tree, so the final binary is created
under DIR/tools/perf.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/Kbuild                                |  47 +++
 tools/perf/Kconfig                               | 273 +++++++++++++++
 tools/perf/Makefile.kbuild                       | 407 +++++++++++++++++++++++
 tools/perf/Makefile.perf                         |   2 +-
 tools/perf/arch/Kbuild                           |   3 +
 tools/perf/arch/x86/Kbuild                       |   1 +
 tools/perf/arch/x86/util/Kbuild                  |   3 +
 tools/perf/bench/Kbuild                          |   9 +
 tools/perf/builtin-cmds.h                        |   4 +
 tools/perf/config/Makefile                       |  45 +++
 tools/perf/config/Makefile.fix-config            | 104 ++++++
 tools/perf/config/Makefile.fix-legacy            |  46 +++
 tools/perf/config/defconfig                      |  54 +++
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild   |   3 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild |   4 +
 tools/perf/tests/Kbuild                          |  23 ++
 tools/perf/ui/Kbuild                             |  14 +
 tools/perf/ui/browsers/Kbuild                    |   6 +
 tools/perf/ui/gtk/Kbuild                         |   7 +
 tools/perf/ui/stdio/Kbuild                       |   1 +
 tools/perf/ui/tui/Kbuild                         |   4 +
 tools/perf/util/Kbuild                           | 113 +++++++
 tools/perf/util/PERF-VERSION-GEN                 |   4 +
 tools/perf/util/generate-cmdlist.sh              |   8 +-
 tools/perf/util/scripting-engines/Kbuild         |   7 +
 tools/perf/util/setup.py                         |   8 +-
 26 files changed, 1193 insertions(+), 7 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/config/Makefile.fix-config
 create mode 100644 tools/perf/config/Makefile.fix-legacy
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

diff --git a/tools/perf/Kbuild b/tools/perf/Kbuild
new file mode 100644
index 0000000..80b9184
--- /dev/null
+++ b/tools/perf/Kbuild
@@ -0,0 +1,47 @@
+obj-y += perf.o
+
+obj-$(CONFIG_BUILTIN_ANNOTATE)      += builtin-annotate.o
+obj-$(CONFIG_BUILTIN_BENCH)         += builtin-bench.o
+obj-$(CONFIG_BUILTIN_BENCH)         += bench/
+obj-$(CONFIG_BUILTIN_BUILDID_CACHE) += builtin-buildid-cache.o
+obj-$(CONFIG_BUILTIN_BUILDID_LIST)  += builtin-buildid-list.o
+obj-$(CONFIG_BUILTIN_DIFF)          += builtin-diff.o
+obj-$(CONFIG_BUILTIN_EVLIST)        += builtin-evlist.o
+obj-$(CONFIG_BUILTIN_HELP)          += builtin-help.o
+obj-$(CONFIG_BUILTIN_INJECT)        += builtin-inject.o
+obj-$(CONFIG_BUILTIN_KMEM)          += builtin-kmem.o
+obj-$(CONFIG_BUILTIN_KVM)           += builtin-kvm.o
+obj-$(CONFIG_BUILTIN_LIST)          += builtin-list.o
+obj-$(CONFIG_BUILTIN_LOCK)          += builtin-lock.o
+obj-$(CONFIG_BUILTIN_PROBE)         += builtin-probe.o
+obj-$(CONFIG_BUILTIN_RECORD)        += builtin-record.o
+obj-$(CONFIG_BUILTIN_REPORT)        += builtin-report.o
+obj-$(CONFIG_BUILTIN_SCHED)         += builtin-sched.o
+obj-$(CONFIG_BUILTIN_SCRIPT)        += builtin-script.o
+obj-$(CONFIG_BUILTIN_STAT)          += builtin-stat.o
+obj-$(CONFIG_BUILTIN_TIMECHART)     += builtin-timechart.o
+obj-$(CONFIG_BUILTIN_TOP)           += builtin-top.o
+obj-$(CONFIG_BUILTIN_TRACE)         += builtin-trace.o
+obj-$(CONFIG_BUILTIN_MEM)           += builtin-mem.o
+obj-$(CONFIG_BUILTIN_TEST)          += tests/
+
+obj-y += ../../lib/rbtree.o
+
+obj-y += util/
+obj-y += ui/
+obj-y += arch/
+
+obj-$(CONFIG_LIBPERL)   += scripts/perl/Perf-Trace-Util/
+obj-$(CONFIG_LIBPYTHON) += scripts/python/Perf-Trace-Util/
+
+
+CFLAGS_rbtree.o += -Wno-unused-parameter
+
+CFLAGS_perf.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_perf.o += -include PERF-VERSION-FILE
+
+$(obj)/perf.o: $(obj)/PERF-VERSION-FILE
+
+CFLAGS_builtin-help.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_INFO_PATH=KBUILD_STR($(infodir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_MAN_PATH=KBUILD_STR($(mandir_SQ))"
diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
new file mode 100644
index 0000000..108b422
--- /dev/null
+++ b/tools/perf/Kconfig
@@ -0,0 +1,273 @@
+
+mainmenu "The perf configuration"
+
+menu "Built-in commands"
+
+config BUILTIN_RECORD
+	bool "record"
+	default y
+        ---help---
+	  Run a command and record its profile into a perf archive.
+
+config BUILTIN_REPORT
+	bool "report"
+	default y
+        ---help---
+	  Read a perf archive (created by perf record) and display the
+	  profile.
+
+config BUILTIN_STAT
+	bool "stat"
+	default y
+        ---help---
+	  Run a command and gather performance counter statistics.
+
+config BUILTIN_TOP
+	bool "top"
+	default n
+        ---help---
+	  Generate and display a performance counter profile in
+	  real-time.
+
+config BUILTIN_TRACE
+	bool "trace"
+	default n
+	depends on CONFIG_LIBAUDIT
+        ---help---
+	  Strace inspired tool.
+
+config BUILTIN_ANNOTATE
+	bool "annotate"
+	default n
+        ---help---
+	  Read a perf archive (created by perf record) and display
+	  annotated code.
+
+config BUILTIN_BENCH
+	bool "bench"
+	default n
+        ---help---
+	  General framework for benchmark suites.
+
+config BUILTIN_BUILDID_CACHE
+	bool "buildid-cache"
+	default n
+        ---help---
+	  Manage build-id cache.
+
+config BUILTIN_BUILDID_LIST
+	bool "buildid-list"
+	default n
+        ---help---
+	  List the buildids in a perf archive file.
+
+config BUILTIN_DIFF
+	bool "diff"
+	default y
+        ---help---
+	  Read perf archive files and display the differential
+	  profile.
+
+config BUILTIN_EVLIST
+	bool "evlist"
+	default n
+        ---help---
+	  List the event names in a perf archive file
+
+config BUILTIN_HELP
+	bool "help"
+	default y
+        ---help---
+	  Display help information about perf
+
+config BUILTIN_INJECT
+	bool "inject"
+	default n
+        ---help---
+	  The inject feature reads a perf-record event stream and
+	  repipes it to stdout.
+
+config BUILTIN_KMEM
+	bool "kmem"
+	default n
+        ---help---
+	  Tool to trace/measure kernel memory(slab) properties.
+
+config BUILTIN_KVM
+	bool "kvm"
+	default n
+        ---help---
+	  Tool to trace/measure kvm guest os
+
+config BUILTIN_LIST
+	bool "list"
+	default n
+        ---help---
+	  List all symbolic event types.
+
+config BUILTIN_LOCK
+	bool "lock"
+	default n
+        ---help---
+	  Analyze lock events.
+
+config BUILTIN_PROBE
+	bool "probe"
+	default n
+	depends on LIBELF
+        ---help---
+	  Define new dynamic tracepoints
+
+config BUILTIN_SCHED
+	bool "sched"
+	default n
+        ---help---
+	  Tool to trace/measure scheduler properties (latencies).
+
+config BUILTIN_SCRIPT
+	bool "script"
+	default y
+        ---help---
+	  Read perf archive file (created by perf record) and display
+	  trace output.
+
+config BUILTIN_TIMECHART
+	bool "timechart"
+	default n
+        ---help---
+	  Tool to visualize total system behavior during a workload.
+
+config BUILTIN_MEM
+	bool "mem"
+	default y
+        ---help---
+	  Profile memory accesses.
+
+config BUILTIN_TEST
+	bool "test"
+	default y
+        ---help---
+	  Runs sanity tests.
+
+endmenu
+
+menu "Libraries"
+
+config LIBAUDIT
+	bool "Audit (libaudit)"
+	default n
+        ---help---
+	  Linux audit framework dependency.
+
+config LIBPERL
+	bool "Perl"
+	default n
+        ---help---
+	  Libperl dependency needed by the perf script feature.
+
+config LIBPYTHON
+	bool "Python"
+	default n
+        ---help---
+	  Libpython dependency needed by the perf script feature.
+
+choice
+	prompt "Elf library"
+	default LIBELF
+        ---help---
+	  Perf needs ELF files manipulation facilities. To fulfill
+	  these tasks, perf can rely on either the libelf library or a
+	  minimal builtin support.
+
+
+	config LIBELF
+	bool "elf"
+	---help---
+	  Libelf library.
+
+	config LIBELF_MINIMAL
+	bool "builtin support"
+	---help---
+	  Builtin elf support.
+endchoice
+
+config LIBUNWIND
+	bool "User space libunwind callchains"
+        ---help---
+	  The library libunwind provides a portable C API to determine
+	  the call-chain of a program.
+
+config LIBUNWIND_DIR
+	string "libunwind directory"
+	depends on LIBUNWIND
+        ---help---
+	  Directory holding the libuwind dependency (headers +
+	  libraries).
+
+config NUMA
+	bool "Numa support (bench)"
+	default n
+        ---help---
+	  The library libnuma offers facilities to configure NUMA
+	  policies supported by the linux kernel.
+
+config DEMANGLE
+	bool "Demangle symbols"
+	default n
+        ---help---
+	  Enable demangling so as to display human-readable
+	  symbols. This option is convenient with C++ programs.
+
+config BIONIC
+	bool "Bionic support"
+	default n
+        ---help---
+	  The Bionic libc is a derivation of the BSD's standard C
+	  library code developed by Google for their Android operating
+	  system.
+
+endmenu
+
+menu "GUI"
+
+config STDIO
+	bool "Terminal"
+	default y
+        ---help---
+	  Most basic display mode.
+
+config TUI
+	bool "Tui (newt based)"
+	default n
+        ---help---
+	  Text-based user interface which provides windowing
+	  facilities.
+
+config GTK2
+	bool "Gtk2"
+	default n
+        ---help---
+	  Elaborate display mode based on libgtk2.
+
+endmenu
+
+menu "Build"
+config DEBUG
+	bool "Compile with debug info"
+	default n
+        ---help---
+	  Compile with debug info.
+
+config DEBUG_PARSER
+	bool "Compile with parsers debug info"
+	default n
+        ---help---
+	  Compile with parsers debug info.
+
+config BACKTRACE
+	bool "Compile with dump_stack support"
+	default n
+        ---help---
+	  Compile with dump_stack support.
+
+endmenu
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
new file mode 100644
index 0000000..1e3621f
--- /dev/null
+++ b/tools/perf/Makefile.kbuild
@@ -0,0 +1,407 @@
+srctree := $(abspath $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)/../../))
+objtree := $(abspath $(if $(KBUILD_SRC),$(CURDIR),$(CURDIR)/../..))
+
+VPATH   := $(srctree)
+
+export srctree VPATH
+
+MAKEFLAGS += --include-dir=$(srctree)
+MAKEFLAGS += --no-builtin-rules
+MAKEFLAGS += --no-print-directory
+
+ifeq ("$(origin V)", "command line")
+KBUILD_VERBOSE = $(V)
+endif
+
+ifndef KBUILD_VERBOSE
+KBUILD_VERBOSE = 0
+endif
+
+ifeq ($(KBUILD_VERBOSE),1)
+quiet =
+Q =
+else
+quiet=quiet_
+Q = @
+endif
+
+# If the user is running make -s (silent mode), suppress echoing of
+# commands
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+quiet=silent_
+endif
+
+export quiet Q KBUILD_VERBOSE
+
+ifndef V
+QUIET_LINK  = @echo '  LD      $@';
+QUIET_GEN   = @echo '  GEN     $@';
+QUIET_CLEAN = @echo '  CLEAN   tools/perf';
+endif
+
+export QUIET_BISON QUIET_FLEX
+
+ifeq ($(KBUILD_SRC),)
+
+ifeq ("$(origin O)", "command line")
+KBUILD_OUTPUT := $(O)
+else
+KBUILD_OUTPUT := $(objtree)
+endif
+
+# Invoke a second make in the output directory, passing relevant variables
+# check that the output directory actually exists
+saved-output := $(KBUILD_OUTPUT)
+KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+$(if $(KBUILD_OUTPUT),, \
+     $(error output directory "$(saved-output)" does not exist))
+
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/lib)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/include/config)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/tools/perf)
+
+PHONY += $(MAKECMDGOALS) sub-make
+
+$(filter-out sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) all: sub-make
+        @:
+
+sub-make: FORCE
+	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+	KBUILD_SRC=$(srctree) \
+	-f $(CURDIR)/Makefile.kbuild \
+	$(filter-out sub-make,$(MAKECMDGOALS))
+
+# Leave processing to above invocation of make
+skip-makefile := 1
+endif # ifeq ($(KBUILD_SRC),)
+
+export KBUILD_SRC
+
+ifeq ($(skip-makefile),)
+
+build := -f $(srctree)/scripts/Makefile.build obj
+
+src-kernel := $(srctree)
+src-perf   := $(srctree)/tools/perf
+obj-kernel := $(objtree)
+obj-perf   := $(objtree)/tools/perf
+
+VPATH += $(src-perf)
+
+export src-perf obj-perf
+
+OUTPUT := $(obj-perf)
+
+export OUTPUT
+
+AS      = as
+LD      = ld
+CC      = gcc
+CPP     = $(CC) -E
+HOSTCC  = gcc
+FLEX    = flex
+BISON   = bison
+INSTALL = install
+
+export AS LD CC CPP HOSTCC FLEX BISON
+
+# kbuild related config
+CONFIG_SHELL          := /bin/sh
+
+KBUILD_KCONFIG        := $(src-perf)/Kconfig
+KCONFIG_CONFIG        ?= $(obj-perf)/.config
+KCONFIG_TRISTATE      := $(obj-perf)/include/config/tristate.conf
+KCONFIG_AUTOHEADER    := $(obj-perf)/include/generated/autoconf.h
+KCONFIG_AUTOCONFIG    := $(obj-perf)/include/config/auto.conf
+KCONFIG_SCRIPT        := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
+
+export CONFIG_SHELL
+export KBUILD_KCONFIG
+export KCONFIG_CONFIG KCONFIG_TRISTATE
+export KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG KCONFIG_SCRIPT
+
+# perf detected config
+CONFIG_DETECTED := $(obj-perf)/.config-detected
+
+export CONFIG_DETECTED
+
+# external .a libs
+LK_DIR          := $(srctree)/tools/lib/lk/
+TRACE_EVENT_DIR := $(srctree)/tools/lib/traceevent/
+
+LIBTRACEEVENT   := $(obj-kernel)/tools/lib/traceevent/libtraceevent.a
+LIBLK           := $(obj-kernel)/tools/lib/lk/liblk.a
+LIBS_A          := $(LIBTRACEEVENT) $(LIBLK)
+
+export TRACE_EVENT_DIR LK_DIR LIBTRACEEVENT LIBLK
+
+all:
+
+scripts_basic:
+	$(Q)$(MAKE) $(build)=scripts/basic
+
+defconfig: scripts_basic
+	$(Q)cp $(src-perf)/config/defconfig $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig oldconfig
+
+%config: scripts_basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig $@
+
+$(KCONFIG_CONFIG):
+	$(Q)$(MAKE) $(build)=scripts/basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig allyesconfig
+
+$(CONFIG_DETECTED): $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile
+
+# no need to include auto.conf.cmd, because .config
+# is the only dependency here
+$(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
+	$(Q)mkdir -p $(obj-perf)/include/config
+	$(Q)mkdir -p $(obj-perf)/include/generated
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
+	@touch $(CONFIG_DETECTED) # final touch.. to keep the time dependency correct
+
+clean-dirs := $(addprefix _clean_, tools/perf/)
+
+$(clean-dirs):
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
+
+clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBLK)-clean
+	$(Q)$(QUIET_CLEAN)
+	$(Q)rm -f $(obj-perf)/perf
+	$(Q)rm -f $(obj-perf)/common-cmds.h
+	$(Q)rm -f $(obj-perf)/python/perf.so
+	$(Q)rm -rf $(obj-perf)/include/generated $(obj-perf)/include/config
+	$(Q)find $(obj-perf) \
+		\( -name '*.[oas]' -o -name '.*.cmd' \
+		-o -name '.*.d' -o -name '.*.tmp' \
+		-o -name '*-flex.[ch]' -o -name '*-bison.[ch]' \
+		\) -type f -print | xargs rm -f
+	$(Q)$(python-clean)
+	$(Q)rm -f $(CONFIG_DETECTED) $(KCONFIG_CONFIG)
+
+TAGS tags:
+	$(Q)rm -f $(src-perf)/tags
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs ctags -a
+
+cscope:
+	$(Q)rm -f $(src-perf)/cscope*
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs cscope -b
+
+PHONY += clean $(clean-dirs) tags TAGS cscope
+
+ifneq ($(filter %config help clean tags TAGS cscope,$(MAKECMDGOALS)),)
+dont-detect := 1
+endif
+
+ifndef dont-detect
+# detected config variables
+include $(CONFIG_DETECTED)
+
+# Following variables are needed within Kbuild files, we need
+# to export them as they are not part of the .config set.
+export CONFIG_ARCH := $(ARCH)
+export CONFIG_X86_64
+export htmldir_SQ
+export infodir_SQ
+export mandir_SQ
+export perfexecdir_SQ
+export prefix_SQ
+export PARSER_DEBUG_BISON
+export PARSER_DEBUG_FLEX
+export ETC_PERFCONFIG_SQ
+export PYTHON_EMBED_CCOPTS
+export PERL_EMBED_CCOPTS
+endif
+
+# let sources know it's kbuild
+CFLAGS += -DCONFIG_KBUILD
+
+# kbuild related config
+LINUXINCLUDE    := $(CFLAGS)
+KBUILD_BUILTIN  := 1
+KBUILD_CHECKSRC := 0
+
+export LINUXINCLUDE
+export KBUILD_BUILTIN KBUILD_CHECKSRC
+
+# pyuthon language binding
+PYTHON_EXTBUILD     := $(src-perf)/python_ext_build/
+PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
+PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
+
+export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
+
+python-clean := rm -rf $(PYTHON_EXTBUILD) $(obj-perf)/python/perf.so
+
+PYTHON_EXT_SRCS   := $(addprefix $(src-perf)/,$(shell grep -v ^\# $(src-perf)/util/python-ext-sources))
+PYTHON_EXT_DEPS   := $(src-perf)/util/python-ext-sources $(src-perf)/util/setup.py
+PYTHON_EXT_CFLAGS := $(CFLAGS) -w
+
+export PYTHON_EXT_SRCS
+
+
+$(obj-perf)/python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
+	$(QUIET_GEN)CFLAGS='$(PYTHON_EXT_CFLAGS)' $(PYTHON_WORD) $(src-perf)/util/setup.py \
+	  --quiet build_ext; \
+	mkdir -p $(obj-perf)/python && \
+	cp $(PYTHON_EXTBUILD_LIB)perf.so $(obj-perf)/python/
+
+all: tools/perf/PERF-VERSION-FILE scripts_basic $(KCONFIG_AUTOCONFIG) tools/perf/perf $(LANG_BINDINGS)
+
+$(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/command-list.txt
+	$(QUIET_GEN)$(src-perf)/util/generate-cmdlist.sh $(src-perf) > $@+ && mv $@+ $@
+
+PHONY += all scripts_basic
+
+$(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
+	$(Q)$(MAKE) $(build)=tools/perf
+
+LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+
+tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS)
+
+$(LIBTRACEEVENT): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -C $(src-kernel)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent
+
+$(LIBTRACEEVENT)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
+
+PHONY += $(TRACE_EVENT_DIR) $(TRACE_EVENT_DIR)-clean
+
+$(LIBLK): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/lk
+	$(Q)$(MAKE) -C $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk
+
+$(LIBLK)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/lk
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk clean
+
+tools/perf/PERF-VERSION-FILE: FORCE
+	$(QUIET_GEN)$(SHELL_PATH) $(src-perf)/util/PERF-VERSION-GEN $(obj-perf)/
+
+
+# Single targets
+# ---------------------------------------------------------------------------
+# Single targets are compatible with:
+# - build with mixed source and output
+# - build with separate output dir 'make O=...'
+# - external modules
+#
+#  target-dir => where to store outputfile
+#  build-dir  => directory in kernel source tree to use
+
+build-dir  = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(patsubst %/,%,$(dir $@))))
+target-dir = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(dir $@)))
+
+%.o: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.i: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.o: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+
+SCRIPT_SH += $(src-perf)/perf-archive.sh
+SCRIPTS    = $(patsubst %.sh,%,$(SCRIPT_SH))
+
+$(SCRIPTS) : % : %.sh
+	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(perf-obj)$@'
+
+all: $(SCRIPTS)
+
+install-bin: all
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) $(obj-perf)/perf '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) $(src-perf)/perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
+	$(INSTALL) $(src-perf)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
+	$(INSTALL) $(src-perf)/scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) $(src-perf)/scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
+	$(INSTALL) $(src-perf)/scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
+	$(INSTALL) $(src-perf)/bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) $(src-perf)/tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+	$(INSTALL) $(src-perf)/tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+
+install: install-bin try-install-man
+
+DOC_TARGETS := doc man html info pdf
+
+$(DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:doc=all)
+
+INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
+INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
+
+# 'make install-doc' should call 'make -C Documentation install'
+$(INSTALL_DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:-doc=)
+
+help:
+	@echo 'Perf make targets:'
+	@echo '  doc		- make *all* documentation (see below)'
+	@echo '  man		- make manpage documentation (access with man <foo>)'
+	@echo '  html		- make html documentation'
+	@echo '  info		- make GNU info documentation (access with info <foo>)'
+	@echo '  pdf		- make pdf documentation'
+	@echo '  TAGS		- use etags to make tag information for source browsing'
+	@echo '  tags		- use ctags to make tag information for source browsing'
+	@echo '  cscope	- use cscope to make interactive browsing database'
+	@echo ''
+	@echo 'Perf install targets:'
+	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
+	@echo '  HINT: use "make prefix=<path> <install target>" to install to a particular'
+	@echo '        path like make prefix=/usr/local install install-doc'
+	@echo '  install	- install compiled binaries'
+	@echo '  install-doc	- install *all* documentation'
+	@echo '  install-man	- install manpage documentation'
+	@echo '  install-html	- install html documentation'
+	@echo '  install-info	- install GNU info documentation'
+	@echo '  install-pdf	- install pdf documentation'
+	@echo ''
+	@echo '  quick-install-doc	- alias for quick-install-man'
+	@echo '  quick-install-man	- install the documentation quickly'
+	@echo '  quick-install-html	- install the html documentation quickly'
+	@echo ''
+	@echo 'Perf maintainer targets:'
+	@echo '  clean			- clean all binary objects and build output'
+
+
+ifdef MAKE_DEBUG
+dummy := $(info DEBUG MAKEFLAGS             $(MAKEFLAGS))
+dummy := $(info DEBUG VPATH                 $(VPATH))
+dummy := $(info DEBUG srctree               $(srctree))
+dummy := $(info DEBUG objtree               $(objtree))
+dummy := $(info DEBUG src-kernel            $(src-kernel))
+dummy := $(info DEBUG src-perf              $(src-perf))
+dummy := $(info DEBUG obj-kernel            $(obj-kernel))
+dummy := $(info DEBUG obj-perf              $(obj-perf))
+dummy := $(info DEBUG KBUILD_KCONFIG        $(KBUILD_KCONFIG))
+dummy := $(info DEBUG KCONFIG_CONFIG        $(KCONFIG_CONFIG))
+dummy := $(info DEBUG KCONFIG_TRISTATE      $(KCONFIG_TRISTATE))
+dummy := $(info DEBUG KCONFIG_AUTOHEADER    $(KCONFIG_AUTOHEADER))
+dummy := $(info DEBUG KCONFIG_AUTOCONFIG    $(KCONFIG_AUTOCONFIG))
+dummy := $(info DEBUG TRACE_EVENT_DIR       $(TRACE_EVENT_DIR))
+dummy := $(info DEBUG LK_DIR                $(LK_DIR))
+endif
+
+endif  # skip-makefile
+
+PHONY += FORCE
+.PHONY: $(PHONY)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 895edd3..5c666b87 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -606,7 +606,7 @@ $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPU
 $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
 
 $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
+	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
 
 $(SCRIPTS) : % : %.sh
 	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
diff --git a/tools/perf/arch/Kbuild b/tools/perf/arch/Kbuild
new file mode 100644
index 0000000..5cf419e
--- /dev/null
+++ b/tools/perf/arch/Kbuild
@@ -0,0 +1,3 @@
+obj-y += common.o
+
+obj-y += $(CONFIG_ARCH)/
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
new file mode 100644
index 0000000..52fd6fa
--- /dev/null
+++ b/tools/perf/arch/x86/Kbuild
@@ -0,0 +1 @@
+obj-y += util/
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
new file mode 100644
index 0000000..0ba617a
--- /dev/null
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -0,0 +1,3 @@
+obj-y += dwarf-regs.o
+obj-y += header.o
+obj-$(CONFIG_LIBUNWIND) += unwind.o
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
new file mode 100644
index 0000000..8883de9
--- /dev/null
+++ b/tools/perf/bench/Kbuild
@@ -0,0 +1,9 @@
+obj-y += mem-memcpy.o
+obj-y += mem-memset.o
+obj-y += sched-messaging.o
+obj-y += sched-pipe.o
+
+obj-$(CONFIG_NUMA) += numa.o
+
+obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
+obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
index fec342a..936842d 100644
--- a/tools/perf/builtin-cmds.h
+++ b/tools/perf/builtin-cmds.h
@@ -1,6 +1,7 @@
 #ifndef BUILTIN_CMDS_H
 #define BUILTIN_CMDS_H
 
+#ifndef CONFIG_KBUILD
 #define CONFIG_BUILTIN_REPORT 1
 #define CONFIG_BUILTIN_SCRIPT 1
 #define CONFIG_BUILTIN_BENCH 1
@@ -23,5 +24,8 @@
 #define CONFIG_BUILTIN_HELP 1
 #define CONFIG_BUILTIN_PROBE 1
 #define CONFIG_BUILTIN_MEM 1
+#else
+#include <generated/autoconf.h>
+#endif /* CONFIG_KBUILD */
 
 #endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 802cf54..78ee62d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -24,6 +24,7 @@ ifeq ($(ARCH),x86)
     CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
     ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
     LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+    CONFIG_X86_64=y
   else
     LIBUNWIND_LIBS = -lunwind -lunwind-x86
   endif
@@ -78,6 +79,10 @@ ifndef NO_LIBELF
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
 endif
 
+ifdef KCONFIG_CONFIG
+include $(src-perf)/config/Makefile.fix-legacy
+endif
+
 # include ARCH specific config
 -include $(src-perf)/arch/$(ARCH)/Makefile
 
@@ -244,6 +249,7 @@ ifeq ($(DEBUG),0)
 endif
 
 CFLAGS += -I$(src-perf)/util/include
+CFLAGS += -I$(obj-perf)/include
 CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
 CFLAGS += -I$(srctree)/tools/include/
 CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
@@ -733,3 +739,42 @@ endif
 ifeq ($(display_lib),1)
   $(info )
 endif
+
+ifdef CONFIG_DETECTED
+
+store = @echo "$(1)=$($(1))" >> $(CONFIG_DETECTED)
+
+all:
+	$(call store,ARCH)
+	$(call store,CFLAGS)
+	$(call store,LDFLAGS)
+	$(call store,EXTLIBS)
+	$(call store,htmldir_SQ)
+	$(call store,infodir_SQ)
+	$(call store,mandir_SQ)
+	$(call store,perfexecdir_SQ)
+	$(call store,prefix_SQ)
+	$(call store,PARSER_DEBUG_BISON)
+	$(call store,PARSER_DEBUG_FLEX)
+	$(call store,PYTHON_EMBED_CCOPTS)
+	$(call store,PERL_EMBED_CCOPTS)
+	$(call store,CONFIG_X86_64)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_LIBPERL)
+	$(call store,NO_LIBPYTHON)
+	$(call store,NO_NEWT)
+	$(call store,NO_GTK2)
+	$(call store,NO_DEMANGLE)
+	$(call store,NO_LIBELF)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_BACKTRACE)
+	$(call store,NO_LIBNUMA)
+	$(call store,NO_LIBAUDIT)
+	$(call store,NO_LIBBIONIC)
+	$(call store,ETC_PERFCONFIG_SQ)
+	$(call store,DESTDIR_SQ)
+	$(call store,bindir_SQ)
+	$(call store,perfexec_instdir_SQ)
+	$(call store,sysconfdir_SQ)
+
+endif # CONFIG_DETECTED
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
new file mode 100644
index 0000000..7f65fdb
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-config
@@ -0,0 +1,104 @@
+include $(CONFIG_DETECTED)
+include $(KCONFIG_CONFIG)
+
+CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
+
+# NO_LIBPERL
+ifdef CONFIG_LIBPERL
+ifdef NO_LIBPERL
+dummy := $(info Disabling CONFIG_LIBPERL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
+endif
+endif
+
+# NO_LIBPYTHON
+ifdef CONFIG_LIBPYTHON
+ifdef NO_LIBPYTHON
+dummy := $(info Disabling CONFIG_LIBPYTHON)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_NEWT
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_SLANG
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_GTK2
+ifdef CONFIG_GTK2
+ifdef NO_GTK2
+dummy := $(info Disabling CONFIG_GTK2)
+dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
+endif
+endif
+
+# NO_DEMANGLE
+ifdef CONFIG_DEMANGLE
+ifdef NO_DEMANGLE
+dummy := $(info Disabling CONFIG_DEMANGLE)
+dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
+endif
+endif
+
+# NO_LIBELF
+ifdef CONFIG_LIBELF
+ifdef NO_LIBELF
+dummy := $(info Disabling CONFIG_LIBELF)
+dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
+dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
+endif
+endif
+
+# NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
+ifdef NO_LIBUNWIND
+dummy := $(info Disabling CONFIG_LIBUNWIND)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
+endif
+endif
+
+# NO_BACKTRACE
+ifdef CONFIG_BACKTRACE
+ifdef NO_BACKTRACE
+dummy := $(info Disabling CONFIG_BACKTRACE)
+dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
+endif
+endif
+
+# NO_LIBNUMA
+ifdef CONFIG_NUMA
+ifdef NO_LIBNUMA
+dummy := $(info Disabling CONFIG_NUMA)
+dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
+endif
+endif
+
+# NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
+ifdef NO_LIBAUDIT
+dummy := $(info Disabling CONFIG_LIBAUDIT)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
+endif
+endif
+
+# NO_LIBBIONIC
+ifdef CONFIG_BIONIC
+ifdef NO_LIBBIONIC
+dummy := $(info Disabling CONFIG_BIONIC)
+dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
+endif
+endif
+
+all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
new file mode 100644
index 0000000..2ec91f3
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -0,0 +1,46 @@
+
+include $(KCONFIG_CONFIG)
+
+ifndef CONFIG_LIBPERL
+NO_LIBPERL := 1
+endif
+
+ifndef CONFIG_LIBPYTHON
+NO_LIBPYTHON := 1
+endif
+
+ifndef CONFIG_TUI
+NO_SLANG := 1
+endif
+
+ifndef CONFIG_GTK2
+NO_GTK2 := 1
+endif
+
+ifndef CONFIG_DEMANGLE
+NO_DEMANGLE := 1
+endif
+
+ifndef CONFIG_LIBELF
+NO_LIBELF := 1
+endif
+
+ifndef CONFIG_LIBUNWIND
+NO_LIBUNWIND := 1
+endif
+
+ifndef CONFIG_BACKTRACE
+NO_BACKTRACE := 1
+endif
+
+ifndef CONFIG_NUMA
+export NO_LIBNUMA := 1
+endif
+
+ifndef CONFIG_LIBAUDIT
+NO_LIBAUDIT := 1
+endif
+
+ifdef CONFIG_BIONIC
+NO_LIBBIONIC := 1
+endif
diff --git a/tools/perf/config/defconfig b/tools/perf/config/defconfig
new file mode 100644
index 0000000..7a385f1
--- /dev/null
+++ b/tools/perf/config/defconfig
@@ -0,0 +1,54 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux Kernel Configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+# CONFIG_BUILTIN_ANNOTATE is not set
+# CONFIG_BUILTIN_BENCH is not set
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+# CONFIG_BUILTIN_KMEM is not set
+# CONFIG_BUILTIN_KVM is not set
+# CONFIG_BUILTIN_LIST is not set
+# CONFIG_BUILTIN_LOCK is not set
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# Libraries
+#
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_BACKTRACE=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_NUMA is not set
+# CONFIG_DEMANGLE is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+# CONFIG_GTK2 is not set
+
+#
+# Build
+#
+CONFIG_DEBUG=y
+# CONFIG_DEBUG_PARSER is not set
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..fa54dd5
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
@@ -0,0 +1,3 @@
+obj-y += Context.o
+
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS)
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..0f32b85
--- /dev/null
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
@@ -0,0 +1,4 @@
+obj-y += Context.o
+
+CFLAGS_Context.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
diff --git a/tools/perf/tests/Kbuild b/tools/perf/tests/Kbuild
new file mode 100644
index 0000000..f2998a6
--- /dev/null
+++ b/tools/perf/tests/Kbuild
@@ -0,0 +1,23 @@
+obj-y += builtin-test.o
+obj-y += attr.o
+obj-y += dso-data.o
+obj-y += evsel-roundtrip-name.o
+obj-y += evsel-tp-sched.o
+obj-y += hists_link.o
+obj-y += mmap-basic.o
+obj-y += open-syscall-all-cpus.o
+obj-y += open-syscall.o
+obj-y += open-syscall-tp-fields.o
+obj-y += parse-events.o
+obj-y += perf-record.o
+obj-y += pmu.o
+obj-y += python-use.o
+obj-y += rdpmc.o
+obj-y += vmlinux-kallsyms.o
+obj-y += bp_signal.o
+obj-y += bp_signal_overflow.o
+obj-y += sw-clock.o
+obj-y += task-exit.o
+
+CFLAGS_python-use.o += -DPYTHON='"$(PYTHON_WORD)"' -DPYTHONPATH='"python"'
+CFLAGS_attr.o += -DPYTHON='"$(PYTHON_WORD)"' -DBINDIR='"$(bindir_SQ)"'
diff --git a/tools/perf/ui/Kbuild b/tools/perf/ui/Kbuild
new file mode 100644
index 0000000..f687132
--- /dev/null
+++ b/tools/perf/ui/Kbuild
@@ -0,0 +1,14 @@
+obj-$(CONFIG_TUI) += browser.o
+obj-y += helpline.o
+obj-y += hist.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
+
+obj-y += browsers/
+obj-y += stdio/
+
+obj-$(CONFIG_TUI)  += tui/
+obj-$(CONFIG_GTK2) += gtk/
+
+CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
new file mode 100644
index 0000000..43bfcbf
--- /dev/null
+++ b/tools/perf/ui/browsers/Kbuild
@@ -0,0 +1,6 @@
+obj-$(CONFIG_TUI) += annotate.o
+obj-$(CONFIG_TUI) += hists.o
+obj-$(CONFIG_TUI) += map.o
+obj-$(CONFIG_TUI) += scripts.o
+
+CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/gtk/Kbuild b/tools/perf/ui/gtk/Kbuild
new file mode 100644
index 0000000..6964926
--- /dev/null
+++ b/tools/perf/ui/gtk/Kbuild
@@ -0,0 +1,7 @@
+obj-y += browser.o
+obj-y += hists.o
+obj-y += setup.o
+obj-y += util.o
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += annotate.o
diff --git a/tools/perf/ui/stdio/Kbuild b/tools/perf/ui/stdio/Kbuild
new file mode 100644
index 0000000..9de4bd9
--- /dev/null
+++ b/tools/perf/ui/stdio/Kbuild
@@ -0,0 +1 @@
+obj-y += hist.o
diff --git a/tools/perf/ui/tui/Kbuild b/tools/perf/ui/tui/Kbuild
new file mode 100644
index 0000000..e282409
--- /dev/null
+++ b/tools/perf/ui/tui/Kbuild
@@ -0,0 +1,4 @@
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
new file mode 100644
index 0000000..10d5376
--- /dev/null
+++ b/tools/perf/util/Kbuild
@@ -0,0 +1,113 @@
+obj-y += abspath.o
+obj-y += alias.o
+obj-y += annotate.o
+obj-y += bitmap.o
+obj-y += build-id.o
+obj-y += callchain.o
+obj-y += cgroup.o
+obj-y += color.o
+obj-y += config.o
+obj-y += cpumap.o
+obj-y += ctype.o
+obj-y += debug.o
+obj-y += dso.o
+obj-y += environment.o
+obj-y += event.o
+obj-y += evlist.o
+obj-y += evsel.o
+obj-y += exec_cmd.o
+obj-y += header.o
+obj-y += help.o
+obj-y += hist.o
+obj-y += hweight.o
+obj-y += intlist.o
+obj-y += levenshtein.o
+obj-y += machine.o
+obj-y += map.o
+obj-y += pager.o
+obj-y += parse-options.o
+obj-y += path.o
+obj-y += pmu-flex.o
+obj-y += pmu-bison.o
+obj-y += pmu.o
+obj-y += pstack.o
+obj-y += quote.o
+obj-y += rblist.o
+obj-y += run-command.o
+obj-y += session.o
+obj-y += sigchain.o
+obj-y += sort.o
+obj-y += stat.o
+obj-y += strbuf.o
+obj-y += strfilter.o
+obj-y += string.o
+obj-y += strlist.o
+obj-y += svghelper.o
+obj-y += symbol.o
+
+obj-$(CONFIG_LIBUNWIND) += unwind.o
+
+obj-$(CONFIG_LIBELF) += symbol-elf.o
+obj-$(CONFIG_LIBELF) += dwarf-aux.o
+obj-$(CONFIG_LIBELF) += probe-event.o
+obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
+
+obj-y += sysfs.o
+obj-y += target.o
+obj-y += thread.o
+obj-y += thread_map.o
+obj-y += top.o
+obj-y += usage.o
+obj-y += util.o
+obj-y += values.o
+obj-y += xyarray.o
+obj-y += vdso.o
+obj-y += wrapper.o
+obj-y += trace-event-info.o
+obj-y += trace-event-parse.o
+obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
+obj-y += trace-event-read.o
+
+obj-y += scripting-engines/
+
+define bison
+$(Q)echo '  BI      $@'
+$(Q)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) -o $@ -p $1
+endef
+
+define flex
+$(Q)echo '  FL      $@';
+$(Q)$(FLEX) --header-file=$(basename $@).h $(PARSER_DEBUG_FLEX) -t $< > $@
+endef
+
+obj-y += parse-events-flex.o
+obj-y += parse-events-bison.o
+obj-y += parse-events.o
+
+$(obj)/parse-events-bison.c: $(src)/parse-events.y
+	$(call bison,parse_events_)
+
+$(obj)/parse-events-flex.c: $(src)/parse-events.l $(obj)/parse-events-bison.c
+	$(call flex)
+
+$(src)/parse-events-flex.o: $(src)/parse-events-flex.c
+$(src)/parse-events-bison.o: $(src)/parse-events-bison.c
+
+$(src)/pmu-bison.c: $(src)/pmu.y
+	$(call bison,perf_pmu_)
+
+$(src)/pmu-flex.c: $(src)/pmu.l $(src)/pmu-bison.c
+	$(call flex)
+
+$(src)/pmu-flex.o: $(src)/pmu-flex.c
+$(src)/pmu-bison.o: $(src)/pmu-bison.c
+
+CFLAGS_parse-events-flex.o  += -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_pmu-flex.o  += -w
+CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+
+CFLAGS_config.o += -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"'
+CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH='"$(perfexecdir_SQ)"' -DPREFIX='"$(prefix_SQ)"'
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 39f1750..efb74f0 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -9,6 +9,10 @@ GVF=${OUTPUT}PERF-VERSION-FILE
 LF='
 '
 
+if [ "${srctree}x" = "x" ]; then
+srctree=../..
+fi
+
 #
 # First check if there is a .git to get the version from git describe
 # otherwise try to get the version from the kernel Makefile
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 05ee30f..5d84ffc 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -15,7 +15,7 @@ struct cmdname_help
 
 static struct cmdname_help common_cmds[] = {"
 
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -26,12 +26,12 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -42,7 +42,7 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
diff --git a/tools/perf/util/scripting-engines/Kbuild b/tools/perf/util/scripting-engines/Kbuild
new file mode 100644
index 0000000..b6360ee
--- /dev/null
+++ b/tools/perf/util/scripting-engines/Kbuild
@@ -0,0 +1,7 @@
+obj-$(CONFIG_LIBPERL)   += trace-event-perl.o
+obj-$(CONFIG_LIBPYTHON) += trace-event-python.o
+
+CFLAGS_trace-event-perl.o   := $(PERL_EMBED_CCOPTS)
+
+CFLAGS_trace-event-python.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index d0aee4b..a5c73de 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -2,6 +2,7 @@
 
 from distutils.core import setup, Extension
 from os import getenv
+from os import environ
 
 from distutils.command.build_ext   import build_ext   as _build_ext
 from distutils.command.install_lib import install_lib as _install_lib
@@ -27,8 +28,11 @@ build_tmp = getenv('PYTHON_EXTBUILD_TMP')
 libtraceevent = getenv('LIBTRACEEVENT')
 libapikfs = getenv('LIBAPIKFS')
 
-ext_sources = [f.strip() for f in file('util/python-ext-sources')
-				if len(f.strip()) > 0 and f[0] != '#']
+if environ.has_key('PYTHON_EXT_SRCS'):
+    ext_sources = getenv('PYTHON_EXT_SRCS').split()
+else:
+    ext_sources = [f.strip() for f in file('util/python-ext-sources')
+                                   if len(f.strip()) > 0 and f[0] != '#']
 
 perf = Extension('perf',
 		  sources = ext_sources,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (4 preceding siblings ...)
  2014-06-03 22:05     ` [PATCH 04/32] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-04  1:50       ` David Ahern
  2014-06-03 22:05     ` [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
                       ` (26 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Makefile.kbuild | 2 +-
 tools/perf/config/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 1e3621f..b2d0d08 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -90,7 +90,7 @@ VPATH += $(src-perf)
 
 export src-perf obj-perf
 
-OUTPUT := $(obj-perf)
+OUTPUT := $(obj-perf)/
 
 export OUTPUT
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 78ee62d..1760f57 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -135,7 +135,7 @@ endif
 
 feature_check = $(eval $(feature_check_code))
 define feature_check_code
-  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
+  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(src-perf)/config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
 endef
 
 feature_set = $(eval $(feature_set_code))
@@ -234,7 +234,7 @@ ifeq ($(feature-all), 1)
   #
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
 else
-  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
+  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C $(src-perf)/config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
 endif
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...)
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (5 preceding siblings ...)
  2014-06-03 22:05     ` [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
@ 2014-06-03 22:05     ` Alexis Berlemont
  2014-06-04  1:52       ` David Ahern
  2014-06-03 22:06     ` [PATCH 07/32] perf kbuild: remove useless #ifdef directives Alexis Berlemont
                       ` (25 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Makefile.kbuild | 5 ++++-
 tools/perf/config/Makefile | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index b2d0d08..e82615f 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -212,8 +212,11 @@ export prefix_SQ
 export PARSER_DEBUG_BISON
 export PARSER_DEBUG_FLEX
 export ETC_PERFCONFIG_SQ
+export libdir_SQ
 export PYTHON_EMBED_CCOPTS
 export PERL_EMBED_CCOPTS
+export GTK_CFLAGS
+
 endif
 
 # let sources know it's kbuild
@@ -262,7 +265,7 @@ $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
 LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
-	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS) $(GTK_LIBS)
 
 $(LIBTRACEEVENT): FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 1760f57..e10e8bf 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -774,7 +774,10 @@ all:
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
+	$(call store,libdir_SQ)
 	$(call store,perfexec_instdir_SQ)
 	$(call store,sysconfdir_SQ)
+	$(call store,GTK_CFLAGS)
+	$(call store,GTK_LIBS)
 
 endif # CONFIG_DETECTED
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 07/32] perf kbuild: remove useless #ifdef directives
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (6 preceding siblings ...)
  2014-06-03 22:05     ` [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-04  1:53       ` David Ahern
  2014-06-03 22:06     ` [PATCH 08/32] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
                       ` (24 subsequent siblings)
  32 siblings, 1 reply; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/ui/setup.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 66ecd08..cb69740 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -71,20 +71,16 @@ void setup_browser(bool fallback_to_pager)
 
 	switch (use_browser) {
 	case 2:
-#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		if (setup_gtk_browser() == 0)
 			break;
 		printf("GTK browser requested but could not find %s\n",
 		       PERF_GTK_DSO);
 		sleep(1);
-#endif
 		/* fall through */
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
-#endif
 		/* fall through */
 	default:
 		use_browser = 0;
@@ -100,16 +96,12 @@ void exit_browser(bool wait_for_ok __maybe_unused)
 {
 	switch (use_browser) {
 	case 2:
-#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
 		exit_gtk_browser(wait_for_ok);
 		break;
-#endif
 
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-#endif
 
 	default:
 		break;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 08/32] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (7 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 07/32] perf kbuild: remove useless #ifdef directives Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 09/32] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
                       ` (23 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/perf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 74a1269..588221c 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -95,7 +95,7 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_TEST
 	{ "test",	cmd_test,	0 },
 #endif
-#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
+#ifdef CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_INJECT
@@ -524,7 +524,7 @@ int main(int argc, const char **argv)
 		fprintf(stderr, "cannot handle %s internally", cmd);
 		goto out;
 	}
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#ifdef CONFIG_BUILTIN_TRACE
 	if (!prefixcmp(cmd, "trace")) {
 		set_buildid_dir();
 		setup_path();
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 09/32] perf kbuild: add missing files and missing flags in Kbuild files
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (8 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 08/32] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 10/32] perf kbuild: update kbuild files according to last changes Alexis Berlemont
                       ` (22 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/arch/x86/util/Kbuild                  |  1 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild |  3 ++-
 tools/perf/tests/Kbuild                          | 15 +++++++++++++--
 tools/perf/ui/Kbuild                             |  1 +
 tools/perf/ui/browsers/Kbuild                    |  2 ++
 tools/perf/ui/gtk/Kbuild                         |  2 ++
 tools/perf/util/Kbuild                           | 12 +++++++++---
 tools/perf/util/scripting-engines/Kbuild         |  6 +++++-
 8 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
index 0ba617a..e033b94 100644
--- a/tools/perf/arch/x86/util/Kbuild
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -1,3 +1,4 @@
 obj-y += dwarf-regs.o
 obj-y += header.o
+obj-y += tsc.o
 obj-$(CONFIG_LIBUNWIND) += unwind.o
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
index 0f32b85..7884730 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
@@ -1,4 +1,5 @@
 obj-y += Context.o
 
 CFLAGS_Context.o := $(PYTHON_EMBED_CCOPTS)
-CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs
diff --git a/tools/perf/tests/Kbuild b/tools/perf/tests/Kbuild
index f2998a6..b4e7682 100644
--- a/tools/perf/tests/Kbuild
+++ b/tools/perf/tests/Kbuild
@@ -18,6 +18,17 @@ obj-y += bp_signal.o
 obj-y += bp_signal_overflow.o
 obj-y += sw-clock.o
 obj-y += task-exit.o
+obj-y += code-reading.o
+obj-y += sample-parsing.o
+obj-y += keep-tracking.o
+obj-y += parse-no-sample-id-all.o
 
-CFLAGS_python-use.o += -DPYTHON='"$(PYTHON_WORD)"' -DPYTHONPATH='"python"'
-CFLAGS_attr.o += -DPYTHON='"$(PYTHON_WORD)"' -DBINDIR='"$(bindir_SQ)"'
+
+# TODO: this should only be included if arch = x86
+obj-y += perf-time-to-tsc.o
+
+CFLAGS_python-use.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_python-use.o += -D"PYTHONPATH=KBUILD_STR(python)"
+
+CFLAGS_attr.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_attr.o += -D"BINDIR=KBUILD_STR($(bindir_SQ))"
diff --git a/tools/perf/ui/Kbuild b/tools/perf/ui/Kbuild
index f687132..44ad988 100644
--- a/tools/perf/ui/Kbuild
+++ b/tools/perf/ui/Kbuild
@@ -12,3 +12,4 @@ obj-$(CONFIG_TUI)  += tui/
 obj-$(CONFIG_GTK2) += gtk/
 
 CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_setup.o += -D"LIBDIR=KBUILD_STR($(libdir_SQ))"
\ No newline at end of file
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
index 43bfcbf..03938aa 100644
--- a/tools/perf/ui/browsers/Kbuild
+++ b/tools/perf/ui/browsers/Kbuild
@@ -4,3 +4,5 @@ obj-$(CONFIG_TUI) += map.o
 obj-$(CONFIG_TUI) += scripts.o
 
 CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_map.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_scripts.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/gtk/Kbuild b/tools/perf/ui/gtk/Kbuild
index 6964926..83e3e58 100644
--- a/tools/perf/ui/gtk/Kbuild
+++ b/tools/perf/ui/gtk/Kbuild
@@ -5,3 +5,5 @@ obj-y += util.o
 obj-y += helpline.o
 obj-y += progress.o
 obj-y += annotate.o
+
+subdir-ccflags-y := $(GTK_CFLAGS)
\ No newline at end of file
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 10d5376..6fb42a6 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -6,6 +6,7 @@ obj-y += build-id.o
 obj-y += callchain.o
 obj-y += cgroup.o
 obj-y += color.o
+obj-y += comm.o
 obj-y += config.o
 obj-y += cpumap.o
 obj-y += ctype.o
@@ -38,6 +39,9 @@ obj-y += session.o
 obj-y += sigchain.o
 obj-y += sort.o
 obj-y += stat.o
+obj-y += record.o
+obj-y += srcline.o
+obj-y += data.o
 obj-y += strbuf.o
 obj-y += strfilter.o
 obj-y += string.o
@@ -54,7 +58,7 @@ obj-$(CONFIG_LIBELF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
-obj-y += sysfs.o
+obj-y += fs.o
 obj-y += target.o
 obj-y += thread.o
 obj-y += thread_map.o
@@ -106,8 +110,10 @@ $(src)/pmu-bison.o: $(src)/pmu-bison.c
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events.o  += -Wno-redundant-decls
 CFLAGS_pmu-flex.o  += -w
 CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
-CFLAGS_config.o += -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"'
-CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH='"$(perfexecdir_SQ)"' -DPREFIX='"$(prefix_SQ)"'
+CFLAGS_config.o += -D"ETC_PERFCONFIG=KBUILD_STR($(ETC_PERFCONFIG_SQ))"
+CFLAGS_exec_cmd.o += -D"PERF_EXEC_PATH=KBUILD_STR($(perfexecdir_SQ))"
+CFLAGS_exec_cmd.o += -D"PREFIX=KBUILD_STR($(prefix_SQ))"
diff --git a/tools/perf/util/scripting-engines/Kbuild b/tools/perf/util/scripting-engines/Kbuild
index b6360ee..ebe216c 100644
--- a/tools/perf/util/scripting-engines/Kbuild
+++ b/tools/perf/util/scripting-engines/Kbuild
@@ -2,6 +2,10 @@ obj-$(CONFIG_LIBPERL)   += trace-event-perl.o
 obj-$(CONFIG_LIBPYTHON) += trace-event-python.o
 
 CFLAGS_trace-event-perl.o   := $(PERL_EMBED_CCOPTS)
+CFLAGS_trace-event-perl.o   += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_trace-event-perl.o   += -Wno-unused-parameter -Wno-shadow -Wno-undef
+CFLAGS_trace-event-perl.o   += -Wno-switch-default
 
 CFLAGS_trace-event-python.o := $(PYTHON_EMBED_CCOPTS)
-CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
+CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_trace-event-python.o += -Wno-unused-parameter -Wno-shadow
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 10/32] perf kbuild: update kbuild files according to last changes
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (9 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 09/32] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 11/32] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
                       ` (21 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Kbuild             |  2 +-
 tools/perf/Makefile.kbuild    | 30 +++++++++++++-----------------
 tools/perf/ui/browsers/Kbuild |  1 +
 tools/perf/util/Kbuild        |  1 +
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/tools/perf/Kbuild b/tools/perf/Kbuild
index 80b9184..16cb804 100644
--- a/tools/perf/Kbuild
+++ b/tools/perf/Kbuild
@@ -26,6 +26,7 @@ obj-$(CONFIG_BUILTIN_MEM)           += builtin-mem.o
 obj-$(CONFIG_BUILTIN_TEST)          += tests/
 
 obj-y += ../../lib/rbtree.o
+obj-y += ../lib/symbol/kallsyms.o
 
 obj-y += util/
 obj-y += ui/
@@ -34,7 +35,6 @@ obj-y += arch/
 obj-$(CONFIG_LIBPERL)   += scripts/perl/Perf-Trace-Util/
 obj-$(CONFIG_LIBPYTHON) += scripts/python/Perf-Trace-Util/
 
-
 CFLAGS_rbtree.o += -Wno-unused-parameter
 
 CFLAGS_perf.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index e82615f..e56eb47 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -102,8 +102,9 @@ HOSTCC  = gcc
 FLEX    = flex
 BISON   = bison
 INSTALL = install
+PKG_CONFIG = pkg-config
 
-export AS LD CC CPP HOSTCC FLEX BISON
+export AS LD CC CPP HOSTCC FLEX BISON PKG_CONFIG
 
 # kbuild related config
 CONFIG_SHELL          := /bin/sh
@@ -126,14 +127,11 @@ CONFIG_DETECTED := $(obj-perf)/.config-detected
 export CONFIG_DETECTED
 
 # external .a libs
-LK_DIR          := $(srctree)/tools/lib/lk/
-TRACE_EVENT_DIR := $(srctree)/tools/lib/traceevent/
-
 LIBTRACEEVENT   := $(obj-kernel)/tools/lib/traceevent/libtraceevent.a
-LIBLK           := $(obj-kernel)/tools/lib/lk/liblk.a
-LIBS_A          := $(LIBTRACEEVENT) $(LIBLK)
+LIBAPIKFS       := $(obj-kernel)/tools/lib/api/libapikfs.a
+LIBS_A          := $(LIBTRACEEVENT) $(LIBAPIKFS)
 
-export TRACE_EVENT_DIR LK_DIR LIBTRACEEVENT LIBLK
+export LIBTRACEEVENT LIBAPIKFS
 
 all:
 
@@ -168,7 +166,7 @@ clean-dirs := $(addprefix _clean_, tools/perf/)
 $(clean-dirs):
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
 
-clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBLK)-clean
+clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean
 	$(Q)$(QUIET_CLEAN)
 	$(Q)rm -f $(obj-perf)/perf
 	$(Q)rm -f $(obj-perf)/common-cmds.h
@@ -275,15 +273,13 @@ $(LIBTRACEEVENT)-clean: FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
 	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
 
-PHONY += $(TRACE_EVENT_DIR) $(TRACE_EVENT_DIR)-clean
-
-$(LIBLK): FORCE
-	@mkdir -p $(obj-kernel)/tools/lib/lk
-	$(Q)$(MAKE) -C $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk
+$(LIBAPIKFS): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -C $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api
 
-$(LIBLK)-clean: FORCE
-	@mkdir -p $(obj-kernel)/tools/lib/lk
-	$(Q)$(MAKE) -sC $(srctree)/tools/lib/lk O=$(obj-kernel)/tools/lib/lk clean
+$(LIBAPIKFS)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api clean
 
 tools/perf/PERF-VERSION-FILE: FORCE
 	$(QUIET_GEN)$(SHELL_PATH) $(src-perf)/util/PERF-VERSION-GEN $(obj-perf)/
@@ -401,7 +397,7 @@ dummy := $(info DEBUG KCONFIG_TRISTATE      $(KCONFIG_TRISTATE))
 dummy := $(info DEBUG KCONFIG_AUTOHEADER    $(KCONFIG_AUTOHEADER))
 dummy := $(info DEBUG KCONFIG_AUTOCONFIG    $(KCONFIG_AUTOCONFIG))
 dummy := $(info DEBUG TRACE_EVENT_DIR       $(TRACE_EVENT_DIR))
-dummy := $(info DEBUG LK_DIR                $(LK_DIR))
+dummy := $(info DEBUG LIBAPIKFS             $(LIBAPIKFS))
 endif
 
 endif  # skip-makefile
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
index 03938aa..3a5fd55 100644
--- a/tools/perf/ui/browsers/Kbuild
+++ b/tools/perf/ui/browsers/Kbuild
@@ -1,4 +1,5 @@
 obj-$(CONFIG_TUI) += annotate.o
+obj-$(CONFIG_TUI) += header.o
 obj-$(CONFIG_TUI) += hists.o
 obj-$(CONFIG_TUI) += map.o
 obj-$(CONFIG_TUI) += scripts.o
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 6fb42a6..4d0b6da 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -69,6 +69,7 @@ obj-y += values.o
 obj-y += xyarray.o
 obj-y += vdso.o
 obj-y += wrapper.o
+obj-y += trace-event.o
 obj-y += trace-event-info.o
 obj-y += trace-event-parse.o
 obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 11/32] perf kbuild: remove legacy slang-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (10 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 10/32] perf kbuild: update kbuild files according to last changes Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 12/32] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
                       ` (20 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_SLANG (replaced by CONFIG_LIBSLANG)
Remove HAVE_SLANG_SUPPORT from CFLAGS (replaced by CONFIG_LIBSLANG)
---
 tools/perf/Kconfig                    | 11 +++++++++--
 tools/perf/config/Makefile            | 12 +++---------
 tools/perf/config/Makefile.fix-config | 16 ----------------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 tools/perf/ui/ui.h                    |  4 +++-
 tools/perf/util/annotate.h            |  4 +++-
 tools/perf/util/hist.h                |  4 +++-
 7 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 108b422..5f5d1f7 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -32,7 +32,7 @@ config BUILTIN_TOP
 config BUILTIN_TRACE
 	bool "trace"
 	default n
-	depends on CONFIG_LIBAUDIT
+	depends on LIBAUDIT
         ---help---
 	  Strace inspired tool.
 
@@ -153,6 +153,12 @@ endmenu
 
 menu "Libraries"
 
+config LIBSLANG
+	bool "Slang (libslang)"
+	default n
+        ---help---
+	  libslang
+
 config LIBAUDIT
 	bool "Audit (libaudit)"
 	default n
@@ -237,7 +243,8 @@ config STDIO
 	  Most basic display mode.
 
 config TUI
-	bool "Tui (newt based)"
+	bool "Tui (slang based)"
+	depends on LIBSLANG
 	default n
         ---help---
 	  Text-based user interface which provides windowing
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index e10e8bf..fa07862 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -402,18 +402,13 @@ ifndef NO_LIBAUDIT
   endif
 endif
 
-ifdef NO_NEWT
-  NO_SLANG=1
-endif
-
-ifndef NO_SLANG
+ifdef CONFIG_LIBSLANG
   ifneq ($(feature-libslang), 1)
-    msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
-    NO_SLANG := 1
+    msg := $(warning slang not found, disables SLANG and TUI supports. Please install slang-devel or libslang-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBSLANG)
   else
     # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
     CFLAGS += -I/usr/include/slang
-    CFLAGS += -DHAVE_SLANG_SUPPORT
     EXTLIBS += -lslang
   endif
 endif
@@ -762,7 +757,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_NEWT)
 	$(call store,NO_GTK2)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 7f65fdb..a8e5539 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,22 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_NEWT
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_SLANG
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
 # NO_GTK2
 ifdef CONFIG_GTK2
 ifdef NO_GTK2
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 2ec91f3..18acc92 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_TUI
-NO_SLANG := 1
-endif
-
 ifndef CONFIG_GTK2
 NO_GTK2 := 1
 endif
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index ab88383..bba3a0e 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -5,6 +5,8 @@
 #include <stdbool.h>
 #include <linux/compiler.h>
 
+#include "generated/autoconf.h"
+
 extern pthread_mutex_t ui__lock;
 extern void *perf_gtk_handle;
 
@@ -13,7 +15,7 @@ extern int use_browser;
 void setup_browser(bool fallback_to_pager);
 void exit_browser(bool wait_for_ok);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int ui__init(void);
 void ui__exit(bool wait_for_ok);
 #else
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 56ad4f5..50aff7c 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -11,6 +11,8 @@
 #include <linux/rbtree.h>
 #include <pthread.h>
 
+#include "generated/autoconf.h"
+
 struct ins;
 
 struct ins_operands {
@@ -157,7 +159,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel, bool print_lines,
 			 bool full_paths, int min_pcnt, int max_lines);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int symbol__tui_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel,
 			 struct hist_browser_timer *hbt);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 1f1f513..0daa3a5 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -8,6 +8,8 @@
 #include "color.h"
 #include "ui/progress.h"
 
+#include "generated/autoconf.h"
+
 extern struct callchain_param callchain_param;
 
 struct hist_entry;
@@ -211,7 +213,7 @@ struct hist_browser_timer {
 	int refresh;
 };
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 #include "../ui/keysyms.h"
 int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
 			     struct hist_browser_timer *hbt);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 12/32] perf kbuild: remove legacy libaudit-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (11 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 11/32] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 13/32] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
                       ` (19 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_LIBAUDIT (replaced by CONFIG_LIBAUDIT)
Remove HAVE_LIBAUDIT_SUPPORT from CFLAGS (replaced by CONFIG_LIBAUDIT)
---
 tools/perf/config/Makefile            | 8 +++-----
 tools/perf/config/Makefile.fix-config | 8 --------
 tools/perf/config/Makefile.fix-legacy | 4 ----
 3 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index fa07862..96bb232 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -392,12 +392,11 @@ ifndef NO_LIBUNWIND
   LDFLAGS += $(LIBUNWIND_LDFLAGS)
 endif
 
-ifndef NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
-    msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
-    NO_LIBAUDIT := 1
+    msg := $(warning No libaudit.h found, disables LIBAUDIT support and 'trace' tool, please install audit-libs-devel or libaudit-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBAUDIT)
   else
-    CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
     EXTLIBS += -laudit
   endif
 endif
@@ -763,7 +762,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_BACKTRACE)
 	$(call store,NO_LIBNUMA)
-	$(call store,NO_LIBAUDIT)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index a8e5539..77f9840 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -69,14 +69,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
 endif
 endif
 
-# NO_LIBAUDIT
-ifdef CONFIG_LIBAUDIT
-ifdef NO_LIBAUDIT
-dummy := $(info Disabling CONFIG_LIBAUDIT)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
-endif
-endif
-
 # NO_LIBBIONIC
 ifdef CONFIG_BIONIC
 ifdef NO_LIBBIONIC
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 18acc92..ab72582 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -33,10 +33,6 @@ ifndef CONFIG_NUMA
 export NO_LIBNUMA := 1
 endif
 
-ifndef CONFIG_LIBAUDIT
-NO_LIBAUDIT := 1
-endif
-
 ifdef CONFIG_BIONIC
 NO_LIBBIONIC := 1
 endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 13/32] perf kbuild: remove legacy libgtk2-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (12 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 12/32] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 14/32] perf kbuild: remove legacy libperl-related " Alexis Berlemont
                       ` (18 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_GTK2 (replaced by CONFIG_LIBGTK2 or CONFIG_GTK2)
Remove HAVE_GTK2_SUPPORT from CFLAGS (replaced by CONFIG_LIBGTK2)
Remove HAVE_GTK_INFO_BAR_SUPPORT from CFLAGS (replaced by
CONFIG_LIBGTK2_INFOBAR)
---
 tools/perf/Kconfig                    | 13 +++++++++++++
 tools/perf/config/Makefile            |  8 +++-----
 tools/perf/config/Makefile.fix-config |  8 --------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 tools/perf/ui/gtk/browser.c           |  4 +++-
 tools/perf/ui/gtk/gtk.h               |  5 +++--
 tools/perf/ui/gtk/util.c              |  6 ++++--
 tools/perf/ui/setup.c                 |  4 +++-
 8 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 5f5d1f7..5ca0527 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -165,6 +165,19 @@ config LIBAUDIT
         ---help---
 	  Linux audit framework dependency.
 
+config LIBGTK2
+	bool "Gtk2 (libgtk2)"
+	default n
+        ---help---
+	  libgtk2
+
+config LIBGTK2_INFOBAR
+	bool "Gtk2 infobar (libgtk2)"
+	depends on LIBGTK2
+	default n
+        ---help---
+	  libgtk2-infobar
+
 config LIBPERL
 	bool "Perl"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 96bb232..040cdcc 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -412,16 +412,15 @@ ifdef CONFIG_LIBSLANG
   endif
 endif
 
-ifndef NO_GTK2
+ifdef CONFIG_LIBGTK2
   FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
   ifneq ($(feature-gtk2), 1)
     msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
-    NO_GTK2 := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2)
   else
     ifeq ($(feature-gtk2-infobar), 1)
-      GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2_INFOBAR)
     endif
-    CFLAGS += -DHAVE_GTK2_SUPPORT
     GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
     GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
     EXTLIBS += -ldl
@@ -756,7 +755,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_GTK2)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 77f9840..efe2ee7 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,14 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_GTK2
-ifdef CONFIG_GTK2
-ifdef NO_GTK2
-dummy := $(info Disabling CONFIG_GTK2)
-dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
-endif
-endif
-
 # NO_DEMANGLE
 ifdef CONFIG_DEMANGLE
 ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ab72582..ae69a1b 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_GTK2
-NO_GTK2 := 1
-endif
-
 ifndef CONFIG_DEMANGLE
 NO_DEMANGLE := 1
 endif
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c
index c24d912..f4df6a6 100644
--- a/tools/perf/ui/gtk/browser.c
+++ b/tools/perf/ui/gtk/browser.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../evlist.h"
 #include "../cache.h"
 #include "../evsel.h"
@@ -43,7 +45,7 @@ const char *perf_gtk__get_percent_color(double percent)
 	return NULL;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void)
 {
 	GtkWidget *info_bar;
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index 0a9173f..3762980 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -7,12 +7,13 @@
 #include <gtk/gtk.h>
 #pragma GCC diagnostic error "-Wstrict-prototypes"
 
+#include "generated/autoconf.h"
 
 struct perf_gtk_context {
 	GtkWidget *main_window;
 	GtkWidget *notebook;
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	GtkWidget *info_bar;
 	GtkWidget *message_label;
 #endif
@@ -42,7 +43,7 @@ void perf_gtk__resize_window(GtkWidget *window);
 const char *perf_gtk__get_percent_color(double percent);
 GtkWidget *perf_gtk__setup_statusbar(void);
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void);
 #else
 static inline GtkWidget *perf_gtk__setup_info_bar(void)
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index 52e7fc4..dde1615 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../util.h"
 #include "../../util/debug.h"
 #include "gtk.h"
@@ -52,7 +54,7 @@ static int perf_gtk__error(const char *format, va_list args)
 	return 0;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 static int perf_gtk__warning_info_bar(const char *format, va_list args)
 {
 	char *msg;
@@ -104,7 +106,7 @@ static int perf_gtk__warning_statusbar(const char *format, va_list args)
 
 struct perf_error_ops perf_gtk_eops = {
 	.error		= perf_gtk__error,
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	.warning	= perf_gtk__warning_info_bar,
 #else
 	.warning	= perf_gtk__warning_statusbar,
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index cb69740..8bb51d2 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -1,6 +1,8 @@
 #include <pthread.h>
 #include <dlfcn.h>
 
+#include "generated/autoconf.h"
+
 #include "../util/cache.h"
 #include "../util/debug.h"
 #include "../util/hist.h"
@@ -8,7 +10,7 @@
 pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
 void *perf_gtk_handle;
 
-#ifdef HAVE_GTK2_SUPPORT
+#ifdef CONFIG_GTK2
 static int setup_gtk_browser(void)
 {
 	int (*perf_ui_init)(void);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 14/32] perf kbuild: remove legacy libperl-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (13 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 13/32] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 15/32] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
                       ` (17 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_LIBPERL (replaced by CONFIG_LIBPERL)
---
 tools/perf/builtin-script.c             |  4 +++-
 tools/perf/config/Makefile              |  8 ++------
 tools/perf/config/Makefile.fix-config   |  8 --------
 tools/perf/config/Makefile.fix-legacy   |  4 ----
 tools/perf/util/trace-event-scripting.c | 10 +++++-----
 5 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9e9c91f..ff67f0d 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "builtin.h"
 
 #include "perf.h"
@@ -1362,7 +1364,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
 			 lang_dirent.d_name);
-#ifdef NO_LIBPERL
+#ifndef CONFIG_LIBPERL
 		if (strstr(lang_path, "perl"))
 			continue;
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 040cdcc..93c3321 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -430,9 +430,7 @@ endif
 grep-libs  = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
-ifdef NO_LIBPERL
-  CFLAGS += -DNO_LIBPERL
-else
+ifdef CONFIG_LIBPERL
   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
@@ -440,8 +438,7 @@ else
   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
 
   ifneq ($(feature-libperl), 1)
-    CFLAGS += -DNO_LIBPERL
-    NO_LIBPERL := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPERL)
   else
     LDFLAGS += $(PERL_EMBED_LDFLAGS)
     EXTLIBS += $(PERL_EMBED_LIBADD)
@@ -753,7 +750,6 @@ all:
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index efe2ee7..6402a47 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,14 +3,6 @@ include $(KCONFIG_CONFIG)
 
 CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
-# NO_LIBPERL
-ifdef CONFIG_LIBPERL
-ifdef NO_LIBPERL
-dummy := $(info Disabling CONFIG_LIBPERL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
-endif
-endif
-
 # NO_LIBPYTHON
 ifdef CONFIG_LIBPYTHON
 ifdef NO_LIBPYTHON
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ae69a1b..2e93006 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,10 +1,6 @@
 
 include $(KCONFIG_CONFIG)
 
-ifndef CONFIG_LIBPERL
-NO_LIBPERL := 1
-endif
-
 ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 57aaccc..51d8019 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -156,16 +156,16 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPERL
+#ifdef CONFIG_LIBPERL
+extern struct scripting_ops perl_scripting_ops;
+
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_unsupported_ops);
+	register_perl_scripting(&perl_scripting_ops);
 }
 #else
-extern struct scripting_ops perl_scripting_ops;
-
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_ops);
+	register_perl_scripting(&perl_scripting_unsupported_ops);
 }
 #endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 15/32] perf kbuild: remove legacy timerfd-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (14 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 14/32] perf kbuild: remove legacy libperl-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 16/32] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
                       ` (16 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove HAVE_TIMERFD_SUPPORT (replaced by CONFIG_TIMERFD)
---
 tools/perf/Kconfig         |  8 +++++++-
 tools/perf/builtin-kvm.c   | 13 +++++++------
 tools/perf/config/Makefile | 10 ++++++----
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 5ca0527..9b75649 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -151,7 +151,7 @@ config BUILTIN_TEST
 
 endmenu
 
-menu "Libraries"
+menu "Libraries / Dependencies"
 
 config LIBSLANG
 	bool "Slang (libslang)"
@@ -190,6 +190,12 @@ config LIBPYTHON
         ---help---
 	  Libpython dependency needed by the perf script feature.
 
+config TIMERFD
+	bool "Timer via file descriptor"
+	default n
+        ---help---
+	  Timer via file descriptor
+
 choice
 	prompt "Elf library"
 	default LIBELF
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0f1e5a2..d035253 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "perf.h"
 
@@ -20,7 +21,7 @@
 #include "util/data.h"
 
 #include <sys/prctl.h>
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
 #endif
 
@@ -339,7 +340,7 @@ static void init_kvm_event_record(struct perf_kvm_stat *kvm)
 		INIT_LIST_HEAD(&kvm->kvm_events_cache[i]);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static void clear_events_cache_stats(struct list_head *kvm_events_cache)
 {
 	struct list_head *head;
@@ -788,7 +789,7 @@ static void print_result(struct perf_kvm_stat *kvm)
 		pr_info("\nLost events: %" PRIu64 "\n\n", kvm->lost_events);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static int process_lost_event(struct perf_tool *tool,
 			      union perf_event *event __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
@@ -879,7 +880,7 @@ static bool verify_vcpu(int vcpu)
 	return true;
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 /* keeping the max events to a modest level to keep
  * the processing of samples per mmap smooth.
  */
@@ -1386,7 +1387,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 	return kvm_events_report_vcpu(kvm);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static struct perf_evlist *kvm_live_event_list(void)
 {
 	struct perf_evlist *evlist;
@@ -1601,7 +1602,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)
 	if (!strncmp(argv[1], "rep", 3))
 		return kvm_events_report(&kvm, argc - 1 , argv + 1);
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 	if (!strncmp(argv[1], "live", 4))
 		return kvm_events_live(&kvm, argc - 1 , argv + 1);
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 93c3321..33843b7 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -445,10 +445,12 @@ ifdef CONFIG_LIBPERL
   endif
 endif
 
-ifeq ($(feature-timerfd), 1)
-  CFLAGS += -DHAVE_TIMERFD_SUPPORT
-else
-  msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+ifdef CONFIG_TIMERFD
+  ifneq ($(feature-timerfd), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_TIMERFD)
+  else
+    msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+  endif
 endif
 
 disable-python = $(eval $(disable-python_code))
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 16/32] perf kbuild: remove legacy demangle-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (15 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 15/32] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 17/32] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
                       ` (15 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_DEMANGLE (replaced by CONFIG_DEMANGLE)
Remove HAVE_LIBBFD_SUPPORT (replaced by CONFIG_LIBBFD)
Remove HAVE_CPLUS_DEMANGLE_SUPPORT (replaced by CONFIG_LIBIBERTY_ONLY)
---
 tools/perf/Kconfig         | 30 +++++++++++++++++++++++-------
 tools/perf/config/Makefile | 45 ++++++++++++++++++++++++---------------------
 tools/perf/util/srcline.c  |  8 +++++---
 tools/perf/util/symbol.h   | 25 +++++++++++++++++--------
 4 files changed, 69 insertions(+), 39 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 9b75649..762c50e 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -196,6 +196,29 @@ config TIMERFD
         ---help---
 	  Timer via file descriptor
 
+config DEMANGLE
+	bool "Demangle symbols"
+	default n
+        ---help---
+	  Enable demangling so as to display human-readable
+	  symbols. This option is convenient with C++ programs.
+
+choice DEMANGLE_DEPS
+       prompt "Demangle dependency(ies)"
+       depends on DEMANGLE
+       default LIBBFD
+
+config LIBBFD
+	bool "BFD + libiberty libraries"
+        ---help---
+	  Binary File Descriptor and libiberty libraries
+
+config LIBIBERTY_ONLY
+	bool "Libiberty only"
+        ---help---
+	  Libiberty
+endchoice
+
 choice
 	prompt "Elf library"
 	default LIBELF
@@ -236,13 +259,6 @@ config NUMA
 	  The library libnuma offers facilities to configure NUMA
 	  policies supported by the linux kernel.
 
-config DEMANGLE
-	bool "Demangle symbols"
-	default n
-        ---help---
-	  Enable demangling so as to display human-readable
-	  symbols. This option is convenient with C++ programs.
-
 config BIONIC
 	bool "Bionic support"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 33843b7..ff7f01c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -534,33 +534,36 @@ ifeq ($(feature-libbfd), 1)
   endif
 endif
 
-ifdef NO_DEMANGLE
-  CFLAGS += -DNO_DEMANGLE
-else
-  ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
-    EXTLIBS += -liberty
-    CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-  else
-    ifneq ($(feature-libbfd), 1)
-      ifneq ($(feature-liberty), 1)
-        ifneq ($(feature-liberty-z), 1)
-          # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
-          # or any of 'bfd iberty z' trinity
-          ifeq ($(feature-cplus-demangle), 1)
-            EXTLIBS += -liberty
-            CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-          else
-            msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
-            CFLAGS += -DNO_DEMANGLE
-          endif
+ifdef CONFIG_LIBBFD
+  ifneq ($(feature-libbfd), 1)
+    # TODO: there might be an issue here: feature-liberty and
+    # feature-liberty-z cannot be set; they can be set only if
+    # feature-libbfd is set
+    ifneq ($(feature-liberty), 1)
+      ifneq ($(feature-liberty-z), 1)
+        # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
+        # or any of 'bfd iberty z' trinity
+        ifeq ($(feature-cplus-demangle), 1)
+          EXTLIBS += -liberty
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBBFD)
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBIBERTY_ONLY)
+        else
+          msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
         endif
       endif
     endif
   endif
 endif
 
-ifneq ($(filter -lbfd,$(EXTLIBS)),)
-  CFLAGS += -DHAVE_LIBBFD_SUPPORT
+ifdef CONFIG_LIBIBERTY_ONLY
+  $(call feature_check,cplus-demangle)
+  ifeq ($(feature-cplus-demangle), 1)
+    EXTLIBS += -liberty
+  else
+    msg := $(warning No libiberty found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
+  endif
 endif
 
 ifndef NO_ON_EXIT
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index f3e4bc5..38df8f4 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -4,11 +4,13 @@
 
 #include <linux/kernel.h>
 
+#include "generated/autoconf.h"
+
 #include "util/dso.h"
 #include "util/util.h"
 #include "util/debug.h"
 
-#ifdef HAVE_LIBBFD_SUPPORT
+#ifdef CONFIG_LIBBFD
 
 /*
  * Implement addr2line using libbfd.
@@ -189,7 +191,7 @@ void dso__free_a2l(struct dso *dso)
 	dso->a2l = NULL;
 }
 
-#else /* HAVE_LIBBFD_SUPPORT */
+#else /* !CONFIG_LIBBFD */
 
 static int addr2line(const char *dso_name, unsigned long addr,
 		     char **file, unsigned int *line_nr,
@@ -242,7 +244,7 @@ void dso__free_a2l(struct dso *dso __maybe_unused)
 {
 }
 
-#endif /* HAVE_LIBBFD_SUPPORT */
+#endif /* CONFIG_LIBBFD */
 
 /*
  * Number of addr2line failures (without success) before disabling it for that
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 501e4e7..d8e886e 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,6 +1,8 @@
 #ifndef __PERF_SYMBOL
 #define __PERF_SYMBOL 1
 
+#include "generated/autoconf.h"
+
 #include <linux/types.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -21,26 +23,33 @@
 
 #include "dso.h"
 
-#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
+#ifdef CONFIG_DEMANGLE
+
+#ifdef CONFIG_LIBBFD
+
+#define PACKAGE 'perf'
+#include <bfd.h>
+
+#elif defined(CONFIG_LIBIBERTY_ONLY)
 extern char *cplus_demangle(const char *, int);
 
 static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
 {
 	return cplus_demangle(c, i);
 }
-#else
-#ifdef NO_DEMANGLE
+
+#else /* Unknown dependency */
+#error "Inconsistent demangling configuration"
+#endif
+
+#else /* !CONFIG_DEMANGLE */
 static inline char *bfd_demangle(void __maybe_unused *v,
 				 const char __maybe_unused *c,
 				 int __maybe_unused i)
 {
 	return NULL;
 }
-#else
-#define PACKAGE 'perf'
-#include <bfd.h>
-#endif
-#endif
+#endif /* CONFIG_DEMANGLE */
 
 /*
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 17/32] perf kbuild: remove legacy on_exit-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (16 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 16/32] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 18/32] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
                       ` (14 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove HAVE_ON_EXIT_SUPPORT (replaced by CONFIG_ON_EXIT)
---
 tools/perf/Kconfig          | 6 ++++++
 tools/perf/builtin-record.c | 4 +++-
 tools/perf/config/Makefile  | 6 +++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 762c50e..a00bfb6 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -196,6 +196,12 @@ config TIMERFD
         ---help---
 	  Timer via file descriptor
 
+config ON_EXIT
+	bool "Support of on_exit() function"
+	default n
+        ---help---
+	  On exit support
+
 config DEMANGLE
 	bool "Demangle symbols"
 	default n
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 8ce62ef..372a812 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -5,6 +5,8 @@
  * (or a CPU, or a PID) into the perf.data output file - for
  * later analysis via perf report.
  */
+
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
@@ -30,7 +32,7 @@
 #include <sched.h>
 #include <sys/mman.h>
 
-#ifndef HAVE_ON_EXIT_SUPPORT
+#ifndef CONFIG_ON_EXIT
 #ifndef ATEXIT_MAX
 #define ATEXIT_MAX 32
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index ff7f01c..c128f30 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -566,9 +566,9 @@ ifdef CONFIG_LIBIBERTY_ONLY
   endif
 endif
 
-ifndef NO_ON_EXIT
-  ifeq ($(feature-on-exit), 1)
-    CFLAGS += -DHAVE_ON_EXIT_SUPPORT
+ifdef CONFIG_ON_EXIT
+  ifneq ($(feature-on-exit), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_ON_EXIT)
   endif
 endif
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 18/32] perf kbuild: remove legacy backtrace-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (17 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 17/32] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 19/32] perf kbuild: remove legacy numa-related " Alexis Berlemont
                       ` (13 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove HAVE_BACKTRACE_SUPPORT (replaced by CONFIG_BACKTRACE)
---
 tools/perf/config/Makefile | 6 +++---
 tools/perf/util/util.c     | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c128f30..4a21452 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -572,9 +572,9 @@ ifdef CONFIG_ON_EXIT
   endif
 endif
 
-ifndef NO_BACKTRACE
-  ifeq ($(feature-backtrace), 1)
-    CFLAGS += -DHAVE_BACKTRACE_SUPPORT
+ifdef CONFIG_BACKTRACE
+  ifneq ($(feature-backtrace), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BACKTRACE)
   endif
 endif
 
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 9f66549..6b5db6d 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,8 +1,9 @@
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include <api/fs/fs.h>
 #include <sys/mman.h>
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 #include <execinfo.h>
 #endif
 #include <stdio.h>
@@ -237,7 +238,7 @@ int hex2u64(const char *ptr, u64 *long_val)
 }
 
 /* Obtain a backtrace and print it to stdout. */
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 void dump_stack(void)
 {
 	void *array[16];
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 19/32] perf kbuild: remove legacy numa-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (18 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 18/32] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 20/32] perf kbuild: remove legacy bionic-related " Alexis Berlemont
                       ` (12 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove HAVE_LIBNUMA_SUPPORT (replaced by CONFIG_LIBNUMA)
---
 tools/perf/Kconfig                    |  4 ++--
 tools/perf/bench/Kbuild               |  2 +-
 tools/perf/builtin-bench.c            |  5 +++--
 tools/perf/config/Makefile            |  8 ++------
 tools/perf/config/Makefile.fix-config | 16 ----------------
 tools/perf/config/Makefile.fix-legacy | 12 ------------
 6 files changed, 8 insertions(+), 39 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index a00bfb6..9bc55fc 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -258,8 +258,8 @@ config LIBUNWIND_DIR
 	  Directory holding the libuwind dependency (headers +
 	  libraries).
 
-config NUMA
-	bool "Numa support (bench)"
+config LIBNUMA
+	bool "Libnuma support"
 	default n
         ---help---
 	  The library libnuma offers facilities to configure NUMA
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
index 8883de9..57f87e8 100644
--- a/tools/perf/bench/Kbuild
+++ b/tools/perf/bench/Kbuild
@@ -3,7 +3,7 @@ obj-y += mem-memset.o
 obj-y += sched-messaging.o
 obj-y += sched-pipe.o
 
-obj-$(CONFIG_NUMA) += numa.o
+obj-$(CONFIG_LIBNUMA) += numa.o
 
 obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
 obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 1e6e777..162b9f5 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -14,6 +14,7 @@
  *  numa  ... NUMA scheduling and MM performance
  *  futex ... Futex performance
  */
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "util/util.h"
 #include "util/parse-options.h"
@@ -33,7 +34,7 @@ struct bench {
 	bench_fn_t	fn;
 };
 
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 static struct bench numa_benchmarks[] = {
 	{ "mem",	"Benchmark for NUMA workloads",			bench_numa		},
 	{ "all",	"Test all NUMA benchmarks",			NULL			},
@@ -72,7 +73,7 @@ struct collection {
 static struct collection collections[] = {
 	{ "sched",	"Scheduler and IPC benchmarks",			sched_benchmarks	},
 	{ "mem",	"Memory access benchmarks",			mem_benchmarks		},
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 	{ "numa",	"NUMA scheduling and MM benchmarks",		numa_benchmarks		},
 #endif
 	{"futex",       "Futex stressing benchmarks",                   futex_benchmarks        },
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 4a21452..770675f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -578,12 +578,11 @@ ifdef CONFIG_BACKTRACE
   endif
 endif
 
-ifndef NO_LIBNUMA
+ifdef CONFIG_LIBNUMA
   ifeq ($(feature-libnuma), 0)
     msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
-    NO_LIBNUMA := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBNUMA)
   else
-    CFLAGS += -DHAVE_LIBNUMA_SUPPORT
     EXTLIBS += -lnuma
   endif
 endif
@@ -756,11 +755,8 @@ all:
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_BACKTRACE)
-	$(call store,NO_LIBNUMA)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 6402a47..46842f9 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -37,22 +37,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
 endif
 endif
 
-# NO_BACKTRACE
-ifdef CONFIG_BACKTRACE
-ifdef NO_BACKTRACE
-dummy := $(info Disabling CONFIG_BACKTRACE)
-dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
-endif
-endif
-
-# NO_LIBNUMA
-ifdef CONFIG_NUMA
-ifdef NO_LIBNUMA
-dummy := $(info Disabling CONFIG_NUMA)
-dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
-endif
-endif
-
 # NO_LIBBIONIC
 ifdef CONFIG_BIONIC
 ifdef NO_LIBBIONIC
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 2e93006..15a328e 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -5,10 +5,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_DEMANGLE
-NO_DEMANGLE := 1
-endif
-
 ifndef CONFIG_LIBELF
 NO_LIBELF := 1
 endif
@@ -17,14 +13,6 @@ ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
 
-ifndef CONFIG_BACKTRACE
-NO_BACKTRACE := 1
-endif
-
-ifndef CONFIG_NUMA
-export NO_LIBNUMA := 1
-endif
-
 ifdef CONFIG_BIONIC
 NO_LIBBIONIC := 1
 endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 20/32] perf kbuild: remove legacy bionic-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (19 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 19/32] perf kbuild: remove legacy numa-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 21/32] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
                       ` (11 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_BIONIC (replaced by CONFIG_BIONIC)
---
 tools/perf/config/Makefile            | 4 +++-
 tools/perf/config/Makefile.fix-config | 8 --------
 tools/perf/config/Makefile.fix-legacy | 4 ----
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 770675f..f0f51cd 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -270,12 +270,14 @@ CFLAGS += -I$(LIB_INCLUDE)
 
 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
-ifndef NO_BIONIC
+ifdef CONFIG_BIONIC
   $(call feature_check,bionic)
   ifeq ($(feature-bionic), 1)
     BIONIC := 1
     EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
     EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
+  else
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BIONIC)
   endif
 endif
 
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 46842f9..5575a55 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -37,12 +37,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
 endif
 endif
 
-# NO_LIBBIONIC
-ifdef CONFIG_BIONIC
-ifdef NO_LIBBIONIC
-dummy := $(info Disabling CONFIG_BIONIC)
-dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 15a328e..00244f5 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -12,7 +12,3 @@ endif
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
-
-ifdef CONFIG_BIONIC
-NO_LIBBIONIC := 1
-endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 21/32] perf kbuild: remove legacy libelf-related build variables (1st part)
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (20 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 20/32] perf kbuild: remove legacy bionic-related " Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 22/32] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
                       ` (10 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_LIBELF (replaced by CONFIG_LIBELF)
---
 tools/perf/Kconfig                    |  8 ++++++++
 tools/perf/config/Makefile            | 23 +++++++----------------
 tools/perf/config/Makefile.fix-config | 18 ------------------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 4 files changed, 15 insertions(+), 38 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 9bc55fc..196d32c 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -203,6 +203,7 @@ config ON_EXIT
 	  On exit support
 
 config DEMANGLE
+       depends on LIBELF
 	bool "Demangle symbols"
 	default n
         ---help---
@@ -245,7 +246,14 @@ choice
 	  Builtin elf support.
 endchoice
 
+config LIBDWARF
+        depends on LIBELF
+	bool "Dwarf (libdwarf)"
+        ---help---
+	  libdwarf
+
 config LIBUNWIND
+        depends on LIBELF
 	bool "User space libunwind callchains"
         ---help---
 	  The library libunwind provides a portable C API to determine
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f0f51cd..f280b80 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -281,12 +281,7 @@ ifdef CONFIG_BIONIC
   endif
 endif
 
-ifdef NO_LIBELF
-  NO_DWARF := 1
-  NO_DEMANGLE := 1
-  NO_LIBUNWIND := 1
-  NO_LIBDW_DWARF_UNWIND := 1
-else
+ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
       LIBC_SUPPORT := 1
@@ -296,16 +291,13 @@ else
     endif
     ifeq ($(LIBC_SUPPORT),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
-
-      NO_LIBELF := 1
-      NO_DWARF := 1
-      NO_DEMANGLE := 1
-      NO_LIBUNWIND := 1
-      NO_LIBDW_DWARF_UNWIND := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
+      $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
     else
       msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
     endif
   else
+    LIBELF = 1
     ifndef NO_LIBDW_DWARF_UNWIND
       ifneq ($(feature-libdw-dwarf-unwind),1)
         NO_LIBDW_DWARF_UNWIND := 1
@@ -317,9 +309,9 @@ else
       NO_DWARF := 1
     endif # Dwarf support
   endif # libelf support
-endif # NO_LIBELF
+endif # CONFIG_LIBELF
 
-ifndef NO_LIBELF
+ifeq ($(LIBELF), 1)
   CFLAGS += -DHAVE_LIBELF_SUPPORT
 
   ifeq ($(feature-libelf-mmap), 1)
@@ -343,7 +335,7 @@ ifndef NO_LIBELF
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
   endif # NO_DWARF
-endif # NO_LIBELF
+endif # LIBELF
 
 ifndef NO_LIBUNWIND
   ifneq ($(feature-libunwind), 1)
@@ -757,7 +749,6 @@ all:
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 5575a55..32a6701 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -11,24 +11,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_DEMANGLE
-ifdef CONFIG_DEMANGLE
-ifdef NO_DEMANGLE
-dummy := $(info Disabling CONFIG_DEMANGLE)
-dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
-endif
-endif
-
-# NO_LIBELF
-ifdef CONFIG_LIBELF
-ifdef NO_LIBELF
-dummy := $(info Disabling CONFIG_LIBELF)
-dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
-dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
-endif
-endif
-
 # NO_LIBUNWIND
 ifdef CONFIG_LIBUNWIND
 ifdef NO_LIBUNWIND
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 00244f5..e3eab7c 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -5,10 +5,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_LIBELF
-NO_LIBELF := 1
-endif
-
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 22/32] perf kbuild: remove legacy libelf-related build variables (2nd part)
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (21 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 21/32] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 23/32] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
                       ` (9 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove HAVE_LIBELF_SUPPORT (replaced by CONFIG_LIBELF)
Remove HAVE_LIBELF_MMAP_SUPPORT (replaced by CONFIG_LIBELF_MMAP)
Remove HAVE_LIBELF_GETPHDRNUM__SUPPORT (replaced by
CONFIG_LIBELF_GETPHDRNUM_)
---
 tools/perf/Kconfig                  | 16 ++++++++++++++++
 tools/perf/builtin-inject.c         |  2 +-
 tools/perf/config/Makefile          | 13 ++++++++-----
 tools/perf/perf.c                   |  2 +-
 tools/perf/util/generate-cmdlist.sh |  4 ++--
 tools/perf/util/map.c               |  3 ++-
 tools/perf/util/symbol-elf.c        |  3 ++-
 tools/perf/util/symbol.h            |  8 ++++----
 8 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 196d32c..434a596 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -246,8 +246,23 @@ choice
 	  Builtin elf support.
 endchoice
 
+config LIBELF_MMAP
+        depends on LIBELF
+	bool "Libelf mmap support"
+	default y
+        ---help---
+	  libdelf mmap
+
+config LIBELF_GETPHDRNUM
+        depends on LIBELF
+	default y
+	bool "Libelf getphdrnum support"
+        ---help---
+	  libdelf mmap
+
 config LIBDWARF
         depends on LIBELF
+	default n
 	bool "Dwarf (libdwarf)"
         ---help---
 	  libdwarf
@@ -255,6 +270,7 @@ config LIBDWARF
 config LIBUNWIND
         depends on LIBELF
 	bool "User space libunwind callchains"
+	default n
         ---help---
 	  The library libunwind provides a portable C API to determine
 	  the call-chain of a program.
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 3a73875..6e7883b 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -229,7 +229,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool,
 				 * account this as unresolved.
 				 */
 			} else {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 				pr_warning("no symbols found in %s, maybe "
 					   "install a debug package?\n",
 					   al.map->dso->long_name);
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f280b80..c102e91 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -312,14 +312,17 @@ ifdef CONFIG_LIBELF
 endif # CONFIG_LIBELF
 
 ifeq ($(LIBELF), 1)
-  CFLAGS += -DHAVE_LIBELF_SUPPORT
 
-  ifeq ($(feature-libelf-mmap), 1)
-    CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-mmap), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
-  ifeq ($(feature-libelf-getphdrnum), 1)
-    CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-getphdrnum), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
   # include ARCH specific config
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 588221c..f9b919f 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -80,7 +80,7 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
 #endif
-#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
+#if defined CONFIG_LIBELF && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_KMEM
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 5d84ffc..a8dbdc2 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -30,7 +30,7 @@ do
      echo "#endif"
 done
 
-echo "#ifdef HAVE_LIBELF_SUPPORT"
+echo "#ifdef CONFIG_LIBELF"
 sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
@@ -45,5 +45,5 @@ do
      }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
-echo "#endif /* HAVE_LIBELF_SUPPORT */"
+echo "#endif /* CONFIG_LIBELF */"
 echo "};"
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 39cd2d0..82261f5 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include <errno.h>
 #include <inttypes.h>
@@ -174,7 +175,7 @@ int map__load(struct map *map, symbol_filter_t filter)
 		pr_warning(", continuing without symbols\n");
 		return -1;
 	} else if (nr == 0) {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 		const size_t len = strlen(name);
 		const size_t real_len = len - sizeof(DSO__DELETED);
 
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 6864661..1256595 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -5,12 +5,13 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include "vdso.h"
 #include <symbol/kallsyms.h>
 #include "debug.h"
 
-#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
+#ifndef CONFIG_LIBELF_GETPHDRNUM
 static int elf_getphdrnum(Elf *elf, size_t *dst)
 {
 	GElf_Ehdr gehdr;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index d8e886e..933cfd1 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -15,7 +15,7 @@
 #include <libgen.h>
 #include "build-id.h"
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 #include <libelf.h>
 #include <gelf.h>
 #endif
@@ -55,13 +55,13 @@ static inline char *bfd_demangle(void __maybe_unused *v,
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
  * for newer versions we can use mmap to reduce memory usage:
  */
-#ifdef HAVE_LIBELF_MMAP_SUPPORT
+#ifdef CONFIG_LIBELF_MMAP
 # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
 #else
 # define PERF_ELF_C_READ_MMAP ELF_C_READ
 #endif
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
 				GElf_Shdr *shp, const char *name, size_t *idx);
 #endif
@@ -205,7 +205,7 @@ struct symsrc {
 	int fd;
 	enum dso_binary_type type;
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 	Elf *elf;
 	GElf_Ehdr ehdr;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 23/32] perf kbuild: remove legacy libdwarf-related build variables
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (22 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 22/32] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 24/32] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
                       ` (8 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_DWARF (replaced by CONFIG_LIBDWARF)
Remove HAVE_DWARF_SUPPORT (replaced by CONFIG_LIBDWARF)
---
 tools/perf/Kconfig                    |  46 ++++++++--
 tools/perf/arch/arm/Makefile          |   4 +-
 tools/perf/arch/powerpc/Makefile      |   2 +-
 tools/perf/arch/s390/Makefile         |   2 +-
 tools/perf/arch/sh/Makefile           |   2 +-
 tools/perf/arch/sparc/Makefile        |   2 +-
 tools/perf/arch/x86/Kbuild            |   1 +
 tools/perf/arch/x86/Makefile          |   8 +-
 tools/perf/arch/x86/tests/Kbuild      |   2 +
 tools/perf/arch/x86/util/Kbuild       |   3 +-
 tools/perf/builtin-probe.c            |  15 +--
 tools/perf/builtin-record.c           |  10 +-
 tools/perf/config/Makefile            | 166 +++++++++++++++++++---------------
 tools/perf/config/Makefile.fix-config |   8 --
 tools/perf/config/Makefile.fix-legacy |   4 -
 tools/perf/tests/builtin-test.c       |   3 +-
 tools/perf/tests/tests.h              |   4 +-
 tools/perf/util/Kbuild                |   3 +-
 tools/perf/util/include/dwarf-regs.h  |   4 +-
 tools/perf/util/probe-event.c         |   6 +-
 tools/perf/util/probe-finder.h        |   5 +-
 tools/perf/util/unwind-libunwind.c    |   5 +-
 tools/perf/util/unwind.h              |   7 +-
 23 files changed, 181 insertions(+), 131 deletions(-)
 create mode 100644 tools/perf/arch/x86/tests/Kbuild

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 434a596..15840b0 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -234,7 +234,6 @@ choice
 	  these tasks, perf can rely on either the libelf library or a
 	  minimal builtin support.
 
-
 	config LIBELF
 	bool "elf"
 	---help---
@@ -265,15 +264,50 @@ config LIBDWARF
 	default n
 	bool "Dwarf (libdwarf)"
         ---help---
-	  libdwarf
+	  A library for parsing DWARF debug information.
 
-config LIBUNWIND
+config LIBDWARF_DIR
+	string "libdwarf directory"
+	depends on LIBDWARF
+        ---help---
+	  Directory holding the libdwarf dependency (headers +
+	  libraries)
+
+config UNWIND
         depends on LIBELF
-	bool "User space libunwind callchains"
+	bool "User space unwind callchains"
 	default n
         ---help---
-	  The library libunwind provides a portable C API to determine
-	  the call-chain of a program.
+	  Enable call-chain unwinding of user-space application.
+
+choice UNWIND_DEPS
+       prompt "Unwind dependency"
+       depends on UNWIND
+       default LIBUNWIND
+
+config LIBUNWIND
+        depends on LIBELF
+	bool "Libunwind"
+        ---help---
+	  Rely on libunwind post unwind support to determine the
+	  call-chain of a user-space program. The library libunwind
+	  supports all the architectures.
+
+config LIBDWARF_UNWIND
+        depends on LIBDWARF
+	bool "Libdwarf unwind"
+        ---help---
+	  Rely on lidw DWARF post unwind support to determine the
+	  call-chain of a user-space program.
+
+endchoice
+
+config LIBUNWIND_DEBUG_FRAME
+        depends on LIBUNWIND
+	bool "libunwind debug frame"
+	default y
+        ---help---
+	  libunwind debug frame
 
 config LIBUNWIND_DIR
 	string "libunwind directory"
diff --git a/tools/perf/arch/arm/Makefile b/tools/perf/arch/arm/Makefile
index 67e9b3d..04852ea 100644
--- a/tools/perf/arch/arm/Makefile
+++ b/tools/perf/arch/arm/Makefile
@@ -1,7 +1,7 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index 744e629..3c57a2e 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sh/Makefile b/tools/perf/arch/sh/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sh/Makefile
+++ b/tools/perf/arch/sh/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sparc/Makefile b/tools/perf/arch/sparc/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sparc/Makefile
+++ b/tools/perf/arch/sparc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
index 52fd6fa..3b9a068 100644
--- a/tools/perf/arch/x86/Kbuild
+++ b/tools/perf/arch/x86/Kbuild
@@ -1 +1,2 @@
 obj-y += util/
+obj-y += tests/
\ No newline at end of file
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 1641542..d37e641 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,14 +1,12 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
-ifndef NO_LIBDW_DWARF_UNWIND
+ifeq ($(LIBDWARF_UNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o
-endif
-ifndef NO_DWARF_UNWIND
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o
 endif
diff --git a/tools/perf/arch/x86/tests/Kbuild b/tools/perf/arch/x86/tests/Kbuild
new file mode 100644
index 0000000..4717953
--- /dev/null
+++ b/tools/perf/arch/x86/tests/Kbuild
@@ -0,0 +1,2 @@
+obj-$(CONFIG_UNWIND) += regs_load.o
+obj-$(CONFIG_UNWIND) += dwarf-unwind.o
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
index e033b94..0eed9c0 100644
--- a/tools/perf/arch/x86/util/Kbuild
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -1,4 +1,5 @@
 obj-y += dwarf-regs.o
 obj-y += header.o
 obj-y += tsc.o
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index cdcd4eb..71b8ecc 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "builtin.h"
 #include "util/util.h"
@@ -180,7 +181,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	if  (str && !params.target) {
 		if (!strcmp(opt->long_name, "exec"))
 			params.uprobes = true;
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		else if (!strcmp(opt->long_name, "module"))
 			params.uprobes = false;
 #endif
@@ -206,7 +207,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	return ret;
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 static int opt_show_lines(const struct option *opt __maybe_unused,
 			  const char *str, int unset __maybe_unused)
 {
@@ -296,7 +297,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
 		"perf probe [<options>] --del '[GROUP:]EVENT' ...",
 		"perf probe --list",
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"perf probe [<options>] --line 'LINEDESC'",
 		"perf probe [<options>] --vars 'PROBEPOINT'",
 #endif
@@ -310,7 +311,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
 		opt_del_probe_event),
 	OPT_CALLBACK('a', "add", NULL,
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT"
 		" [[NAME=]ARG ...]",
 #else
@@ -322,7 +323,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"\t\tFUNC:\tFunction name\n"
 		"\t\tOFF:\tOffset from function entry (in byte)\n"
 		"\t\t%return:\tPut the probe at function return\n"
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"\t\tSRC:\tSource code path\n"
 		"\t\tRL:\tRelative line number from function entry.\n"
 		"\t\tAL:\tAbsolute line number in file.\n"
@@ -335,7 +336,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		opt_add_probe_event),
 	OPT_BOOLEAN('f', "force", &params.force_add, "forcibly add events"
 		    " with existing name"),
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	OPT_CALLBACK('L', "line", NULL,
 		     "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]",
 		     "Show source code lines.", opt_show_lines),
@@ -450,7 +451,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		return ret;
 	}
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	if (params.show_lines) {
 		if (params.mod_events) {
 			pr_err("  Error: Don't use --line with"
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 372a812..decaf8a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -651,7 +651,7 @@ error:
 	return ret;
 }
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 static int get_stack_size(char *str, unsigned long *_size)
 {
 	char *endptr;
@@ -677,7 +677,7 @@ static int get_stack_size(char *str, unsigned long *_size)
 	       max_size, str);
 	return -1;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_UNWIND */
 
 int record_parse_callchain(const char *arg, struct record_opts *opts)
 {
@@ -706,7 +706,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				       "needed for -g fp\n");
 			break;
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 		/* Dwarf style */
 		} else if (!strncmp(name, "dwarf", sizeof("dwarf"))) {
 			const unsigned long default_stack_dump_size = 8192;
@@ -722,7 +722,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				ret = get_stack_size(tok, &size);
 				opts->stack_dump_size = size;
 			}
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_UNWIND */
 		} else {
 			pr_err("callchain: Unknown --call-graph option "
 			       "value: %s\n", arg);
@@ -825,7 +825,7 @@ static struct record record = {
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
 #else
 const char record_callchain_help[] = CALLCHAIN_HELP "fp";
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c102e91..36ba89f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -35,23 +35,16 @@ ifeq ($(ARCH),arm)
   LIBUNWIND_LIBS = -lunwind -lunwind-arm
 endif
 
-# So far there's only x86 libdw unwind support merged in perf.
-# Disable it on all other architectures in case libdw unwind
-# support is detected in system. Add supported architectures
-# to the check.
-ifneq ($(ARCH),x86)
-  NO_LIBDW_DWARF_UNWIND := 1
-endif
-
 ifeq ($(LIBUNWIND_LIBS),)
-  NO_LIBUNWIND := 1
+  $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
+  LIBUNWIND = 1
   #
   # For linking with debug library, run like:
   #
   #   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
   #
-  ifdef LIBUNWIND_DIR
+  ifdef CONFIG_LIBUNWIND_DIR
     LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
     LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
   endif
@@ -68,12 +61,10 @@ ifeq ($(NO_PERF_REGS),0)
   CFLAGS += -DHAVE_PERF_REGS_SUPPORT
 endif
 
-ifndef NO_LIBELF
-  # for linking with debug library, run like:
-  # make DEBUG=1 LIBDW_DIR=/opt/libdw/
-  ifdef LIBDW_DIR
-    LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
-    LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
+ifdef CONFIG_LIBELF
+  ifdef CONFIG_LIBDWARF_DIR
+    LIBDW_CFLAGS  := -I$(CONFIG_LIBDWARF_DIR)/include
+    LIBDW_LDFLAGS := -L$(CONFIG_LIBDWARF_DIR)/lib
   endif
   FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
@@ -298,16 +289,30 @@ ifdef CONFIG_LIBELF
     endif
   else
     LIBELF = 1
-    ifndef NO_LIBDW_DWARF_UNWIND
-      ifneq ($(feature-libdw-dwarf-unwind),1)
-        NO_LIBDW_DWARF_UNWIND := 1
-        msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
-      endif
-    endif
-    ifneq ($(feature-dwarf), 1)
-      msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
-      NO_DWARF := 1
-    endif # Dwarf support
+    ifdef CONFIG_LIBDWARF
+      ifneq ($(feature-dwarf), 1)
+        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
+      else
+        LIBDWARF = 1
+      endif # Dwarf support
+      ifdef CONFIG_LIBDWARF_UNWIND
+        # So far there's only x86 libdw unwind support merged in
+        # perf. Disable it on all other architectures in case libdw
+        # unwind support is detected in system. Add supported
+        # architectures to the check.
+        ifeq ($(ARCH),x86)
+          ifneq ($(feature-libdw-dwarf-unwind),1)
+            msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
+            $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+          else
+            LIBDWARF_UNWIND = 1
+          endif # Dwarf unwind support
+        else
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+        endif # Arch x86
+      endif # CONFIG_LIBDWARF_UNWIND
+    endif  # CONFIG_LIBDWARF
   endif # libelf support
 endif # CONFIG_LIBELF
 
@@ -328,66 +333,80 @@ ifeq ($(LIBELF), 1)
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifndef NO_DWARF
+  ifeq ($(LIBDWARF), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
-      NO_DWARF := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
     else
-      CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
+      CFLAGS += $(LIBDW_CFLAGS)
       LDFLAGS += $(LIBDW_LDFLAGS)
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
-  endif # NO_DWARF
+  endif # LIBDWARF
 endif # LIBELF
 
-ifndef NO_LIBUNWIND
-  ifneq ($(feature-libunwind), 1)
-    msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
-    NO_LIBUNWIND := 1
+ifdef CONFIG_UNWIND
+  # CONFIG_LIBUNWIND is the default choice; so, if it is not
+  # available, let's try another one
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifneq ($(feature-libunwind), 1)
+        LIBUNWIND = 0
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
+        ifeq ($(LIBDWARF_UNWIND), 1)
+          msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
+        else
+          msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+        endif # LIBDWARF_UNWIND
+      else # feature-libunwind OK
+        EXTLIBS += $(LIBUNWIND_LIBS)
+        CFLAGS += $(LIBUNWIND_CFLAGS)
+        LDFLAGS += $(LIBUNWIND_LDFLAGS)
+      endif # feature-libunwind
+    endif # LIBUNWIND
+  endif # CONFIG_LIBUNWIND
+
+  # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
+  # choice); so, we disable CONFIG_UNWIND if it is not available
+  ifdef CONFIG_LIBDWARF_UNWIND
+    ifneq ($(LIBDWARF_UNWIND), 1)
+      msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+    endif
+  endif # CONFIG_LIBDWARF_UNWIND
+
+  # if libunwind is OK, let's check the option DEBUG_FRAME
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifeq ($(ARCH),arm)
+        $(call feature_check,libunwind-debug-frame)
+        ifneq ($(feature-libunwind-debug-frame), 1)
+          msg := $(warning No debug_frame support found in libunwind);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+        endif
+      else
+        # non-ARM has no dwarf_find_debug_frame() function:
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+      endif
+    endif
   endif
-endif
 
-dwarf-post-unwind := 1
-dwarf-post-unwind-text := BUG
+dwarf-post-unwind = 0
+dwarf-post-unwind-text = BUG
 
-# setup DWARF post unwinder
-ifdef NO_LIBUNWIND
-  ifdef NO_LIBDW_DWARF_UNWIND
-    msg := $(warning Disabling post unwind, no support found.);
-    dwarf-post-unwind := 0
-  else
-    dwarf-post-unwind-text := libdw
-  endif
-else
+ifeq ($(LIBUNWIND), 1)
+  dwarf-post-unwind := 1
   dwarf-post-unwind-text := libunwind
-  # Enable libunwind support by default.
-  ifndef NO_LIBDW_DWARF_UNWIND
-    NO_LIBDW_DWARF_UNWIND := 1
-  endif
-endif
-
-ifeq ($(dwarf-post-unwind),1)
-  CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
 else
-  NO_DWARF_UNWIND := 1
-endif
-
-ifndef NO_LIBUNWIND
-  ifeq ($(ARCH),arm)
-    $(call feature_check,libunwind-debug-frame)
-    ifneq ($(feature-libunwind-debug-frame), 1)
-      msg := $(warning No debug_frame support found in libunwind);
-      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
-    endif
-  else
-    # non-ARM has no dwarf_find_debug_frame() function:
-    CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
+  ifeq ($(LIBDWARF_UNWIND), 1)
+    dwarf-post-unwind := 1
+    dwarf-post-unwind-text := libdw
   endif
-  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
-  EXTLIBS += $(LIBUNWIND_LIBS)
-  CFLAGS  += $(LIBUNWIND_CFLAGS)
-  LDFLAGS += $(LIBUNWIND_LDFLAGS)
-endif
+endif # LIBUNWIND
+
+endif # CONFIG_UNWIND
 
 ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
@@ -750,10 +769,7 @@ all:
 	$(call store,PYTHON_EMBED_CCOPTS)
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
-	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 32a6701..273f793 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -11,12 +11,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_LIBUNWIND
-ifdef CONFIG_LIBUNWIND
-ifdef NO_LIBUNWIND
-dummy := $(info Disabling CONFIG_LIBUNWIND)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index e3eab7c..275b6d9 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -4,7 +4,3 @@ include $(KCONFIG_CONFIG)
 ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
-
-ifndef CONFIG_LIBUNWIND
-NO_LIBUNWIND := 1
-endif
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index b11bf8a..5cc30d2 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -3,6 +3,7 @@
  *
  * Builtin regression testing command: ever growing number of sanity tests
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "intlist.h"
 #include "tests.h"
@@ -116,7 +117,7 @@ static struct test {
 		.func = test__parse_no_sample_id_all,
 	},
 #if defined(__x86_64__) || defined(__i386__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 	{
 		.desc = "Test dwarf unwind",
 		.func = test__dwarf_unwind,
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index a24795c..b939917 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -1,6 +1,8 @@
 #ifndef TESTS_H
 #define TESTS_H
 
+#include "generated/autoconf.h"
+
 #define TEST_ASSERT_VAL(text, cond)					 \
 do {									 \
 	if (!(cond)) {							 \
@@ -43,7 +45,7 @@ int test__parse_no_sample_id_all(void);
 int test__dwarf_unwind(void);
 
 #if defined(__x86_64__) || defined(__i386__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 struct thread;
 struct perf_sample;
 int test__arch_unwind_sample(struct perf_sample *sample,
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 4d0b6da..8fac37e 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -49,7 +49,8 @@ obj-y += strlist.o
 obj-y += svghelper.o
 obj-y += symbol.o
 
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
 
 obj-$(CONFIG_LIBELF) += symbol-elf.o
 obj-$(CONFIG_LIBELF) += dwarf-aux.o
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h
index 8f14965..93cd69c 100644
--- a/tools/perf/util/include/dwarf-regs.h
+++ b/tools/perf/util/include/dwarf-regs.h
@@ -1,7 +1,9 @@
 #ifndef _PERF_DWARF_REGS_H_
 #define _PERF_DWARF_REGS_H_
 
-#ifdef HAVE_DWARF_SUPPORT
+#include "generated/autoconf.h"
+
+#ifdef CONFIG_LIBDWARF
 const char *get_arch_regstr(unsigned int n);
 #endif
 
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 0d1542f..765307b 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -32,6 +32,7 @@
 #include <limits.h>
 #include <elf.h>
 
+#include "generated/autoconf.h"
 #include "util.h"
 #include "event.h"
 #include "strlist.h"
@@ -255,8 +256,7 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
 		clear_probe_trace_event(tevs + i);
 }
 
-#ifdef HAVE_DWARF_SUPPORT
-
+#ifdef CONFIG_LIBDWARF
 /* Open new debuginfo of given module */
 static struct debuginfo *open_debuginfo(const char *module)
 {
@@ -786,7 +786,7 @@ out:
 	return ret;
 }
 
-#else	/* !HAVE_DWARF_SUPPORT */
+#else	/* !CONFIG_LIBDWARF */
 
 static int
 find_perf_probe_point_from_dwarf(struct probe_trace_point *tp __maybe_unused,
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 92590b2..13cb054 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -2,6 +2,7 @@
 #define _PROBE_FINDER_H
 
 #include <stdbool.h>
+#include "generated/autoconf.h"
 #include "util.h"
 #include "intlist.h"
 #include "probe-event.h"
@@ -16,7 +17,7 @@ static inline int is_c_varname(const char *name)
 	return isalpha(name[0]) || name[0] == '_';
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 
 #include "dwarf-aux.h"
 
@@ -107,6 +108,6 @@ struct line_finder {
 	int			found;
 };
 
-#endif /* HAVE_DWARF_SUPPORT */
+#endif /* CONFIG_LIBDWARF */
 
 #endif /*_PROBE_FINDER_H */
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index bd5768d..0cc7cdc 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
+#include "generated/autoconf.h"
 #include "thread.h"
 #include "session.h"
 #include "perf_regs.h"
@@ -260,7 +261,7 @@ static int read_unwind_spec_eh_frame(struct dso *dso, struct machine *machine,
 	return ret;
 }
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 static int read_unwind_spec_debug_frame(struct dso *dso,
 					struct machine *machine, u64 *offset)
 {
@@ -319,7 +320,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
 						 need_unwind_info, arg);
 	}
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 	/* Check the .debug_frame section for unwinding info */
 	if (!read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
 		memset(&di, 0, sizeof(di));
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index b031316..0d82d29 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -1,6 +1,7 @@
 #ifndef __UNWIND_H
 #define __UNWIND_H
 
+#include "generated/autoconf.h"
 #include "types.h"
 #include "event.h"
 #include "symbol.h"
@@ -13,13 +14,13 @@ struct unwind_entry {
 
 typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 			struct machine *machine,
 			struct thread *thread,
 			struct perf_sample *data, int max_stack);
 /* libunwind specific */
-#ifdef HAVE_LIBUNWIND_SUPPORT
+#ifdef CONFIG_LIBUNWIND
 int libunwind__arch_reg_id(int regnum);
 #endif
 #else
@@ -33,5 +34,5 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG__UNWIND */
 #endif /* __UNWIND_H */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 24/32] perf kbuild: remove legacy libpython-related build variable
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (23 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 23/32] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 25/32] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
                       ` (7 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Remove NO_LIBPYTHON (replaced by CONFIG_LIBPYTHON)
---
 tools/perf/builtin-script.c             |  2 +-
 tools/perf/config/Makefile              | 43 +++++++++++----------------------
 tools/perf/config/Makefile.fix-config   |  8 ------
 tools/perf/config/Makefile.fix-legacy   |  4 ---
 tools/perf/util/trace-event-scripting.c |  3 ++-
 5 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ff67f0d..3e59b24 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1368,7 +1368,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 		if (strstr(lang_path, "perl"))
 			continue;
 #endif
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 		if (strstr(lang_path, "python"))
 			continue;
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 36ba89f..1dd3469 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -469,27 +469,24 @@ ifdef CONFIG_TIMERFD
   endif
 endif
 
-disable-python = $(eval $(disable-python_code))
-define disable-python_code
-  CFLAGS += -DNO_LIBPYTHON
-  $(if $(1),$(warning No $(1) was found))
-  $(warning Python support will not be built)
-  NO_LIBPYTHON := 1
-endef
-
-override PYTHON := \
-  $(call get-executable-or-default,PYTHON,python)
+ifdef CONFIG_LIBPYTHON
 
-ifndef PYTHON
-  $(call disable-python,python interpreter)
-else
+  disable-python = $(eval $(disable-python_code))
+  define disable-python_code
+    $(if $(1),$(warning No $(1) was found))
+    $(warning Python support will not be built)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPYTHON)
+  endef
 
-  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+  override PYTHON := \
+    $(call get-executable-or-default,PYTHON,python)
 
-  ifdef NO_LIBPYTHON
-    $(call disable-python)
+  ifndef PYTHON
+    $(call disable-python,python interpreter)
   else
 
+    PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
     override PYTHON_CONFIG := \
       $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
 
@@ -510,18 +507,7 @@ else
       else
 
         ifneq ($(feature-libpython-version), 1)
-          $(warning Python 3 is not yet supported; please set)
-          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
-          $(warning If you also have Python 2 installed, then)
-          $(warning try something like:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make PYTHON=python2)
-          $(warning $(and ,))
-          $(warning Otherwise, disable Python support entirely:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make NO_LIBPYTHON=1)
-          $(warning $(and ,))
-          $(error   $(and ,))
+          $(call disable-python,python2 interpreter)
         else
           LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
           EXTLIBS += $(PYTHON_EMBED_LIBADD)
@@ -769,7 +755,6 @@ all:
 	$(call store,PYTHON_EMBED_CCOPTS)
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
-	$(call store,NO_LIBPYTHON)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 273f793..3f0e33e 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,12 +3,4 @@ include $(KCONFIG_CONFIG)
 
 CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
-# NO_LIBPYTHON
-ifdef CONFIG_LIBPYTHON
-ifdef NO_LIBPYTHON
-dummy := $(info Disabling CONFIG_LIBPYTHON)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 275b6d9..431c9bf 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,6 +1,2 @@
 
 include $(KCONFIG_CONFIG)
-
-ifndef CONFIG_LIBPYTHON
-NO_LIBPYTHON := 1
-endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 51d8019..4a70ef7 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <errno.h>
 
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
@@ -93,7 +94,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 void setup_python_scripting(void)
 {
 	register_python_scripting(&python_scripting_unsupported_ops);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 25/32] perf kbuild: add generated Kconfig build-test cases
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (24 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 24/32] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 26/32] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
                       ` (6 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

Thanks to the python module kconfiglib, we were able to generate build
configurations. The set is, of course, not exhaustive but for each
option, all the possible states are tested.

This commit contains also a few changes so that all tests pass...
---
 tools/perf/Kconfig                                 | 117 +++++++++++----------
 tools/perf/Makefile                                |   2 +-
 tools/perf/Makefile.kbuild                         |   2 +-
 tools/perf/builtin-annotate.c                      |   8 +-
 tools/perf/builtin-kvm.c                           |  19 ++--
 tools/perf/builtin-mem.c                           |   1 +
 tools/perf/builtin-report.c                        |   3 +
 tools/perf/builtin-top.c                           |  19 +++-
 tools/perf/tests/configs/MINIMAL_config            |  56 ++++++++++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  67 ++++++++++++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  67 ++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  67 ++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  67 ++++++++++++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  67 ++++++++++++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  65 ++++++++++++
 tools/perf/tests/configs/NO_GTK2_config            |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  66 ++++++++++++
 tools/perf/tests/configs/NO_LIBNUMA_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBPERL_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  66 ++++++++++++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  67 ++++++++++++
 tools/perf/tests/configs/NO_LIBUNWIND_config       |  65 ++++++++++++
 tools/perf/tests/configs/NO_STDIO_config           |  67 ++++++++++++
 tools/perf/tests/configs/NO_TIMERFD_config         |  67 ++++++++++++
 tools/perf/tests/configs/NO_TUI_config             |  67 ++++++++++++
 tools/perf/tests/configs/REF_config                |  67 ++++++++++++
 tools/perf/tests/make                              |  65 +++---------
 tools/perf/ui/setup.c                              |   6 +-
 tools/perf/util/Kbuild                             |   9 +-
 53 files changed, 2926 insertions(+), 120 deletions(-)
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/REF_config

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 15840b0..6201750 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -24,40 +24,41 @@ config BUILTIN_STAT
 
 config BUILTIN_TOP
 	bool "top"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  Generate and display a performance counter profile in
 	  real-time.
 
 config BUILTIN_TRACE
 	bool "trace"
-	default n
-	depends on LIBAUDIT
+	default y
+	depends on BUILTIN_RECORD && LIBAUDIT
         ---help---
 	  Strace inspired tool.
 
 config BUILTIN_ANNOTATE
 	bool "annotate"
-	default n
+	default y
         ---help---
 	  Read a perf archive (created by perf record) and display
 	  annotated code.
 
 config BUILTIN_BENCH
 	bool "bench"
-	default n
+	default y
         ---help---
 	  General framework for benchmark suites.
 
 config BUILTIN_BUILDID_CACHE
 	bool "buildid-cache"
-	default n
+	default y
         ---help---
 	  Manage build-id cache.
 
 config BUILTIN_BUILDID_LIST
 	bool "buildid-list"
-	default n
+	default y
         ---help---
 	  List the buildids in a perf archive file.
 
@@ -70,7 +71,7 @@ config BUILTIN_DIFF
 
 config BUILTIN_EVLIST
 	bool "evlist"
-	default n
+	default y
         ---help---
 	  List the event names in a perf archive file
 
@@ -82,64 +83,73 @@ config BUILTIN_HELP
 
 config BUILTIN_INJECT
 	bool "inject"
-	default n
+	default y
         ---help---
 	  The inject feature reads a perf-record event stream and
 	  repipes it to stdout.
 
 config BUILTIN_KMEM
 	bool "kmem"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  Tool to trace/measure kernel memory(slab) properties.
 
 config BUILTIN_KVM
 	bool "kvm"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT && \
+		BUILTIN_RECORD && BUILTIN_BUILDID_LIST && \
+		BUILTIN_TOP && BUILTIN_DIFF && BUILTIN_STAT
         ---help---
 	  Tool to trace/measure kvm guest os
 
 config BUILTIN_LIST
 	bool "list"
-	default n
+	default y
         ---help---
 	  List all symbolic event types.
 
 config BUILTIN_LOCK
 	bool "lock"
-	default n
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  Analyze lock events.
 
 config BUILTIN_PROBE
 	bool "probe"
-	default n
+	default y
 	depends on LIBELF
         ---help---
 	  Define new dynamic tracepoints
 
 config BUILTIN_SCHED
 	bool "sched"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  Tool to trace/measure scheduler properties (latencies).
 
 config BUILTIN_SCRIPT
 	bool "script"
 	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  Read perf archive file (created by perf record) and display
 	  trace output.
 
 config BUILTIN_TIMECHART
 	bool "timechart"
-	default n
+	default y
+	depends on BUILTIN_RECORD
         ---help---
 	  Tool to visualize total system behavior during a workload.
 
 config BUILTIN_MEM
 	bool "mem"
 	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
         ---help---
 	  Profile memory accesses.
 
@@ -151,61 +161,86 @@ config BUILTIN_TEST
 
 endmenu
 
+menu "GUI"
+
+config STDIO
+	bool "Terminal"
+	default y
+        ---help---
+	  Most basic display mode.
+
+config TUI
+	bool "Tui (slang based)"
+	depends on LIBSLANG
+	default y
+        ---help---
+	  Text-based user interface which provides windowing
+	  facilities.
+
+config GTK2
+	bool "Gtk2"
+	default y
+	depends on LIBGTK2
+        ---help---
+	  Elaborate display mode based on libgtk2.
+
+endmenu
+
 menu "Libraries / Dependencies"
 
 config LIBSLANG
 	bool "Slang (libslang)"
-	default n
+	default y
         ---help---
 	  libslang
 
 config LIBAUDIT
 	bool "Audit (libaudit)"
-	default n
+	default y
         ---help---
 	  Linux audit framework dependency.
 
 config LIBGTK2
 	bool "Gtk2 (libgtk2)"
-	default n
+	default y
         ---help---
 	  libgtk2
 
 config LIBGTK2_INFOBAR
 	bool "Gtk2 infobar (libgtk2)"
 	depends on LIBGTK2
-	default n
+	default y
         ---help---
 	  libgtk2-infobar
 
 config LIBPERL
 	bool "Perl"
-	default n
+	default y
         ---help---
 	  Libperl dependency needed by the perf script feature.
 
 config LIBPYTHON
 	bool "Python"
-	default n
+	default y
         ---help---
 	  Libpython dependency needed by the perf script feature.
 
 config TIMERFD
 	bool "Timer via file descriptor"
-	default n
+	default y
         ---help---
 	  Timer via file descriptor
 
 config ON_EXIT
 	bool "Support of on_exit() function"
-	default n
+	default y
         ---help---
 	  On exit support
 
 config DEMANGLE
        depends on LIBELF
 	bool "Demangle symbols"
-	default n
+	default y
         ---help---
 	  Enable demangling so as to display human-readable
 	  symbols. This option is convenient with C++ programs.
@@ -261,7 +296,7 @@ config LIBELF_GETPHDRNUM
 
 config LIBDWARF
         depends on LIBELF
-	default n
+	default y
 	bool "Dwarf (libdwarf)"
         ---help---
 	  A library for parsing DWARF debug information.
@@ -276,7 +311,7 @@ config LIBDWARF_DIR
 config UNWIND
         depends on LIBELF
 	bool "User space unwind callchains"
-	default n
+	default y
         ---help---
 	  Enable call-chain unwinding of user-space application.
 
@@ -318,7 +353,7 @@ config LIBUNWIND_DIR
 
 config LIBNUMA
 	bool "Libnuma support"
-	default n
+	default y
         ---help---
 	  The library libnuma offers facilities to configure NUMA
 	  policies supported by the linux kernel.
@@ -333,30 +368,6 @@ config BIONIC
 
 endmenu
 
-menu "GUI"
-
-config STDIO
-	bool "Terminal"
-	default y
-        ---help---
-	  Most basic display mode.
-
-config TUI
-	bool "Tui (slang based)"
-	depends on LIBSLANG
-	default n
-        ---help---
-	  Text-based user interface which provides windowing
-	  facilities.
-
-config GTK2
-	bool "Gtk2"
-	default n
-        ---help---
-	  Elaborate display mode based on libgtk2.
-
-endmenu
-
 menu "Build"
 config DEBUG
 	bool "Compile with debug info"
@@ -372,7 +383,7 @@ config DEBUG_PARSER
 
 config BACKTRACE
 	bool "Compile with dump_stack support"
-	default n
+	default y
         ---help---
 	  Compile with dump_stack support.
 
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index cb2e586..4512f16 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -55,7 +55,7 @@ define print_msg
 endef
 
 define make
-  @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
+  @$(MAKE) -f Makefile.kbuild --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
 endef
 
 #
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index e56eb47..7b1488c 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -43,7 +43,7 @@ export QUIET_BISON QUIET_FLEX
 
 ifeq ($(KBUILD_SRC),)
 
-ifeq ("$(origin O)", "command line")
+ifneq ($(O),)
 KBUILD_OUTPUT := $(O)
 else
 KBUILD_OUTPUT := $(objtree)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0da603b..56b50d2 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -114,7 +115,7 @@ static void hists__find_annotations(struct hists *hists,
 				    struct perf_evsel *evsel,
 				    struct perf_annotate *ann)
 {
-	struct rb_node *nd = rb_first(&hists->entries), *next;
+	struct rb_node *nd = rb_first(&hists->entries);
 	int key = K_RIGHT;
 
 	while (nd) {
@@ -153,7 +154,9 @@ find_next:
 
 			/* skip missing symbols */
 			nd = rb_next(nd);
+#ifdef CONFIG_TUI
 		} else if (use_browser == 1) {
+			struct rb_node *next = NULL;
 			key = hist_entry__tui_annotate(he, evsel, NULL);
 			switch (key) {
 			case -1:
@@ -172,6 +175,7 @@ find_next:
 
 			if (next != NULL)
 				nd = next;
+#endif /* CONFIG_TUI */
 		} else {
 			hist_entry__tty_annotate(he, evsel, ann);
 			nd = rb_next(nd);
@@ -314,7 +318,9 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
+#ifdef CONFIG_TUI
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
+#endif /* CONFIG_TUI */
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index d035253..56811c8 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1719,20 +1719,25 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	if (!strncmp(argv[0], "rec", 3))
 		return __cmd_record(file_name, argc, argv);
-	else if (!strncmp(argv[0], "rep", 3))
+
+	if (!strncmp(argv[0], "rep", 3))
 		return __cmd_report(file_name, argc, argv);
-	else if (!strncmp(argv[0], "diff", 4))
+
+	if (!strncmp(argv[0], "diff", 4))
 		return cmd_diff(argc, argv, NULL);
-	else if (!strncmp(argv[0], "top", 3))
+
+	if (!strncmp(argv[0], "top", 3))
 		return cmd_top(argc, argv, NULL);
-	else if (!strncmp(argv[0], "buildid-list", 12))
+
+	if (!strncmp(argv[0], "buildid-list", 12))
 		return __cmd_buildid_list(file_name, argc, argv);
+
 #if defined(__i386__) || defined(__x86_64__)
-	else if (!strncmp(argv[0], "stat", 4))
+	if (!strncmp(argv[0], "stat", 4))
 		return kvm_cmd_stat(file_name, argc, argv);
 #endif
-	else
-		usage_with_options(kvm_usage, kvm_options);
+
+	usage_with_options(kvm_usage, kvm_options);
 
 	return 0;
 }
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 2e3ade69..3007e272 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "perf.h"
 
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c8f2113..e2c433f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -448,6 +449,7 @@ static int report__browse_hists(struct report *rep)
 	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
 
 	switch (use_browser) {
+#ifdef CONFIG_TUI
 	case 1:
 		ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
 						    rep->min_percent,
@@ -459,6 +461,7 @@ static int report__browse_hists(struct report *rep)
 		if (ret != K_SWITCH_INPUT_DATA)
 			ret = 0;
 		break;
+#endif /* CONFIG_TUI */
 	case 2:
 		ret = report__gtk_browse_hists(rep, help);
 		break;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 65aaa5b..a84d362 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -17,6 +17,7 @@
  *
  * Released under the GPL v2. (and only v2, not any later version)
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
@@ -544,6 +545,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 	return ret;
 }
 
+#ifdef CONFIG_TUI
 static void perf_top__sort_new_samples(void *arg)
 {
 	struct perf_top *t = arg;
@@ -586,6 +588,7 @@ static void *display_thread_tui(void *arg)
 	done = 1;
 	return NULL;
 }
+#endif /* CONFIG_TUI */
 
 static void *display_thread(void *arg)
 {
@@ -898,9 +901,12 @@ static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
 	return 0;
 }
 
+typedef void* (*display_fn_t)(void *);
+
 static int __cmd_top(struct perf_top *top)
 {
 	struct record_opts *opts = &top->record_opts;
+	display_fn_t display_fn = display_thread;
 	pthread_t thread;
 	int ret;
 
@@ -937,8 +943,8 @@ static int __cmd_top(struct perf_top *top)
 	 * XXX 'top' still doesn't start workloads like record, trace, but should,
 	 * so leave the check here.
 	 */
-        if (!target__none(&opts->target))
-                perf_evlist__enable(top->evlist);
+	if (!target__none(&opts->target))
+		perf_evlist__enable(top->evlist);
 
 	/* Wait for a minimal set of events before starting the snapshot */
 	poll(top->evlist->pollfd, top->evlist->nr_fds, 100);
@@ -946,8 +952,13 @@ static int __cmd_top(struct perf_top *top)
 	perf_top__mmap_read(top);
 
 	ret = -1;
-	if (pthread_create(&thread, NULL, (use_browser > 0 ? display_thread_tui :
-							    display_thread), top)) {
+
+#ifdef CONFIG_TUI
+	if (use_browser > 0)
+		display_fn = display_thread_tui;
+#endif
+
+	if (pthread_create(&thread, NULL, display_fn, top)) {
 		ui__error("Could not create display thread.\n");
 		goto out_delete;
 	}
diff --git a/tools/perf/tests/configs/MINIMAL_config b/tools/perf/tests/configs/MINIMAL_config
new file mode 100644
index 0000000..722282a
--- /dev/null
+++ b/tools/perf/tests/configs/MINIMAL_config
@@ -0,0 +1,56 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# The perf configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBGTK2 is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+# CONFIG_LIBELF is not set
+CONFIG_LIBELF_MINIMAL=y
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BACKTRACE_config b/tools/perf/tests/configs/NO_BACKTRACE_config
new file mode 100644
index 0000000..f44b4f9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BACKTRACE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+# CONFIG_BACKTRACE is not set
diff --git a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
new file mode 100644
index 0000000..5fdce32
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+# CONFIG_BUILTIN_ANNOTATE is not set
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
new file mode 100644
index 0000000..99d601e
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+# CONFIG_BUILTIN_BENCH is not set
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
new file mode 100644
index 0000000..edcee97
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
new file mode 100644
index 0000000..3043178
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
new file mode 100644
index 0000000..f553f96
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+# CONFIG_BUILTIN_DIFF is not set
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
new file mode 100644
index 0000000..8198a9d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_HELP_config b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
new file mode 100644
index 0000000..d897913
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+# CONFIG_BUILTIN_HELP is not set
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
new file mode 100644
index 0000000..3322780
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
new file mode 100644
index 0000000..0cb7cba
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+# CONFIG_BUILTIN_KMEM is not set
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KVM_config b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
new file mode 100644
index 0000000..d7849bc
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+# CONFIG_BUILTIN_KVM is not set
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
new file mode 100644
index 0000000..3eed298d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+# CONFIG_BUILTIN_LIST is not set
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
new file mode 100644
index 0000000..6347efd
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+# CONFIG_BUILTIN_LOCK is not set
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_MEM_config b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
new file mode 100644
index 0000000..d432c6a
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+# CONFIG_BUILTIN_MEM is not set
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
new file mode 100644
index 0000000..6dd2f14
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+# CONFIG_BUILTIN_PROBE is not set
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
new file mode 100644
index 0000000..e5bca7c
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+# CONFIG_BUILTIN_RECORD is not set
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
new file mode 100644
index 0000000..1d27667
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+# CONFIG_BUILTIN_REPORT is not set
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
new file mode 100644
index 0000000..7944d9b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
new file mode 100644
index 0000000..52d4121
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+# CONFIG_BUILTIN_SCRIPT is not set
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_STAT_config b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
new file mode 100644
index 0000000..2486420
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+# CONFIG_BUILTIN_STAT is not set
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TEST_config b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
new file mode 100644
index 0000000..1c52914
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
new file mode 100644
index 0000000..143a60d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TOP_config b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
new file mode 100644
index 0000000..188bcf2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
new file mode 100644
index 0000000..114d210
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+# CONFIG_BUILTIN_TRACE is not set
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_DEMANGLE_config b/tools/perf/tests/configs/NO_DEMANGLE_config
new file mode 100644
index 0000000..2aaaf20
--- /dev/null
+++ b/tools/perf/tests/configs/NO_DEMANGLE_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+# CONFIG_DEMANGLE is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_GTK2_config b/tools/perf/tests/configs/NO_GTK2_config
new file mode 100644
index 0000000..e1989c2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_GTK2_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+# CONFIG_GTK2 is not set
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBAUDIT_config b/tools/perf/tests/configs/NO_LIBAUDIT_config
new file mode 100644
index 0000000..b8fa6a2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBAUDIT_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+# CONFIG_LIBAUDIT is not set
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBDWARF_config b/tools/perf/tests/configs/NO_LIBDWARF_config
new file mode 100644
index 0000000..a5e33a1
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBDWARF_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+# CONFIG_LIBDWARF is not set
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBELF_MMAP_config b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
new file mode 100644
index 0000000..d8755ea
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+# CONFIG_LIBELF_MMAP is not set
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
new file mode 100644
index 0000000..81cd6a2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+# CONFIG_LIBGTK2_INFOBAR is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_config b/tools/perf/tests/configs/NO_LIBGTK2_config
new file mode 100644
index 0000000..a52e89d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+# CONFIG_LIBGTK2 is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBNUMA_config b/tools/perf/tests/configs/NO_LIBNUMA_config
new file mode 100644
index 0000000..9b3c1f8
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBNUMA_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPERL_config b/tools/perf/tests/configs/NO_LIBPERL_config
new file mode 100644
index 0000000..4c6d6be
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPERL_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+# CONFIG_LIBPERL is not set
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPYTHON_config b/tools/perf/tests/configs/NO_LIBPYTHON_config
new file mode 100644
index 0000000..6624bbf
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPYTHON_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+# CONFIG_LIBPYTHON is not set
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBSLANG_config b/tools/perf/tests/configs/NO_LIBSLANG_config
new file mode 100644
index 0000000..5bc0f98
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBSLANG_config
@@ -0,0 +1,66 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
new file mode 100644
index 0000000..ca571d3
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBUNWIND_DEBUG_FRAME is not set
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_config b/tools/perf/tests/configs/NO_LIBUNWIND_config
new file mode 100644
index 0000000..6cc2c7c
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+# CONFIG_LIBUNWIND is not set
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_STDIO_config b/tools/perf/tests/configs/NO_STDIO_config
new file mode 100644
index 0000000..2f92b2d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_STDIO_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+# CONFIG_STDIO is not set
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TIMERFD_config b/tools/perf/tests/configs/NO_TIMERFD_config
new file mode 100644
index 0000000..4b54af8
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TIMERFD_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TUI_config b/tools/perf/tests/configs/NO_TUI_config
new file mode 100644
index 0000000..b95b982
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TUI_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/REF_config b/tools/perf/tests/configs/REF_config
new file mode 100644
index 0000000..bbaab9f
--- /dev/null
+++ b/tools/perf/tests/configs/REF_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 2f92d6e..2aa2ed7 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -11,34 +11,16 @@ else
 lib = lib
 endif
 
+list = $(shell ls $1 2>/dev/null)
 has = $(shell which $1 2>/dev/null)
 
 # standard single make variable specified
 make_clean_all      := clean all
 make_python_perf_so := python/perf.so
-make_debug          := DEBUG=1
-make_no_libperl     := NO_LIBPERL=1
-make_no_libpython   := NO_LIBPYTHON=1
-make_no_scripts     := NO_LIBPYTHON=1 NO_LIBPERL=1
-make_no_newt        := NO_NEWT=1
-make_no_slang       := NO_SLANG=1
-make_no_gtk2        := NO_GTK2=1
-make_no_ui          := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
-make_no_demangle    := NO_DEMANGLE=1
-make_no_libelf      := NO_LIBELF=1
-make_no_libunwind   := NO_LIBUNWIND=1
-make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1
-make_no_backtrace   := NO_BACKTRACE=1
-make_no_libnuma     := NO_LIBNUMA=1
-make_no_libaudit    := NO_LIBAUDIT=1
-make_no_libbionic   := NO_LIBBIONIC=1
 make_tags           := tags
 make_cscope         := cscope
 make_help           := help
 make_doc            := doc
-make_perf_o           := perf.o
-make_util_map_o       := util/map.o
-make_util_pmu_bison_o := util/pmu-bison.o
 make_install        := install
 make_install_bin    := install-bin
 make_install_doc    := install-doc
@@ -48,37 +30,11 @@ make_install_info   := install-info
 make_install_pdf    := install-pdf
 make_static         := LDFLAGS=-static
 
-# all the NO_* variable combined
-make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
-make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
-make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
-make_minimal        += NO_LIBDW_DWARF_UNWIND=1
-
 # $(run) contains all available tests
 run := make_pure
 run += make_clean_all
-run += make_python_perf_so
-run += make_debug
-run += make_no_libperl
-run += make_no_libpython
-run += make_no_scripts
-run += make_no_newt
-run += make_no_slang
-run += make_no_gtk2
-run += make_no_ui
-run += make_no_demangle
-run += make_no_libelf
-run += make_no_libunwind
-run += make_no_libdw_dwarf_unwind
-run += make_no_backtrace
-run += make_no_libnuma
-run += make_no_libaudit
-run += make_no_libbionic
 run += make_help
 run += make_doc
-run += make_perf_o
-run += make_util_map_o
-run += make_util_pmu_bison_o
 run += make_install
 run += make_install_bin
 # FIXME 'install-*' commented out till they're fixed
@@ -87,7 +43,6 @@ run += make_install_bin
 # run += make_install_html
 # run += make_install_info
 # run += make_install_pdf
-run += make_minimal
 run += make_static
 
 ifneq ($(call has,ctags),)
@@ -104,6 +59,10 @@ run_O := $(addsuffix _O,$(run))
 # disable some tests for O=...
 run_O := $(filter-out make_python_perf_so_O,$(run_O))
 
+# $(run_CONFIGS) is a set of automatically-generated Kconfig
+# configurations
+run_CONFIGS := $(call list,$(PERF)/tests/configs/)
+
 # define test for each compile as 'test_NAME' variable
 # with the test itself as a value
 test_make_tags   = test -f tags
@@ -221,13 +180,23 @@ $(run_O):
 	rm -rf $$TMP_O \
 	rm -rf $$TMP_DEST
 
+$(run_CONFIGS):
+	$(call clean)
+	@TMP_DEST=$$(mktemp -d); \
+	cmd="cd $(PERF) && cp tests/configs/$@ .config && make -f $(MK) JOBS=1 DESTDIR=$$TMP_DEST $($@)"; \
+	echo "- $@: $$cmd" && echo $$cmd > $@ && \
+	( eval $$cmd ) >> $@ 2>&1; \
+	echo "  test: $(call test,$@)" >> $@ 2>&1; \
+	$(call test,$@) && \
+	rm -f $@ \
+	rm -rf $$TMP_DEST
+
 tarpkg:
 	@cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1
-	
 
-all: $(run) $(run_O) tarpkg
+all: $(run) $(run_O) $(run_CONFIGS) tarpkg
 	@echo OK
 
 out: $(run_O)
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 8bb51d2..b108c88 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -79,11 +79,13 @@ void setup_browser(bool fallback_to_pager)
 		       PERF_GTK_DSO);
 		sleep(1);
 		/* fall through */
+#ifdef CONFIG_TUI
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
 		/* fall through */
+#endif
 	default:
 		use_browser = 0;
 		if (fallback_to_pager)
@@ -100,11 +102,11 @@ void exit_browser(bool wait_for_ok __maybe_unused)
 	case 2:
 		exit_gtk_browser(wait_for_ok);
 		break;
-
+#ifdef CONFIG_TUI
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-
+#endif
 	default:
 		break;
 	}
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 8fac37e..234937f 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -53,9 +53,10 @@ obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
 obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
 
 obj-$(CONFIG_LIBELF) += symbol-elf.o
-obj-$(CONFIG_LIBELF) += dwarf-aux.o
 obj-$(CONFIG_LIBELF) += probe-event.o
-obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBDWARF) += dwarf-aux.o
+obj-$(CONFIG_LIBDWARF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
@@ -76,7 +77,7 @@ obj-y += trace-event-parse.o
 obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
 obj-y += trace-event-read.o
 
-obj-y += scripting-engines/
+obj-$(CONFIG_BUILTIN_SCRIPT) += scripting-engines/
 
 define bison
 $(Q)echo '  BI      $@'
@@ -101,6 +102,8 @@ $(obj)/parse-events-flex.c: $(src)/parse-events.l $(obj)/parse-events-bison.c
 $(src)/parse-events-flex.o: $(src)/parse-events-flex.c
 $(src)/parse-events-bison.o: $(src)/parse-events-bison.c
 
+$(src)/parse-events.o: $(src)/parse-events-flex.o
+
 $(src)/pmu-bison.c: $(src)/pmu.y
 	$(call bison,perf_pmu_)
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 26/32] perf kbuild: fix installation of traceevent plugins
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (25 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 25/32] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 27/32] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
                       ` (5 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Makefile.kbuild | 10 +++++++---
 tools/perf/config/Makefile |  1 +
 tools/perf/tests/make      |  3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 7b1488c..7b7641c 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -92,7 +92,7 @@ export src-perf obj-perf
 
 OUTPUT := $(obj-perf)/
 
-export OUTPUT
+export OUTPUT DESTDIR
 
 AS      = as
 LD      = ld
@@ -211,6 +211,7 @@ export PARSER_DEBUG_BISON
 export PARSER_DEBUG_FLEX
 export ETC_PERFCONFIG_SQ
 export libdir_SQ
+export plugindir_SQ
 export PYTHON_EMBED_CCOPTS
 export PERL_EMBED_CCOPTS
 export GTK_CFLAGS
@@ -273,6 +274,9 @@ $(LIBTRACEEVENT)-clean: FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/traceevent
 	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
 
+$(LIBTRACEEVENT)-install: $(LIBTRACEEVENT) FORCE
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent plugin_dir=$(plugindir_SQ) install
+
 $(LIBAPIKFS): FORCE
 	@mkdir -p $(obj-kernel)/tools/lib/api
 	$(Q)$(MAKE) -C $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api
@@ -332,13 +336,13 @@ install-bin: all
 	$(INSTALL) $(src-perf)/scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
 	$(INSTALL) $(src-perf)/scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
-	$(INSTALL) $(src-perf)/bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+	$(INSTALL) $(src-perf)/perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
 	$(INSTALL) $(src-perf)/tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
 	$(INSTALL) $(src-perf)/tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
 
-install: install-bin try-install-man
+install: install-bin try-install-man $(LIBTRACEEVENT)-install
 
 DOC_TARGETS := doc man html info pdf
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 1dd3469..9983254 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -759,6 +759,7 @@ all:
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
 	$(call store,libdir_SQ)
+	$(call store,plugindir_SQ)
 	$(call store,perfexec_instdir_SQ)
 	$(call store,sysconfdir_SQ)
 	$(call store,GTK_CFLAGS)
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 2aa2ed7..3db09e7 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -15,6 +15,7 @@ list = $(shell ls $1 2>/dev/null)
 has = $(shell which $1 2>/dev/null)
 
 # standard single make variable specified
+make_pure           :=
 make_clean_all      := clean all
 make_python_perf_so := python/perf.so
 make_tags           := tags
@@ -142,7 +143,7 @@ test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
 test_default = test -x $(PERF)/perf
 test = $(if $(test_$1),$(test_$1),$(test_default))
 
-test_default_O = test -x $$TMP_O/perf
+test_default_O = test -x $$TMP_O/tools/perf/perf
 test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
 
 all:
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 27/32] perf kbuild: fix tarpkg target in tests/make
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (26 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 26/32] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 28/32] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
                       ` (4 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/MANIFEST | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index c0c87c8..dcb06e8 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -1,3 +1,4 @@
+scripts
 tools/perf
 tools/scripts
 tools/lib/traceevent
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 28/32] perf kbuild: update Kbuild files with new and removed sources
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (27 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 27/32] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 29/32] perf kbuild: update build test configurations Alexis Berlemont
                       ` (3 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/bench/Kbuild | 3 +++
 tools/perf/util/Kbuild  | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
index 57f87e8..863646a 100644
--- a/tools/perf/bench/Kbuild
+++ b/tools/perf/bench/Kbuild
@@ -2,6 +2,9 @@ obj-y += mem-memcpy.o
 obj-y += mem-memset.o
 obj-y += sched-messaging.o
 obj-y += sched-pipe.o
+obj-y += futex-hash.o
+obj-y += futex-requeue.o
+obj-y += futex-wake.o
 
 obj-$(CONFIG_LIBNUMA) += numa.o
 
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 234937f..6e02080 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -48,6 +48,8 @@ obj-y += string.o
 obj-y += strlist.o
 obj-y += svghelper.o
 obj-y += symbol.o
+obj-y += perf_regs.o
+
 
 obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
 obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
@@ -60,7 +62,6 @@ obj-$(CONFIG_LIBDWARF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
-obj-y += fs.o
 obj-y += target.o
 obj-y += thread.o
 obj-y += thread_map.o
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 29/32] perf kbuild: update build test configurations
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (28 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 28/32] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 30/32] perf kbuild: relocate the configs generating script Alexis Berlemont
                       ` (2 subsequent siblings)
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Makefile.kbuild                         |  2 +-
 tools/perf/tests/configs/MINIMAL_config            |  4 +++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  2 ++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  2 ++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  2 ++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  | 11 ++------
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  6 ++--
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  2 ++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  2 ++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  3 +-
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  2 ++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  2 ++
 tools/perf/tests/configs/NO_GTK2_config            |  2 ++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  2 ++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  1 +
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  2 ++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  2 ++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  3 +-
 tools/perf/tests/configs/NO_LIBNUMA_config         |  2 ++
 tools/perf/tests/configs/NO_LIBPERL_config         |  2 ++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  2 ++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  2 ++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  2 ++
 tools/perf/tests/configs/NO_STDIO_config           |  2 ++
 tools/perf/tests/configs/NO_TIMERFD_config         |  2 ++
 tools/perf/tests/configs/NO_TUI_config             |  2 ++
 .../{NO_LIBUNWIND_config => NO_UNWIND_config}      |  2 +-
 tools/perf/tests/configs/REF_config                |  2 ++
 tools/perf/tests/configs/generate.py               | 33 ++++++++++++++++++++++
 tools/perf/tests/make                              |  7 +++--
 45 files changed, 123 insertions(+), 22 deletions(-)
 rename tools/perf/tests/configs/{NO_LIBUNWIND_config => NO_UNWIND_config} (97%)
 create mode 100644 tools/perf/tests/configs/generate.py

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 7b7641c..5372cc9 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -259,7 +259,7 @@ $(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/comm
 PHONY += all scripts_basic
 
 $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
-	$(Q)$(MAKE) $(build)=tools/perf
+	$(Q)$(MAKE) LDFLAGS="" $(build)=tools/perf
 
 LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
diff --git a/tools/perf/tests/configs/MINIMAL_config b/tools/perf/tests/configs/MINIMAL_config
index 722282a..6e04dc6 100644
--- a/tools/perf/tests/configs/MINIMAL_config
+++ b/tools/perf/tests/configs/MINIMAL_config
@@ -43,8 +43,12 @@ CONFIG_STDIO=y
 # CONFIG_LIBPYTHON is not set
 # CONFIG_TIMERFD is not set
 CONFIG_ON_EXIT=y
+# CONFIG_LIBBFD is not set
+# CONFIG_LIBIBERTY_ONLY is not set
 # CONFIG_LIBELF is not set
 CONFIG_LIBELF_MINIMAL=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_LIBDWARF_UNWIND is not set
 # CONFIG_LIBNUMA is not set
 # CONFIG_BIONIC is not set
 
diff --git a/tools/perf/tests/configs/NO_BACKTRACE_config b/tools/perf/tests/configs/NO_BACKTRACE_config
index f44b4f9..ea186e2 100644
--- a/tools/perf/tests/configs/NO_BACKTRACE_config
+++ b/tools/perf/tests/configs/NO_BACKTRACE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
index 5fdce32..5f87818 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
index 99d601e..1597197 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
index edcee97..6d3c29f 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
index 3043178..a4d048a 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
index f553f96..c780d43 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
index 8198a9d..95f11fb 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_HELP_config b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
index d897913..76753a9 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_HELP_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
index 3322780..2052081 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
index 0cb7cba..bda50b7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KVM_config b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
index d7849bc..4dee035 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_KVM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
index 3eed298d..e58f913 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_LIST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
index 6347efd..f8f362d 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_MEM_config b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
index d432c6a..d1288e94 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_MEM_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
index 6dd2f14..7d51c98 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
index e5bca7c..8e15038 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
@@ -5,8 +5,6 @@
 # CONFIG_BUILTIN_RECORD is not set
 CONFIG_BUILTIN_REPORT=y
 CONFIG_BUILTIN_STAT=y
-CONFIG_BUILTIN_TOP=y
-CONFIG_BUILTIN_TRACE=y
 CONFIG_BUILTIN_ANNOTATE=y
 CONFIG_BUILTIN_BENCH=y
 CONFIG_BUILTIN_BUILDID_CACHE=y
@@ -15,15 +13,8 @@ CONFIG_BUILTIN_DIFF=y
 CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
-CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
-CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
-CONFIG_BUILTIN_SCHED=y
-CONFIG_BUILTIN_SCRIPT=y
-CONFIG_BUILTIN_TIMECHART=y
-CONFIG_BUILTIN_MEM=y
 CONFIG_BUILTIN_TEST=y
 
 #
@@ -53,7 +44,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
index 1d27667..369e951 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
@@ -5,7 +5,6 @@
 CONFIG_BUILTIN_RECORD=y
 # CONFIG_BUILTIN_REPORT is not set
 CONFIG_BUILTIN_STAT=y
-CONFIG_BUILTIN_TOP=y
 CONFIG_BUILTIN_TRACE=y
 CONFIG_BUILTIN_ANNOTATE=y
 CONFIG_BUILTIN_BENCH=y
@@ -16,14 +15,11 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
-CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
 CONFIG_BUILTIN_SCHED=y
 CONFIG_BUILTIN_SCRIPT=y
 CONFIG_BUILTIN_TIMECHART=y
-CONFIG_BUILTIN_MEM=y
 CONFIG_BUILTIN_TEST=y
 
 #
@@ -53,7 +49,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
index 7944d9b..deda613 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
index 52d4121..fb8cd00 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_STAT_config b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
index 2486420..b0d35f7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_STAT_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TEST_config b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
index 1c52914..7270364 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TEST_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
index 143a60d..41d21f9 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TOP_config b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
index 188bcf2..fa231f7 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TOP_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
@@ -16,7 +16,6 @@ CONFIG_BUILTIN_EVLIST=y
 CONFIG_BUILTIN_HELP=y
 CONFIG_BUILTIN_INJECT=y
 CONFIG_BUILTIN_KMEM=y
-CONFIG_BUILTIN_KVM=y
 CONFIG_BUILTIN_LIST=y
 CONFIG_BUILTIN_LOCK=y
 CONFIG_BUILTIN_PROBE=y
@@ -53,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
index 114d210..8ca377b 100644
--- a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
+++ b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_DEMANGLE_config b/tools/perf/tests/configs/NO_DEMANGLE_config
index 2aaaf20..e2a79e3 100644
--- a/tools/perf/tests/configs/NO_DEMANGLE_config
+++ b/tools/perf/tests/configs/NO_DEMANGLE_config
@@ -51,7 +51,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_GTK2_config b/tools/perf/tests/configs/NO_GTK2_config
index e1989c2..a806529 100644
--- a/tools/perf/tests/configs/NO_GTK2_config
+++ b/tools/perf/tests/configs/NO_GTK2_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBAUDIT_config b/tools/perf/tests/configs/NO_LIBAUDIT_config
index b8fa6a2..57f2b8b 100644
--- a/tools/perf/tests/configs/NO_LIBAUDIT_config
+++ b/tools/perf/tests/configs/NO_LIBAUDIT_config
@@ -52,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBDWARF_config b/tools/perf/tests/configs/NO_LIBDWARF_config
index a5e33a1..fed5c65 100644
--- a/tools/perf/tests/configs/NO_LIBDWARF_config
+++ b/tools/perf/tests/configs/NO_LIBDWARF_config
@@ -52,6 +52,7 @@ CONFIG_LIBELF=y
 CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 # CONFIG_LIBDWARF is not set
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
diff --git a/tools/perf/tests/configs/NO_LIBELF_MMAP_config b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
index d8755ea..b774b34 100644
--- a/tools/perf/tests/configs/NO_LIBELF_MMAP_config
+++ b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
index 81cd6a2..272087c 100644
--- a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
+++ b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_config b/tools/perf/tests/configs/NO_LIBGTK2_config
index a52e89d..d4324ac 100644
--- a/tools/perf/tests/configs/NO_LIBGTK2_config
+++ b/tools/perf/tests/configs/NO_LIBGTK2_config
@@ -31,7 +31,6 @@ CONFIG_BUILTIN_TEST=y
 #
 CONFIG_STDIO=y
 CONFIG_TUI=y
-CONFIG_GTK2=y
 
 #
 # Libraries / Dependencies
@@ -52,7 +51,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBNUMA_config b/tools/perf/tests/configs/NO_LIBNUMA_config
index 9b3c1f8..a3492dc 100644
--- a/tools/perf/tests/configs/NO_LIBNUMA_config
+++ b/tools/perf/tests/configs/NO_LIBNUMA_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 # CONFIG_LIBNUMA is not set
diff --git a/tools/perf/tests/configs/NO_LIBPERL_config b/tools/perf/tests/configs/NO_LIBPERL_config
index 4c6d6be..e430e7e 100644
--- a/tools/perf/tests/configs/NO_LIBPERL_config
+++ b/tools/perf/tests/configs/NO_LIBPERL_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBPYTHON_config b/tools/perf/tests/configs/NO_LIBPYTHON_config
index 6624bbf..9bddfcf 100644
--- a/tools/perf/tests/configs/NO_LIBPYTHON_config
+++ b/tools/perf/tests/configs/NO_LIBPYTHON_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBSLANG_config b/tools/perf/tests/configs/NO_LIBSLANG_config
index 5bc0f98..deebd36 100644
--- a/tools/perf/tests/configs/NO_LIBSLANG_config
+++ b/tools/perf/tests/configs/NO_LIBSLANG_config
@@ -52,7 +52,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
index ca571d3..03bc63b 100644
--- a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 # CONFIG_LIBUNWIND_DEBUG_FRAME is not set
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_STDIO_config b/tools/perf/tests/configs/NO_STDIO_config
index 2f92b2d..48889d9 100644
--- a/tools/perf/tests/configs/NO_STDIO_config
+++ b/tools/perf/tests/configs/NO_STDIO_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_TIMERFD_config b/tools/perf/tests/configs/NO_TIMERFD_config
index 4b54af8..dace6d9 100644
--- a/tools/perf/tests/configs/NO_TIMERFD_config
+++ b/tools/perf/tests/configs/NO_TIMERFD_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_TUI_config b/tools/perf/tests/configs/NO_TUI_config
index b95b982..55cd95b 100644
--- a/tools/perf/tests/configs/NO_TUI_config
+++ b/tools/perf/tests/configs/NO_TUI_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_config b/tools/perf/tests/configs/NO_UNWIND_config
similarity index 97%
rename from tools/perf/tests/configs/NO_LIBUNWIND_config
rename to tools/perf/tests/configs/NO_UNWIND_config
index 6cc2c7c..6a3fbc5 100644
--- a/tools/perf/tests/configs/NO_LIBUNWIND_config
+++ b/tools/perf/tests/configs/NO_UNWIND_config
@@ -53,7 +53,7 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
-# CONFIG_LIBUNWIND is not set
+# CONFIG_UNWIND is not set
 CONFIG_LIBNUMA=y
 # CONFIG_BIONIC is not set
 
diff --git a/tools/perf/tests/configs/REF_config b/tools/perf/tests/configs/REF_config
index bbaab9f..30d1c3d 100644
--- a/tools/perf/tests/configs/REF_config
+++ b/tools/perf/tests/configs/REF_config
@@ -53,7 +53,9 @@ CONFIG_LIBELF_MMAP=y
 CONFIG_LIBELF_GETPHDRNUM=y
 CONFIG_LIBDWARF=y
 CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
 CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
 CONFIG_LIBUNWIND_DEBUG_FRAME=y
 CONFIG_LIBUNWIND_DIR=""
 CONFIG_LIBNUMA=y
diff --git a/tools/perf/tests/configs/generate.py b/tools/perf/tests/configs/generate.py
new file mode 100644
index 0000000..c55a1c9
--- /dev/null
+++ b/tools/perf/tests/configs/generate.py
@@ -0,0 +1,33 @@
+import sys
+import itertools
+import kconfiglib
+
+# Load Kconfig pattern
+ref_config = kconfiglib.Config(sys.argv[1])
+
+# Generate defconfig (by default, all options are set to y)
+ref_config.write_config('REF_config')
+
+# Get all the symbols
+symbols = dict([(s.get_name(), s) for s in ref_config.get_symbols()])
+
+# Remove odd symbols
+symbols.pop('y', None)
+symbols.pop('m', None)
+symbols.pop('n', None)
+
+# Remove choice-related symbols
+choices = ref_config.get_choices()
+items = [c.get_items() for c in choices]
+names = [i.get_name() for i in itertools.chain.from_iterable(items)]
+for name in names:
+    symbols.pop(name, None)
+
+for name in symbols:
+    symbol = symbols[name]
+    if symbol.get_value() != 'y':
+        continue
+    symbol.set_user_value('n')
+    filename = 'NO_' + name + '_config'
+    ref_config.write_config(filename)
+    symbol.set_user_value('y')
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 3db09e7..06533f0 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -44,7 +44,7 @@ run += make_install_bin
 # run += make_install_html
 # run += make_install_info
 # run += make_install_pdf
-run += make_static
+# run += make_static
 
 ifneq ($(call has,ctags),)
 run += make_tags
@@ -197,7 +197,10 @@ tarpkg:
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1
 
-all: $(run) $(run_O) $(run_CONFIGS) tarpkg
+#all: $(run) $(run_O) $(run_CONFIGS) tarpkg
+#	@echo OK
+
+all: $(run_CONFIGS) tarpkg
 	@echo OK
 
 out: $(run_O)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 30/32] perf kbuild: relocate the configs generating script
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (29 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 29/32] perf kbuild: update build test configurations Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 31/32] perf kbuild: minor changes Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 32/32] perf kbuild: remove Makefile.perf Alexis Berlemont
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/tests/{configs/generate.py => generate_configs.py} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename tools/perf/tests/{configs/generate.py => generate_configs.py} (100%)

diff --git a/tools/perf/tests/configs/generate.py b/tools/perf/tests/generate_configs.py
similarity index 100%
rename from tools/perf/tests/configs/generate.py
rename to tools/perf/tests/generate_configs.py
-- 
1.9.3


^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 31/32] perf kbuild: minor changes
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (30 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 30/32] perf kbuild: relocate the configs generating script Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  2014-06-03 22:06     ` [PATCH 32/32] perf kbuild: remove Makefile.perf Alexis Berlemont
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

* Correctly rename internal makefile variables
* Remove makefiles in tools/perf/config which became empty
---
 tools/perf/Makefile.kbuild            |  1 -
 tools/perf/arch/x86/Makefile          |  2 +-
 tools/perf/config/Makefile            | 40 +++++++++++++++++------------------
 tools/perf/config/Makefile.fix-config |  6 ------
 tools/perf/config/Makefile.fix-legacy |  2 --
 5 files changed, 21 insertions(+), 30 deletions(-)
 delete mode 100644 tools/perf/config/Makefile.fix-config
 delete mode 100644 tools/perf/config/Makefile.fix-legacy

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 5372cc9..e5cda88 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -155,7 +155,6 @@ $(CONFIG_DETECTED): $(KCONFIG_CONFIG)
 # no need to include auto.conf.cmd, because .config
 # is the only dependency here
 $(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
-	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
 	$(Q)mkdir -p $(obj-perf)/include/config
 	$(Q)mkdir -p $(obj-perf)/include/generated
 	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index d37e641..f95187e 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,4 +1,4 @@
-ifeq ($(LIBDWARF), 1)
+ifeq ($(config-libdwarf), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 9983254..8957c94 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -38,7 +38,7 @@ endif
 ifeq ($(LIBUNWIND_LIBS),)
   $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
-  LIBUNWIND = 1
+  config-libunwind = 1
   #
   # For linking with debug library, run like:
   #
@@ -71,7 +71,7 @@ ifdef CONFIG_LIBELF
 endif
 
 ifdef KCONFIG_CONFIG
-include $(src-perf)/config/Makefile.fix-legacy
+include $(KCONFIG_CONFIG)
 endif
 
 # include ARCH specific config
@@ -275,12 +275,12 @@ endif
 ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
     ifeq ($(BIONIC),1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
-    ifeq ($(LIBC_SUPPORT),1)
+    ifeq ($(config-libc),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
       $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
@@ -288,13 +288,13 @@ ifdef CONFIG_LIBELF
       msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
     endif
   else
-    LIBELF = 1
+    config-libelf = 1
     ifdef CONFIG_LIBDWARF
       ifneq ($(feature-dwarf), 1)
         msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
       else
-        LIBDWARF = 1
+        config-libdwarf = 1
       endif # Dwarf support
       ifdef CONFIG_LIBDWARF_UNWIND
         # So far there's only x86 libdw unwind support merged in
@@ -306,7 +306,7 @@ ifdef CONFIG_LIBELF
             msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
             $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
           else
-            LIBDWARF_UNWIND = 1
+            config-libdwarf-unwind = 1
           endif # Dwarf unwind support
         else
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
@@ -316,7 +316,7 @@ ifdef CONFIG_LIBELF
   endif # libelf support
 endif # CONFIG_LIBELF
 
-ifeq ($(LIBELF), 1)
+ifeq ($(config-libelf), 1)
 
   ifdef CONFIG_LIBELF_MMAP
     ifneq ($(feature-libelf-mmap), 1)
@@ -324,16 +324,16 @@ ifeq ($(LIBELF), 1)
     endif
   endif
 
-  ifdef CONFIG_LIBELF_MMAP
+  ifdef CONFIG_LIBELF_GETPHDRNUM
     ifneq ($(feature-libelf-getphdrnum), 1)
-      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_GETPHDRNUM)
     endif
   endif
 
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifeq ($(LIBDWARF), 1)
+  ifeq ($(config-libdwarf), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
@@ -349,17 +349,17 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBUNWIND is the default choice; so, if it is not
   # available, let's try another one
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifneq ($(feature-libunwind), 1)
-        LIBUNWIND = 0
+        config-libunwind = 0
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
-        ifeq ($(LIBDWARF_UNWIND), 1)
+        ifeq ($(config-libdwarf-unwind), 1)
           msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
         else
           msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
-        endif # LIBDWARF_UNWIND
+        endif # config-libdwarf-unwind
       else # feature-libunwind OK
         EXTLIBS += $(LIBUNWIND_LIBS)
         CFLAGS += $(LIBUNWIND_CFLAGS)
@@ -371,7 +371,7 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
   # choice); so, we disable CONFIG_UNWIND if it is not available
   ifdef CONFIG_LIBDWARF_UNWIND
-    ifneq ($(LIBDWARF_UNWIND), 1)
+    ifneq ($(config-libdwarf-unwind), 1)
       msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
     endif
@@ -379,7 +379,7 @@ ifdef CONFIG_UNWIND
 
   # if libunwind is OK, let's check the option DEBUG_FRAME
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifeq ($(ARCH),arm)
         $(call feature_check,libunwind-debug-frame)
         ifneq ($(feature-libunwind-debug-frame), 1)
@@ -396,11 +396,11 @@ ifdef CONFIG_UNWIND
 dwarf-post-unwind = 0
 dwarf-post-unwind-text = BUG
 
-ifeq ($(LIBUNWIND), 1)
+ifeq ($(config-libunwind), 1)
   dwarf-post-unwind := 1
   dwarf-post-unwind-text := libunwind
 else
-  ifeq ($(LIBDWARF_UNWIND), 1)
+  ifeq ($(config-libdwarf-unwind), 1)
     dwarf-post-unwind := 1
     dwarf-post-unwind-text := libdw
   endif
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
deleted file mode 100644
index 3f0e33e..0000000
--- a/tools/perf/config/Makefile.fix-config
+++ /dev/null
@@ -1,6 +0,0 @@
-include $(CONFIG_DETECTED)
-include $(KCONFIG_CONFIG)
-
-CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
-
-all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
deleted file mode 100644
index 431c9bf..0000000
--- a/tools/perf/config/Makefile.fix-legacy
+++ /dev/null
@@ -1,2 +0,0 @@
-
-include $(KCONFIG_CONFIG)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 32/32] perf kbuild: remove Makefile.perf
  2014-05-17 15:39   ` Alexis Berlemont
                       ` (31 preceding siblings ...)
  2014-06-03 22:06     ` [PATCH 31/32] perf kbuild: minor changes Alexis Berlemont
@ 2014-06-03 22:06     ` Alexis Berlemont
  32 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-03 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek

---
 tools/perf/Makefile.perf | 930 -----------------------------------------------
 1 file changed, 930 deletions(-)
 delete mode 100644 tools/perf/Makefile.perf

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
deleted file mode 100644
index 5c666b87..0000000
--- a/tools/perf/Makefile.perf
+++ /dev/null
@@ -1,930 +0,0 @@
-include ../scripts/Makefile.include
-
-# The default target of this Makefile is...
-all:
-
-include config/utilities.mak
-
-# Define V to have a more verbose compile.
-#
-# Define VF to have a more verbose feature check output.
-#
-# Define O to save output files in a separate directory.
-#
-# Define ARCH as name of target architecture if you want cross-builds.
-#
-# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
-#
-# Define NO_LIBPERL to disable perl script extension.
-#
-# Define NO_LIBPYTHON to disable python script extension.
-#
-# Define PYTHON to point to the python binary if the default
-# `python' is not correct; for example: PYTHON=python2
-#
-# Define PYTHON_CONFIG to point to the python-config binary if
-# the default `$(PYTHON)-config' is not correct.
-#
-# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
-#
-# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
-#
-# Define LDFLAGS=-static to build a static binary.
-#
-# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
-#
-# Define NO_DWARF if you do not want debug-info analysis feature at all.
-#
-# Define WERROR=0 to disable treating any warnings as errors.
-#
-# Define NO_NEWT if you do not want TUI support. (deprecated)
-#
-# Define NO_SLANG if you do not want TUI support.
-#
-# Define NO_GTK2 if you do not want GTK+ GUI support.
-#
-# Define NO_DEMANGLE if you do not want C++ symbol demangling.
-#
-# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
-#
-# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
-# backtrace post unwind.
-#
-# Define NO_BACKTRACE if you do not want stack backtrace debug feature
-#
-# Define NO_LIBNUMA if you do not want numa perf benchmark
-#
-# Define NO_LIBAUDIT if you do not want libaudit support
-#
-# Define NO_LIBBIONIC if you do not want bionic support
-#
-# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
-# for dwarf backtrace post unwind.
-
-ifeq ($(srctree),)
-srctree := $(patsubst %/,%,$(dir $(shell pwd)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
-#$(info Determined 'srctree' to be $(srctree))
-endif
-
-ifneq ($(objtree),)
-#$(info Determined 'objtree' to be $(objtree))
-endif
-
-ifneq ($(OUTPUT),)
-#$(info Determined 'OUTPUT' to be $(OUTPUT))
-endif
-
-$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
-	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
-	@touch $(OUTPUT)PERF-VERSION-FILE
-
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-PKG_CONFIG = $(CROSS_COMPILE)pkg-config
-
-RM      = rm -f
-LN      = ln -f
-MKDIR   = mkdir
-FIND    = find
-INSTALL = install
-FLEX    = flex
-BISON   = bison
-STRIP   = strip
-
-LIB_DIR          = $(srctree)/tools/lib/api/
-TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
-
-# include config/Makefile by default and rule out
-# non-config cases
-config := 1
-
-NON_CONFIG_TARGETS := clean TAGS tags cscope help
-
-ifdef MAKECMDGOALS
-ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
-  config := 0
-endif
-endif
-
-ifeq ($(config),1)
-include config/Makefile
-endif
-
-export prefix bindir sharedir sysconfdir DESTDIR
-
-# sparse is architecture-neutral, which means that we need to tell it
-# explicitly what architecture to check for. Fix this up for yours..
-SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
-
-# Guard against environment variables
-BUILTIN_OBJS =
-LIB_H =
-LIB_OBJS =
-GTK_OBJS =
-PYRF_OBJS =
-SCRIPT_SH =
-
-SCRIPT_SH += perf-archive.sh
-
-grep-libs = $(filter -l%,$(1))
-strip-libs = $(filter-out -l%,$(1))
-
-ifneq ($(OUTPUT),)
-  TE_PATH=$(OUTPUT)
-ifneq ($(subdir),)
-  LIB_PATH=$(OUTPUT)/../lib/api/
-else
-  LIB_PATH=$(OUTPUT)
-endif
-else
-  TE_PATH=$(TRACE_EVENT_DIR)
-  LIB_PATH=$(LIB_DIR)
-endif
-
-LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
-export LIBTRACEEVENT
-
-LIBAPIKFS = $(LIB_PATH)libapikfs.a
-export LIBAPIKFS
-
-# python extension build directories
-PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
-PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
-PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
-export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
-
-python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
-
-PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
-PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPIKFS)
-
-$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
-	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
-	  --quiet build_ext; \
-	mkdir -p $(OUTPUT)python && \
-	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
-#
-# No Perl scripts right now:
-#
-
-SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
-
-#
-# Single 'perf' binary right now:
-#
-PROGRAMS += $(OUTPUT)perf
-
-# what 'all' will build and 'install' will install, in perfexecdir
-ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
-
-# what 'all' will build but not install in perfexecdir
-OTHER_PROGRAMS = $(OUTPUT)perf
-
-# Set paths to tools early so that they can be used for version tests.
-ifndef SHELL_PATH
-  SHELL_PATH = /bin/sh
-endif
-ifndef PERL_PATH
-  PERL_PATH = /usr/bin/perl
-endif
-
-export PERL_PATH
-
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
-
-$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
-	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
-
-$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
-
-$(OUTPUT)util/pmu-bison.c: util/pmu.y
-	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
-
-$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
-$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
-
-LIB_FILE=$(OUTPUT)libperf.a
-
-LIB_H += ../lib/symbol/kallsyms.h
-LIB_H += ../../include/uapi/linux/perf_event.h
-LIB_H += ../../include/linux/rbtree.h
-LIB_H += ../../include/linux/list.h
-LIB_H += ../../include/uapi/linux/const.h
-LIB_H += ../include/linux/hash.h
-LIB_H += ../../include/linux/stringify.h
-LIB_H += util/include/linux/bitmap.h
-LIB_H += util/include/linux/bitops.h
-LIB_H += ../include/linux/compiler.h
-LIB_H += util/include/linux/const.h
-LIB_H += util/include/linux/ctype.h
-LIB_H += util/include/linux/kernel.h
-LIB_H += util/include/linux/list.h
-LIB_H += util/include/linux/export.h
-LIB_H += util/include/linux/poison.h
-LIB_H += util/include/linux/rbtree.h
-LIB_H += util/include/linux/rbtree_augmented.h
-LIB_H += util/include/linux/string.h
-LIB_H += util/include/linux/types.h
-LIB_H += util/include/linux/linkage.h
-LIB_H += util/include/asm/asm-offsets.h
-LIB_H += ../include/asm/bug.h
-LIB_H += util/include/asm/byteorder.h
-LIB_H += util/include/asm/hweight.h
-LIB_H += util/include/asm/swab.h
-LIB_H += util/include/asm/system.h
-LIB_H += util/include/asm/uaccess.h
-LIB_H += util/include/dwarf-regs.h
-LIB_H += util/include/asm/dwarf2.h
-LIB_H += util/include/asm/cpufeature.h
-LIB_H += util/include/asm/unistd_32.h
-LIB_H += util/include/asm/unistd_64.h
-LIB_H += perf.h
-LIB_H += util/annotate.h
-LIB_H += util/cache.h
-LIB_H += util/callchain.h
-LIB_H += util/build-id.h
-LIB_H += util/debug.h
-LIB_H += util/pmu.h
-LIB_H += util/event.h
-LIB_H += util/evsel.h
-LIB_H += util/evlist.h
-LIB_H += util/exec_cmd.h
-LIB_H += util/types.h
-LIB_H += util/levenshtein.h
-LIB_H += util/machine.h
-LIB_H += util/map.h
-LIB_H += util/parse-options.h
-LIB_H += util/parse-events.h
-LIB_H += util/quote.h
-LIB_H += util/util.h
-LIB_H += util/xyarray.h
-LIB_H += util/header.h
-LIB_H += util/help.h
-LIB_H += util/session.h
-LIB_H += util/strbuf.h
-LIB_H += util/strlist.h
-LIB_H += util/strfilter.h
-LIB_H += util/svghelper.h
-LIB_H += util/tool.h
-LIB_H += util/run-command.h
-LIB_H += util/sigchain.h
-LIB_H += util/dso.h
-LIB_H += util/symbol.h
-LIB_H += util/color.h
-LIB_H += util/values.h
-LIB_H += util/sort.h
-LIB_H += util/hist.h
-LIB_H += util/comm.h
-LIB_H += util/thread.h
-LIB_H += util/thread_map.h
-LIB_H += util/trace-event.h
-LIB_H += util/probe-finder.h
-LIB_H += util/dwarf-aux.h
-LIB_H += util/probe-event.h
-LIB_H += util/pstack.h
-LIB_H += util/cpumap.h
-LIB_H += util/top.h
-LIB_H += $(ARCH_INCLUDE)
-LIB_H += util/cgroup.h
-LIB_H += $(LIB_INCLUDE)traceevent/event-parse.h
-LIB_H += util/target.h
-LIB_H += util/rblist.h
-LIB_H += util/intlist.h
-LIB_H += util/perf_regs.h
-LIB_H += util/unwind.h
-LIB_H += util/vdso.h
-LIB_H += ui/helpline.h
-LIB_H += ui/progress.h
-LIB_H += ui/util.h
-LIB_H += ui/ui.h
-LIB_H += util/data.h
-
-LIB_OBJS += $(OUTPUT)util/abspath.o
-LIB_OBJS += $(OUTPUT)util/alias.o
-LIB_OBJS += $(OUTPUT)util/annotate.o
-LIB_OBJS += $(OUTPUT)util/build-id.o
-LIB_OBJS += $(OUTPUT)util/config.o
-LIB_OBJS += $(OUTPUT)util/ctype.o
-LIB_OBJS += $(OUTPUT)util/pmu.o
-LIB_OBJS += $(OUTPUT)util/environment.o
-LIB_OBJS += $(OUTPUT)util/event.o
-LIB_OBJS += $(OUTPUT)util/evlist.o
-LIB_OBJS += $(OUTPUT)util/evsel.o
-LIB_OBJS += $(OUTPUT)util/exec_cmd.o
-LIB_OBJS += $(OUTPUT)util/help.o
-LIB_OBJS += $(OUTPUT)util/kallsyms.o
-LIB_OBJS += $(OUTPUT)util/levenshtein.o
-LIB_OBJS += $(OUTPUT)util/parse-options.o
-LIB_OBJS += $(OUTPUT)util/parse-events.o
-LIB_OBJS += $(OUTPUT)util/path.o
-LIB_OBJS += $(OUTPUT)util/rbtree.o
-LIB_OBJS += $(OUTPUT)util/bitmap.o
-LIB_OBJS += $(OUTPUT)util/hweight.o
-LIB_OBJS += $(OUTPUT)util/run-command.o
-LIB_OBJS += $(OUTPUT)util/quote.o
-LIB_OBJS += $(OUTPUT)util/strbuf.o
-LIB_OBJS += $(OUTPUT)util/string.o
-LIB_OBJS += $(OUTPUT)util/strlist.o
-LIB_OBJS += $(OUTPUT)util/strfilter.o
-LIB_OBJS += $(OUTPUT)util/top.o
-LIB_OBJS += $(OUTPUT)util/usage.o
-LIB_OBJS += $(OUTPUT)util/wrapper.o
-LIB_OBJS += $(OUTPUT)util/sigchain.o
-LIB_OBJS += $(OUTPUT)util/dso.o
-LIB_OBJS += $(OUTPUT)util/symbol.o
-LIB_OBJS += $(OUTPUT)util/symbol-elf.o
-LIB_OBJS += $(OUTPUT)util/color.o
-LIB_OBJS += $(OUTPUT)util/pager.o
-LIB_OBJS += $(OUTPUT)util/header.o
-LIB_OBJS += $(OUTPUT)util/callchain.o
-LIB_OBJS += $(OUTPUT)util/values.o
-LIB_OBJS += $(OUTPUT)util/debug.o
-LIB_OBJS += $(OUTPUT)util/machine.o
-LIB_OBJS += $(OUTPUT)util/map.o
-LIB_OBJS += $(OUTPUT)util/pstack.o
-LIB_OBJS += $(OUTPUT)util/session.o
-LIB_OBJS += $(OUTPUT)util/comm.o
-LIB_OBJS += $(OUTPUT)util/thread.o
-LIB_OBJS += $(OUTPUT)util/thread_map.o
-LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
-LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
-LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
-LIB_OBJS += $(OUTPUT)util/pmu-flex.o
-LIB_OBJS += $(OUTPUT)util/pmu-bison.o
-LIB_OBJS += $(OUTPUT)util/trace-event-read.o
-LIB_OBJS += $(OUTPUT)util/trace-event-info.o
-LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
-LIB_OBJS += $(OUTPUT)util/trace-event.o
-LIB_OBJS += $(OUTPUT)util/svghelper.o
-LIB_OBJS += $(OUTPUT)util/sort.o
-LIB_OBJS += $(OUTPUT)util/hist.o
-LIB_OBJS += $(OUTPUT)util/probe-event.o
-LIB_OBJS += $(OUTPUT)util/util.o
-LIB_OBJS += $(OUTPUT)util/xyarray.o
-LIB_OBJS += $(OUTPUT)util/cpumap.o
-LIB_OBJS += $(OUTPUT)util/cgroup.o
-LIB_OBJS += $(OUTPUT)util/target.o
-LIB_OBJS += $(OUTPUT)util/rblist.o
-LIB_OBJS += $(OUTPUT)util/intlist.o
-LIB_OBJS += $(OUTPUT)util/vdso.o
-LIB_OBJS += $(OUTPUT)util/stat.o
-LIB_OBJS += $(OUTPUT)util/record.o
-LIB_OBJS += $(OUTPUT)util/srcline.o
-LIB_OBJS += $(OUTPUT)util/data.o
-
-LIB_OBJS += $(OUTPUT)ui/setup.o
-LIB_OBJS += $(OUTPUT)ui/helpline.o
-LIB_OBJS += $(OUTPUT)ui/progress.o
-LIB_OBJS += $(OUTPUT)ui/util.o
-LIB_OBJS += $(OUTPUT)ui/hist.o
-LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
-
-LIB_OBJS += $(OUTPUT)arch/common.o
-
-LIB_OBJS += $(OUTPUT)tests/parse-events.o
-LIB_OBJS += $(OUTPUT)tests/dso-data.o
-LIB_OBJS += $(OUTPUT)tests/attr.o
-LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
-LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
-LIB_OBJS += $(OUTPUT)tests/perf-record.o
-LIB_OBJS += $(OUTPUT)tests/rdpmc.o
-LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
-LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
-LIB_OBJS += $(OUTPUT)tests/pmu.o
-LIB_OBJS += $(OUTPUT)tests/hists_link.o
-LIB_OBJS += $(OUTPUT)tests/python-use.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
-LIB_OBJS += $(OUTPUT)tests/task-exit.o
-LIB_OBJS += $(OUTPUT)tests/sw-clock.o
-ifeq ($(ARCH),x86)
-LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
-endif
-LIB_OBJS += $(OUTPUT)tests/code-reading.o
-LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
-LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
-ifndef NO_DWARF_UNWIND
-ifeq ($(ARCH),x86)
-LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o
-endif
-endif
-
-BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
-BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
-# Benchmark modules
-BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
-BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
-ifeq ($(RAW_ARCH),x86_64)
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
-endif
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
-
-BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
-BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
-BUILTIN_OBJS += $(OUTPUT)builtin-help.o
-BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
-BUILTIN_OBJS += $(OUTPUT)builtin-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-record.o
-BUILTIN_OBJS += $(OUTPUT)builtin-report.o
-BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
-BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
-BUILTIN_OBJS += $(OUTPUT)builtin-top.o
-BUILTIN_OBJS += $(OUTPUT)builtin-script.o
-BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
-BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
-BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
-BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
-BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
-
-PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT)
-
-# We choose to avoid "if .. else if .. else .. endif endif"
-# because maintaining the nesting to match is a pain.  If
-# we had "elif" things would have been much nicer...
-
--include arch/$(ARCH)/Makefile
-
-ifneq ($(OUTPUT),)
-  CFLAGS += -I$(OUTPUT)
-endif
-
-ifdef NO_LIBELF
-EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
-
-# Remove ELF/DWARF dependent codes
-LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
-
-BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
-
-# Use minimal symbol handling
-LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
-
-else # NO_LIBELF
-ifndef NO_DWARF
-  LIB_OBJS += $(OUTPUT)util/probe-finder.o
-  LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
-endif # NO_DWARF
-endif # NO_LIBELF
-
-ifndef NO_LIBDW_DWARF_UNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libdw.o
-  LIB_H += util/unwind-libdw.h
-endif
-
-ifndef NO_LIBUNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o
-endif
-LIB_OBJS += $(OUTPUT)tests/keep-tracking.o
-
-ifndef NO_LIBAUDIT
-  BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
-endif
-
-ifndef NO_SLANG
-  LIB_OBJS += $(OUTPUT)ui/browser.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/map.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/header.o
-  LIB_OBJS += $(OUTPUT)ui/tui/setup.o
-  LIB_OBJS += $(OUTPUT)ui/tui/util.o
-  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
-  LIB_OBJS += $(OUTPUT)ui/tui/progress.o
-  LIB_H += ui/tui/tui.h
-  LIB_H += ui/browser.h
-  LIB_H += ui/browsers/map.h
-  LIB_H += ui/keysyms.h
-  LIB_H += ui/libslang.h
-endif
-
-ifndef NO_GTK2
-  ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
-
-  GTK_OBJS += $(OUTPUT)ui/gtk/browser.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/hists.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/setup.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/util.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/helpline.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/progress.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/annotate.o
-
-install-gtk: $(OUTPUT)libperf-gtk.so
-	$(call QUIET_INSTALL, 'GTK UI') \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
-		$(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
-endif
-
-ifndef NO_LIBPERL
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
-  LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
-endif
-
-ifndef NO_LIBPYTHON
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-  LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-endif
-
-ifeq ($(NO_PERF_REGS),0)
-  ifeq ($(ARCH),x86)
-    LIB_H += arch/x86/include/perf_regs.h
-  endif
-  LIB_OBJS += $(OUTPUT)util/perf_regs.o
-endif
-
-ifndef NO_LIBNUMA
-  BUILTIN_OBJS += $(OUTPUT)bench/numa.o
-endif
-
-ifdef ASCIIDOC8
-  export ASCIIDOC8
-endif
-
-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
-
-export INSTALL SHELL_PATH
-
-### Build rules
-
-SHELL = $(SHELL_PATH)
-
-all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
-
-please_set_SHELL_PATH_to_a_more_modern_shell:
-	@$$(:)
-
-shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
-
-strip: $(PROGRAMS) $(OUTPUT)perf
-	$(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
-
-$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		$(CFLAGS) -c $(filter %.c,$^) -o $@
-
-$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
-               $(BUILTIN_OBJS) $(LIBS) -o $@
-
-$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H)
-	$(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
-
-$(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS)
-
-$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
-
-$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
-
-$(SCRIPTS) : % : %.sh
-	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
-
-# These can record PERF_VERSION
-$(OUTPUT)perf.o perf.spec \
-	$(SCRIPTS) \
-	: $(OUTPUT)PERF-VERSION-FILE
-
-.SUFFIXES:
-
-#
-# If a target does not match any of the later rules then prefix it by $(OUTPUT)
-# This makes targets like 'make O=/tmp/perf perf.o' work in a natural way.
-#
-ifneq ($(OUTPUT),)
-%.o: $(OUTPUT)%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-util/%.o: $(OUTPUT)util/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-bench/%.o: $(OUTPUT)bench/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-tests/%.o: $(OUTPUT)tests/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-endif
-
-# These two need to be here so that when O= is not used they take precedence
-# over the general rule for .o
-
-$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
-
-$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
-
-$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
-$(OUTPUT)%.o: %.S
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.s: %.S
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-
-$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
-		'-DPREFIX="$(prefix_SQ)"' \
-		$<
-
-$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		-DPYTHONPATH='"$(OUTPUT)python"' \
-		-DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/dwarf-unwind.o: tests/dwarf-unwind.c
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -fno-optimize-sibling-calls $<
-
-$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)ui/setup.o: ui/setup.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DLIBDIR='"$(libdir_SQ)"' $<
-
-$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-
-$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
-
-$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
-
-$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
-
-$(OUTPUT)perf-%: %.o $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
-
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
-$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
-
-# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
-# we depend the various files onto their directories.
-DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS)
-DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
-# no need to add flex objects, because they depend on bison ones
-DIRECTORY_DEPS += $(OUTPUT)util/parse-events-bison.c
-DIRECTORY_DEPS += $(OUTPUT)util/pmu-bison.c
-
-OUTPUT_DIRECTORIES := $(sort $(dir $(DIRECTORY_DEPS)))
-
-$(DIRECTORY_DEPS): | $(OUTPUT_DIRECTORIES)
-# In the second step, we make a rule to actually create these directories
-$(OUTPUT_DIRECTORIES):
-	$(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
-
-$(LIB_FILE): $(LIB_OBJS)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
-
-# libtraceevent.a
-TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch])
-
-LIBTRACEEVENT_FLAGS  = $(QUIET_SUBDIR1) O=$(OUTPUT)
-LIBTRACEEVENT_FLAGS += CFLAGS="-g -Wall $(EXTRA_CFLAGS)"
-LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
-
-$(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins
-
-$(LIBTRACEEVENT)-clean:
-	$(call QUIET_CLEAN, libtraceevent)
-	@$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
-
-install-traceevent-plugins: $(LIBTRACEEVENT)
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) install_plugins
-
-LIBAPIKFS_SOURCES = $(wildcard $(LIB_PATH)fs/*.[ch])
-
-# if subdir is set, we've been called from above so target has been built
-# already
-$(LIBAPIKFS): $(LIBAPIKFS_SOURCES)
-ifeq ($(subdir),)
-	$(QUIET_SUBDIR0)$(LIB_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libapikfs.a
-endif
-
-$(LIBAPIKFS)-clean:
-ifeq ($(subdir),)
-	$(call QUIET_CLEAN, libapikfs)
-	@$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
-endif
-
-help:
-	@echo 'Perf make targets:'
-	@echo '  doc		- make *all* documentation (see below)'
-	@echo '  man		- make manpage documentation (access with man <foo>)'
-	@echo '  html		- make html documentation'
-	@echo '  info		- make GNU info documentation (access with info <foo>)'
-	@echo '  pdf		- make pdf documentation'
-	@echo '  TAGS		- use etags to make tag information for source browsing'
-	@echo '  tags		- use ctags to make tag information for source browsing'
-	@echo '  cscope	- use cscope to make interactive browsing database'
-	@echo ''
-	@echo 'Perf install targets:'
-	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
-	@echo '  HINT: use "make prefix=<path> <install target>" to install to a particular'
-	@echo '        path like make prefix=/usr/local install install-doc'
-	@echo '  install	- install compiled binaries'
-	@echo '  install-doc	- install *all* documentation'
-	@echo '  install-man	- install manpage documentation'
-	@echo '  install-html	- install html documentation'
-	@echo '  install-info	- install GNU info documentation'
-	@echo '  install-pdf	- install pdf documentation'
-	@echo ''
-	@echo '  quick-install-doc	- alias for quick-install-man'
-	@echo '  quick-install-man	- install the documentation quickly'
-	@echo '  quick-install-html	- install the html documentation quickly'
-	@echo ''
-	@echo 'Perf maintainer targets:'
-	@echo '  clean			- clean all binary objects and build output'
-
-
-DOC_TARGETS := doc man html info pdf
-
-INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
-INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
-
-# 'make doc' should call 'make -C Documentation all'
-$(DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
-
-TAGS:
-	$(RM) TAGS
-	$(FIND) . -name '*.[hcS]' -print | xargs etags -a
-
-tags:
-	$(RM) tags
-	$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
-
-cscope:
-	$(RM) cscope*
-	$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
-
-### Detect prefix changes
-TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
-             $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):$(plugindir_SQ)
-
-$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
-	@FLAGS='$(TRACK_CFLAGS)'; \
-	    if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
-		echo 1>&2 "  FLAGS:   * new build flags or prefix"; \
-		echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
-            fi
-
-### Testing rules
-
-# GNU make supports exporting all variables by "export" without parameters.
-# However, the environment gets quite big, and some programs have problems
-# with that.
-
-check: $(OUTPUT)common-cmds.h
-	if sparse; \
-	then \
-		for i in *.c */*.c; \
-		do \
-			sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
-		done; \
-	else \
-		exit 1; \
-	fi
-
-### Installation rules
-
-install-gtk:
-
-install-bin: all install-gtk
-	$(call QUIET_INSTALL, binaries) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
-	$(call QUIET_INSTALL, libexec) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-	$(call QUIET_INSTALL, perf-archive) \
-		$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-ifndef NO_LIBPERL
-	$(call QUIET_INSTALL, perl-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \
-		$(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
-endif
-ifndef NO_LIBPYTHON
-	$(call QUIET_INSTALL, python-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \
-		$(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \
-		$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
-endif
-	$(call QUIET_INSTALL, perf_completion-script) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
-		$(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
-	$(call QUIET_INSTALL, tests) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
-		$(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
-
-install: install-bin try-install-man install-traceevent-plugins
-
-install-python_ext:
-	$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
-
-# 'make install-doc' should call 'make -C Documentation install'
-$(INSTALL_DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
-
-### Cleaning rules
-
-#
-# This is here, not in config/Makefile, because config/Makefile does
-# not get included for the clean target:
-#
-config-clean:
-	$(call QUIET_CLEAN, config)
-	@$(MAKE) -C config/feature-checks clean >/dev/null
-
-clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
-	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
-	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
-	$(python-clean)
-
-#
-# Trick: if ../../.git does not exist - we are building out of tree for example,
-# then force version regeneration:
-#
-ifeq ($(wildcard ../../.git/HEAD),)
-    GIT-HEAD-PHONY = ../../.git/HEAD
-else
-    GIT-HEAD-PHONY =
-endif
-
-.PHONY: all install clean config-clean strip install-gtk
-.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS
-
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* Re: [PATCH 03/32] perf tools: Kbuild source related fixies
  2014-06-03 22:05     ` [PATCH 03/32] perf tools: Kbuild " Alexis Berlemont
@ 2014-06-04  1:49       ` David Ahern
  2014-06-04  6:49         ` Paul Bolle
  0 siblings, 1 reply; 98+ messages in thread
From: David Ahern @ 2014-06-04  1:49 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel
  Cc: Jiri Olsa, mingo, sam, mmarek, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Ingo Molnar, Paul Mackerras, Corey Ashford,
	Frederic Weisbecker, Namhyung Kim, Borislav Petkov, linux-kbuild,
	Stephane Eranian

On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
> From: Jiri Olsa <jolsa@redhat.com>
>
> Fixing several sources config dependencies to allow
> separate config builds.
>
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: linux-kbuild@vger.kernel.org
> Cc: Stephane Eranian <eranian@google.com>
> ---
>   tools/perf/builtin-lock.c        |  4 +++-
>   tools/perf/builtin-sched.c       |  2 ++
>   tools/perf/perf.c                |  6 ++++++
>   tools/perf/perf.h                |  2 ++
>   tools/perf/ui/browsers/scripts.c |  4 ++++
>   tools/perf/ui/setup.c            | 10 +++++++++-
>   6 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> index c852c7a..b255c20 100644
> --- a/tools/perf/builtin-lock.c
> +++ b/tools/perf/builtin-lock.c
> @@ -992,9 +992,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
>   				usage_with_options(report_usage, report_options);
>   		}
>   		rc = __cmd_report(false);
> +#ifdef CONFIG_BULTIN_SCRIPT
>   	} else if (!strcmp(argv[0], "script")) {
>   		/* Aliased to 'perf script' */
> -		return cmd_script(argc, argv, prefix);
> +		rc = cmd_script(argc, argv, prefix);
> +#endif
>   	} else if (!strcmp(argv[0], "info")) {
>   		if (argc) {
>   			argc = parse_options(argc, argv,

Since you are not adding builtin-cmds.h as an included file this change 
takes away functionality. Each patch should ensure that existing options 
continue to work after the change.

ditto for all of the other changes to other files.

David

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks
  2014-06-03 22:05     ` [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
@ 2014-06-04  1:50       ` David Ahern
  0 siblings, 0 replies; 98+ messages in thread
From: David Ahern @ 2014-06-04  1:50 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel; +Cc: jolsa, mingo, sam, mmarek

you are missing a commit message as to why the below change is needed. 
What happens without this patch. What happens with this patch.

David

On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
> ---
>   tools/perf/Makefile.kbuild | 2 +-
>   tools/perf/config/Makefile | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
> index 1e3621f..b2d0d08 100644
> --- a/tools/perf/Makefile.kbuild
> +++ b/tools/perf/Makefile.kbuild
> @@ -90,7 +90,7 @@ VPATH += $(src-perf)
>
>   export src-perf obj-perf
>
> -OUTPUT := $(obj-perf)
> +OUTPUT := $(obj-perf)/
>
>   export OUTPUT
>
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index 78ee62d..1760f57 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -135,7 +135,7 @@ endif
>
>   feature_check = $(eval $(feature_check_code))
>   define feature_check_code
> -  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
> +  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(src-perf)/config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
>   endef
>
>   feature_set = $(eval $(feature_set_code))
> @@ -234,7 +234,7 @@ ifeq ($(feature-all), 1)
>     #
>     $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
>   else
> -  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
> +  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C $(src-perf)/config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
>     $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
>   endif
>
>


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...)
  2014-06-03 22:05     ` [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
@ 2014-06-04  1:52       ` David Ahern
  0 siblings, 0 replies; 98+ messages in thread
From: David Ahern @ 2014-06-04  1:52 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel; +Cc: jolsa, mingo, sam, mmarek

ditto. you need a blurb here as to what is happening in the patch below.

On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
> ---
>   tools/perf/Makefile.kbuild | 5 ++++-
>   tools/perf/config/Makefile | 3 +++
>   2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
> index b2d0d08..e82615f 100644
> --- a/tools/perf/Makefile.kbuild
> +++ b/tools/perf/Makefile.kbuild
> @@ -212,8 +212,11 @@ export prefix_SQ
>   export PARSER_DEBUG_BISON
>   export PARSER_DEBUG_FLEX
>   export ETC_PERFCONFIG_SQ
> +export libdir_SQ
>   export PYTHON_EMBED_CCOPTS
>   export PERL_EMBED_CCOPTS
> +export GTK_CFLAGS
> +
>   endif
>
>   # let sources know it's kbuild
> @@ -262,7 +265,7 @@ $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
>   LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
>
>   tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
> -	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS)
> +	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS) $(GTK_LIBS)

unrelated changes should be in separate patches.

David


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 07/32] perf kbuild: remove useless #ifdef directives
  2014-06-03 22:06     ` [PATCH 07/32] perf kbuild: remove useless #ifdef directives Alexis Berlemont
@ 2014-06-04  1:53       ` David Ahern
  2014-06-04 21:20         ` Alexis Berlemont
  0 siblings, 1 reply; 98+ messages in thread
From: David Ahern @ 2014-06-04  1:53 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel; +Cc: jolsa, mingo, sam, mmarek

missing commit message as to why the ifdef directives useless.

if I build perf after applying this patch and I don't have devel code 
for tui and gui will it still build?

David

On 6/3/14, 4:06 PM, Alexis Berlemont wrote:
> ---
>   tools/perf/ui/setup.c | 8 --------
>   1 file changed, 8 deletions(-)
>
> diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
> index 66ecd08..cb69740 100644
> --- a/tools/perf/ui/setup.c
> +++ b/tools/perf/ui/setup.c
> @@ -71,20 +71,16 @@ void setup_browser(bool fallback_to_pager)
>
>   	switch (use_browser) {
>   	case 2:
> -#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
>   		if (setup_gtk_browser() == 0)
>   			break;
>   		printf("GTK browser requested but could not find %s\n",
>   		       PERF_GTK_DSO);
>   		sleep(1);
> -#endif
>   		/* fall through */
> -#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
>   	case 1:
>   		use_browser = 1;
>   		if (ui__init() == 0)
>   			break;
> -#endif
>   		/* fall through */
>   	default:
>   		use_browser = 0;
> @@ -100,16 +96,12 @@ void exit_browser(bool wait_for_ok __maybe_unused)
>   {
>   	switch (use_browser) {
>   	case 2:
> -#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
>   		exit_gtk_browser(wait_for_ok);
>   		break;
> -#endif
>
> -#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
>   	case 1:
>   		ui__exit(wait_for_ok);
>   		break;
> -#endif
>
>   	default:
>   		break;
>


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 00/32] perf and kconfig kbuild (2nd try)
  2014-06-03 22:05     ` [PATCH 00/32] perf and kconfig kbuild (2nd try) Alexis Berlemont
@ 2014-06-04  1:59       ` David Ahern
  2014-06-04 11:12         ` Alexis Berlemont
  0 siblings, 1 reply; 98+ messages in thread
From: David Ahern @ 2014-06-04  1:59 UTC (permalink / raw)
  To: Alexis Berlemont, linux-kernel; +Cc: jolsa, mingo, sam, mmarek, Namhyung Kim

On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
> Alexis Berlemont (29):
>    kbuild: add support of custom paths for "auto.conf*" files
>    perf kbuild: fix recursive invocation of config/features-checks
>    perf kbuild: store in config-detected missing variables (libdir, ...)
>    perf kbuild: remove useless #ifdef directives
>    perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
>    perf kbuild: add missing files and missing flags in Kbuild files
>    perf kbuild: update kbuild files according to last changes
>    perf kbuild: remove legacy slang-related build variables
>    perf kbuild: remove legacy libaudit-related build variables
>    perf kbuild: remove legacy libgtk2-related build variables
>    perf kbuild: remove legacy libperl-related build variables
>    perf kbuild: remove legacy timerfd-related build variable
>    perf kbuild: remove legacy demangle-related build variables
>    perf kbuild: remove legacy on_exit-related build variable
>    perf kbuild: remove legacy backtrace-related build variable
>    perf kbuild: remove legacy numa-related build variable
>    perf kbuild: remove legacy bionic-related build variable
>    perf kbuild: remove legacy libelf-related build variables (1st part)
>    perf kbuild: remove legacy libelf-related build variables (2nd part)
>    perf kbuild: remove legacy libdwarf-related build variables
>    perf kbuild: remove legacy libpython-related build variable
>    perf kbuild: add generated Kconfig build-test cases
>    perf kbuild: fix installation of traceevent plugins
>    perf kbuild: fix tarpkg target in tests/make
>    perf kbuild: update Kbuild files with new and removed sources
>    perf kbuild: update build test configurations
>    perf kbuild: relocate the configs generating script
>    perf kbuild: minor changes
>    perf kbuild: remove Makefile.perf


In general you are missing commit messages that explain why the patch is 
needed -- what does it do, what is changed. The code should evolve from 
where it is to where you want it to be in small focused patches that do 
not break compiles or features (important for git-bisect).

For patches that you are leveraging from Jiri odds are they need to be 
updated for what has happened over the past year since Jiri's last 
effort on this. I suggest doing the updates in line with Jiri's patch 
and add a comment of what was added to Jiri's patch.

Also add Namhyung Kim <namhyung@kernel.org> to your CC list.

Thanks,
David

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 03/32] perf tools: Kbuild source related fixies
  2014-06-04  1:49       ` David Ahern
@ 2014-06-04  6:49         ` Paul Bolle
  0 siblings, 0 replies; 98+ messages in thread
From: Paul Bolle @ 2014-06-04  6:49 UTC (permalink / raw)
  To: David Ahern
  Cc: Alexis Berlemont, linux-kernel, Jiri Olsa, mingo, sam, mmarek,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, linux-kbuild, Stephane Eranian

On Tue, 2014-06-03 at 19:49 -0600, David Ahern wrote:
> On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
> > From: Jiri Olsa <jolsa@redhat.com>
> > diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> > index c852c7a..b255c20 100644
> > --- a/tools/perf/builtin-lock.c
> > +++ b/tools/perf/builtin-lock.c
> > @@ -992,9 +992,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
> >   				usage_with_options(report_usage, report_options);
> >   		}
> >   		rc = __cmd_report(false);
> > +#ifdef CONFIG_BULTIN_SCRIPT
> >   	} else if (!strcmp(argv[0], "script")) {
> >   		/* Aliased to 'perf script' */
> > -		return cmd_script(argc, argv, prefix);
> > +		rc = cmd_script(argc, argv, prefix);
> > +#endif
> >   	} else if (!strcmp(argv[0], "info")) {
> >   		if (argc) {
> >   			argc = parse_options(argc, argv,
> 
> Since you are not adding builtin-cmds.h as an included file this change 
> takes away functionality.

And I guess that, because of the typo in CONFIG_BULTIN_SCRIPT, that
would also be true if builtin-cmds.h were actually included.

>  Each patch should ensure that existing options 
> continue to work after the change.
> 
> ditto for all of the other changes to other files.


Paul Bolle


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 02/32] perf tools: Kbuild builtin source related fixies
  2014-06-03 22:05     ` [PATCH 02/32] perf tools: Kbuild builtin source related fixies Alexis Berlemont
@ 2014-06-04  6:58       ` Paul Bolle
  2014-06-04 14:15         ` David Ahern
  0 siblings, 1 reply; 98+ messages in thread
From: Paul Bolle @ 2014-06-04  6:58 UTC (permalink / raw)
  To: Alexis Berlemont
  Cc: linux-kernel, Jiri Olsa, dsahern, mingo, sam, mmarek,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, linux-kbuild, Stephane Eranian

On Wed, 2014-06-04 at 00:05 +0200, Alexis Berlemont wrote:
> From: Jiri Olsa <jolsa@redhat.com>
> 
> Adding CONFIG_BUILTIN_* defines to govern builtin commands.
> This will be usefull for kbuild process switch.
> 
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: linux-kbuild@vger.kernel.org
> Cc: Stephane Eranian <eranian@google.com>
> ---
>  tools/perf/builtin-cmds.h           | 27 ++++++++++++++++++++++
>  tools/perf/builtin-help.c           |  1 +
>  tools/perf/perf.c                   | 45 +++++++++++++++++++++++++++++++++++--
>  tools/perf/util/generate-cmdlist.sh | 10 +++++++++
>  4 files changed, 81 insertions(+), 2 deletions(-)
>  create mode 100644 tools/perf/builtin-cmds.h
> 
> diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
> new file mode 100644
> index 0000000..fec342a
> --- /dev/null
> +++ b/tools/perf/builtin-cmds.h
> @@ -0,0 +1,27 @@
> +#ifndef BUILTIN_CMDS_H
> +#define BUILTIN_CMDS_H
> +
> +#define CONFIG_BUILTIN_REPORT 1
> +#define CONFIG_BUILTIN_SCRIPT 1
> +#define CONFIG_BUILTIN_BENCH 1
> +#define CONFIG_BUILTIN_SCHED 1
> +#define CONFIG_BUILTIN_TRACE 1
> +#define CONFIG_BUILTIN_TOP 1
> +#define CONFIG_BUILTIN_RECORD 1
> +#define CONFIG_BUILTIN_BUILDID_LIST 1
> +#define CONFIG_BUILTIN_INJECT 1
> +#define CONFIG_BUILTIN_LOCK 1
> +#define CONFIG_BUILTIN_KVM 1
> +#define CONFIG_BUILTIN_BUILDID_CACHE 1
> +#define CONFIG_BUILTIN_EVLIST 1
> +#define CONFIG_BUILTIN_KMEM 1
> +#define CONFIG_BUILTIN_STAT 1
> +#define CONFIG_BUILTIN_DIFF 1
> +#define CONFIG_BUILTIN_ANNOTATE 1
> +#define CONFIG_BUILTIN_TIMECHART 1
> +#define CONFIG_BUILTIN_LIST 1
> +#define CONFIG_BUILTIN_HELP 1
> +#define CONFIG_BUILTIN_PROBE 1
> +#define CONFIG_BUILTIN_MEM 1
> +
> +#endif /* BUILTIN_CMDS_H */

Pet peeve: #defines with a CONFIG_ prefix. Is that prefix needed here or
would another prefix also do? Or can these macros perhaps be added
through a Kconfig file (eg, as "config BUILTIN_REPORT" etc.). Or will
that happen at the "kbuild process switch"?


Paul Bolle


^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 00/32] perf and kconfig kbuild (2nd try)
  2014-06-04  1:59       ` David Ahern
@ 2014-06-04 11:12         ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 00/13] perf and kbuild (3rd try) Alexis Berlemont
                             ` (13 more replies)
  0 siblings, 14 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-04 11:12 UTC (permalink / raw)
  To: David Ahern
  Cc: linux-kernel, Jiri Olsa, Ingo Molnar, sam, Michal Marek, Namhyung Kim

On Wed, Jun 4, 2014 at 3:59 AM, David Ahern <dsahern@gmail.com> wrote:
> On 6/3/14, 4:05 PM, Alexis Berlemont wrote:
>>
>> Alexis Berlemont (29):
>>    kbuild: add support of custom paths for "auto.conf*" files
>>    perf kbuild: fix recursive invocation of config/features-checks
>>    perf kbuild: store in config-detected missing variables (libdir, ...)
>>    perf kbuild: remove useless #ifdef directives
>>    perf kbuild: fix a link issue if BUILTIN_TRACE is disabled
>>    perf kbuild: add missing files and missing flags in Kbuild files
>>    perf kbuild: update kbuild files according to last changes
>>    perf kbuild: remove legacy slang-related build variables
>>    perf kbuild: remove legacy libaudit-related build variables
>>    perf kbuild: remove legacy libgtk2-related build variables
>>    perf kbuild: remove legacy libperl-related build variables
>>    perf kbuild: remove legacy timerfd-related build variable
>>    perf kbuild: remove legacy demangle-related build variables
>>    perf kbuild: remove legacy on_exit-related build variable
>>    perf kbuild: remove legacy backtrace-related build variable
>>    perf kbuild: remove legacy numa-related build variable
>>    perf kbuild: remove legacy bionic-related build variable
>>    perf kbuild: remove legacy libelf-related build variables (1st part)
>>    perf kbuild: remove legacy libelf-related build variables (2nd part)
>>    perf kbuild: remove legacy libdwarf-related build variables
>>    perf kbuild: remove legacy libpython-related build variable
>>    perf kbuild: add generated Kconfig build-test cases
>>    perf kbuild: fix installation of traceevent plugins
>>    perf kbuild: fix tarpkg target in tests/make
>>    perf kbuild: update Kbuild files with new and removed sources
>>    perf kbuild: update build test configurations
>>    perf kbuild: relocate the configs generating script
>>    perf kbuild: minor changes
>>    perf kbuild: remove Makefile.perf
>
>
>
> In general you are missing commit messages that explain why the patch is
> needed -- what does it do, what is changed. The code should evolve from
> where it is to where you want it to be in small focused patches that do not
> break compiles or features (important for git-bisect).

OK. I will gather the various commits in less large set of patches.
>
> For patches that you are leveraging from Jiri odds are they need to be
> updated for what has happened over the past year since Jiri's last effort on
> this. I suggest doing the updates in line with Jiri's patch and add a
> comment of what was added to Jiri's patch.
>

OK. Let's try again. Many thanks for your answer.

> Also add Namhyung Kim <namhyung@kernel.org> to your CC list.
>
> Thanks,
> David

Alexis.

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 02/32] perf tools: Kbuild builtin source related fixies
  2014-06-04  6:58       ` Paul Bolle
@ 2014-06-04 14:15         ` David Ahern
  0 siblings, 0 replies; 98+ messages in thread
From: David Ahern @ 2014-06-04 14:15 UTC (permalink / raw)
  To: Paul Bolle, Alexis Berlemont
  Cc: linux-kernel, Jiri Olsa, mingo, sam, mmarek,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker, Namhyung Kim,
	Borislav Petkov, linux-kbuild, Stephane Eranian

On 6/4/14, 12:58 AM, Paul Bolle wrote:
> Pet peeve: #defines with a CONFIG_ prefix. Is that prefix needed here or
> would another prefix also do? Or can these macros perhaps be added
> through a Kconfig file (eg, as "config BUILTIN_REPORT" etc.). Or will
> that happen at the "kbuild process switch"?

This is a temporary stepping stone to having them generated by kbuild.

David

^ permalink raw reply	[flat|nested] 98+ messages in thread

* Re: [PATCH 07/32] perf kbuild: remove useless #ifdef directives
  2014-06-04  1:53       ` David Ahern
@ 2014-06-04 21:20         ` Alexis Berlemont
  0 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-04 21:20 UTC (permalink / raw)
  To: David Ahern; +Cc: linux-kernel, Jiri Olsa, Ingo Molnar, sam, Michal Marek

On Wed, Jun 4, 2014 at 3:53 AM, David Ahern <dsahern@gmail.com> wrote:
> missing commit message as to why the ifdef directives useless.
>

If I remember well, after having rebased Jiri Olsa's patches on the
current branch. The build procedure was not working correctly. So, the
first commits tried to fix the issues. The ifdef directives were no
more needed because they were moved elsewhere in more recent versions
(I think Jiri Olsa's patches were released in April 2013)

I now understand that these changes should have been integrated into
jiri's rebased commits. I will fix that.

> if I build perf after applying this patch and I don't have devel code for
> tui and gui will it still build?
>

Sidenote: after having applied _all_ the patches. If you build perf
and you don't have the tui / gui devel code, the absence of headers
will be detected by features test
(linux/tools/perf/config/features-checks/*) and the .config will be
updated accordingly. So, at build time, it should be ok. By the way, I
updated the non-regression procedure (available through the target
build-test); many .config files were automatically generated in
linux/tools/perf/tests/configs thanks a python script (which relies on
kconfiglib):
* for each option, there is a .config file in which the option is disabled
* a minimal .config file (nearly everything disabled) and a defconfig
/ allyesconfig file are  also tested.

Alexis.

> David
>
>
> On 6/3/14, 4:06 PM, Alexis Berlemont wrote:
>>
>> ---
>>   tools/perf/ui/setup.c | 8 --------
>>   1 file changed, 8 deletions(-)
>>
>> diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
>> index 66ecd08..cb69740 100644
>> --- a/tools/perf/ui/setup.c
>> +++ b/tools/perf/ui/setup.c
>> @@ -71,20 +71,16 @@ void setup_browser(bool fallback_to_pager)
>>
>>         switch (use_browser) {
>>         case 2:
>> -#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
>>                 if (setup_gtk_browser() == 0)
>>                         break;
>>                 printf("GTK browser requested but could not find %s\n",
>>                        PERF_GTK_DSO);
>>                 sleep(1);
>> -#endif
>>                 /* fall through */
>> -#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
>>         case 1:
>>                 use_browser = 1;
>>                 if (ui__init() == 0)
>>                         break;
>> -#endif
>>                 /* fall through */
>>         default:
>>                 use_browser = 0;
>> @@ -100,16 +96,12 @@ void exit_browser(bool wait_for_ok __maybe_unused)
>>   {
>>         switch (use_browser) {
>>         case 2:
>> -#if defined(CONFIG_GUI) || !defined(CONFIG_KBUILD)
>>                 exit_gtk_browser(wait_for_ok);
>>                 break;
>> -#endif
>>
>> -#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
>>         case 1:
>>                 ui__exit(wait_for_ok);
>>                 break;
>> -#endif
>>
>>         default:
>>                 break;
>>
>

^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 00/13] perf and kbuild (3rd try)
  2014-06-04 11:12         ` Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 01/13] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
                             ` (12 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Hello,

Once more sorry for the delay of this third proposal. 

The main change, here, is the reoarganization of the patch set: 
* The patches count was reduced.
* Patches originally from Jiri Olsa now contain the fixes related with
  code evolution.
* The commit comments were enriched

Next steps for me are: 
* Test cross-compilation cases. So far, the build-test target succeeds
  in native build environment.
* Fix a bug in timerfd feature detection.
* Investigate a bug which randomly occurs in multi-jobs compilation:
  many object files are not generated but the link step is triggered
  for an unkwown reason; the result is undefined reference
  errors. Relaunching the make command solves the issue.

Alexis.

Alexis Berlemont (10):
  kbuild: add support of custom paths for "auto.conf*" files
  perf kbuild: remove Makefile.perf
  perf kbuild: remove legacy tui/gui-related build variables
  perf kbuild: remove legacy demangle-related build variables
  perf kbuild: remove legacy misc build variables
  perf kbuild: remove legacy libelf-related build variables
  perf kbuild: remove legacy libdwarf-related build variables
  perf kbuild: remove legacy script-related build variables
  perf kbuild: final cosmetic changes
  perf kbuild: add generated Kconfig build-test cases

Jiri Olsa (3):
  perf tools: Kbuild builtin source related fixies
  perf tools: Kbuild source related fixies
  perf tools: Add kbuild support into Makefile.kbuild

 scripts/Makefile.build                             |   3 +-
 scripts/kconfig/confdata.c                         |  27 +-
 scripts/kconfig/lkc.h                              |   1 +
 tools/perf/Kbuild                                  |  47 ++
 tools/perf/Kconfig                                 | 384 +++++++++
 tools/perf/MANIFEST                                |   1 +
 tools/perf/Makefile                                |   2 +-
 tools/perf/Makefile.kbuild                         | 409 +++++++++
 tools/perf/Makefile.perf                           | 938 ---------------------
 tools/perf/arch/Kbuild                             |   3 +
 tools/perf/arch/arm/Makefile                       |   4 +-
 tools/perf/arch/powerpc/Makefile                   |   2 +-
 tools/perf/arch/s390/Makefile                      |   2 +-
 tools/perf/arch/sh/Makefile                        |   2 +-
 tools/perf/arch/sparc/Makefile                     |   2 +-
 tools/perf/arch/x86/Kbuild                         |   2 +
 tools/perf/arch/x86/Makefile                       |   8 +-
 tools/perf/arch/x86/tests/Kbuild                   |   2 +
 tools/perf/arch/x86/util/Kbuild                    |   5 +
 tools/perf/bench/Kbuild                            |  12 +
 tools/perf/builtin-annotate.c                      |   8 +-
 tools/perf/builtin-bench.c                         |   5 +-
 tools/perf/builtin-help.c                          |   1 +
 tools/perf/builtin-inject.c                        |   2 +-
 tools/perf/builtin-kvm.c                           |  32 +-
 tools/perf/builtin-lock.c                          |   5 +-
 tools/perf/builtin-probe.c                         |  15 +-
 tools/perf/builtin-record.c                        |  12 +-
 tools/perf/builtin-report.c                        |   3 +
 tools/perf/builtin-sched.c                         |   3 +
 tools/perf/builtin-script.c                        |   6 +-
 tools/perf/builtin-top.c                           |  19 +-
 tools/perf/config/Makefile                         | 388 +++++----
 tools/perf/config/defconfig                        |  54 ++
 tools/perf/perf-sys.h                              |   4 +-
 tools/perf/perf.c                                  |  53 +-
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild     |   6 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild   |   5 +
 tools/perf/tests/Kbuild                            |  39 +
 tools/perf/tests/builtin-test.c                    |   3 +-
 tools/perf/tests/configs/MINIMAL_config            |  60 ++
 tools/perf/tests/configs/NO_BACKTRACE_config       |  69 ++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  |  69 ++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  |  60 ++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  |  65 ++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    |  69 ++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config |  69 ++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     |  68 ++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   |  69 ++
 tools/perf/tests/configs/NO_DEMANGLE_config        |  67 ++
 tools/perf/tests/configs/NO_GTK2_config            |  69 ++
 tools/perf/tests/configs/NO_LIBAUDIT_config        |  68 ++
 tools/perf/tests/configs/NO_LIBDWARF_config        |  67 ++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config |  69 ++
 tools/perf/tests/configs/NO_LIBGTK2_config         |  67 ++
 tools/perf/tests/configs/NO_LIBNUMA_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPERL_config         |  69 ++
 tools/perf/tests/configs/NO_LIBPYTHON_config       |  69 ++
 tools/perf/tests/configs/NO_LIBSLANG_config        |  68 ++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  |  69 ++
 tools/perf/tests/configs/NO_STDIO_config           |  69 ++
 tools/perf/tests/configs/NO_TIMERFD_config         |  69 ++
 tools/perf/tests/configs/NO_TUI_config             |  69 ++
 tools/perf/tests/configs/NO_UNWIND_config          |  65 ++
 tools/perf/tests/configs/REF_config                |  69 ++
 tools/perf/tests/generate_configs.py               |  33 +
 tools/perf/tests/make                              |  70 +-
 tools/perf/tests/tests.h                           |   4 +-
 tools/perf/ui/Kbuild                               |  15 +
 tools/perf/ui/browsers/Kbuild                      |   9 +
 tools/perf/ui/browsers/scripts.c                   |   4 +
 tools/perf/ui/gtk/Kbuild                           |   9 +
 tools/perf/ui/gtk/browser.c                        |   4 +-
 tools/perf/ui/gtk/gtk.h                            |   5 +-
 tools/perf/ui/gtk/util.c                           |   6 +-
 tools/perf/ui/setup.c                              |  12 +-
 tools/perf/ui/stdio/Kbuild                         |   1 +
 tools/perf/ui/tui/Kbuild                           |   4 +
 tools/perf/ui/ui.h                                 |   4 +-
 tools/perf/util/Kbuild                             | 125 +++
 tools/perf/util/PERF-VERSION-GEN                   |   4 +
 tools/perf/util/annotate.h                         |   4 +-
 tools/perf/util/generate-cmdlist.sh                |  22 +-
 tools/perf/util/hist.h                             |   4 +-
 tools/perf/util/include/dwarf-regs.h               |   4 +-
 tools/perf/util/map.c                              |   3 +-
 tools/perf/util/probe-event.c                      |   6 +-
 tools/perf/util/probe-finder.h                     |   5 +-
 tools/perf/util/scripting-engines/Kbuild           |  11 +
 tools/perf/util/setup.py                           |   8 +-
 tools/perf/util/srcline.c                          |   8 +-
 tools/perf/util/symbol-elf.c                       |   3 +-
 tools/perf/util/symbol.h                           |  33 +-
 tools/perf/util/trace-event-scripting.c            |  13 +-
 tools/perf/util/unwind-libunwind.c                 |   5 +-
 tools/perf/util/unwind.h                           |   7 +-
 tools/perf/util/util.c                             |   5 +-
 114 files changed, 4552 insertions(+), 1277 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 delete mode 100644 tools/perf/Makefile.perf
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/tests/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/NO_UNWIND_config
 create mode 100644 tools/perf/tests/configs/REF_config
 create mode 100644 tools/perf/tests/generate_configs.py
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

-- 
1.9.3


^ permalink raw reply	[flat|nested] 98+ messages in thread

* [PATCH 01/13] kbuild: add support of custom paths for "auto.conf*" files
  2014-06-04 11:12         ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 00/13] perf and kbuild (3rd try) Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 02/13] perf tools: Kbuild builtin source related fixies Alexis Berlemont
                             ` (11 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

In the scripts/Makefile.build, use KCONFIG_AUTOCONFIG to include a
custom path for the "auto.conf" file.

The "*conf" programs were modified so as to work with the environment
variable KCONFIG_AUTOCONFIG.
---
 scripts/Makefile.build     |  3 ++-
 scripts/kconfig/confdata.c | 27 ++++++++++++++++++++++++++-
 scripts/kconfig/lkc.h      |  1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index bf3e677..ef60769 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -31,7 +31,8 @@ subdir-asflags-y :=
 subdir-ccflags-y :=
 
 # Read auto.conf if it exists, otherwise ignore
--include include/config/auto.conf
+kconfig-autoconfig := $(if $(KCONFIG_AUTOCONFIG),$(KCONFIG_AUTOCONFIG),include/config/auto.conf)
+-include $(kconfig-autoconfig)
 
 include scripts/Kbuild.include
 
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index f88d90f..d4d8920 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -75,6 +75,27 @@ const char *conf_get_autoconfig_name(void)
 	return name ? name : "include/config/auto.conf";
 }
 
+#define PATH_MAXLENGTH 4096
+const char *conf_get_autoconfigdep_name(void)
+{
+	static char res_value[PATH_MAXLENGTH];
+
+	char *name = getenv("KCONFIG_AUTOCONFIG");
+
+	if (name == NULL)
+		name = "include/config/auto.conf.cmd";
+	if (strlen(name) > PATH_MAXLENGTH - 5)
+		name = NULL;
+	else {
+		res_value[0] = 0;
+		strncpy(res_value, name, PATH_MAXLENGTH);
+		strcat(res_value, ".cmd");
+		name = res_value;
+	}
+
+	return name;
+}
+
 static char *conf_expand_value(const char *in)
 {
 	struct symbol *sym;
@@ -953,7 +974,11 @@ int conf_write_autoconf(void)
 
 	sym_clear_all_valid();
 
-	file_write_dep("include/config/auto.conf.cmd");
+	name = conf_get_autoconfigdep_name();
+	if (name == NULL)
+		return 1;
+
+	file_write_dep(name);
 
 	if (conf_split_config())
 		return 1;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index d5daa7a..ac99004 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -84,6 +84,7 @@ const char *zconf_curname(void);
 /* confdata.c */
 const char *conf_get_configname(void);
 const char *conf_get_autoconfig_name(void);
+const char *conf_get_autoconfigdep_name(void);
 char *conf_get_default_confname(void);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 02/13] perf tools: Kbuild builtin source related fixies
  2014-06-04 11:12         ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 00/13] perf and kbuild (3rd try) Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 01/13] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 03/13] perf tools: Kbuild " Alexis Berlemont
                             ` (10 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, namhyung,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker,
	Borislav Petkov, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding CONFIG_BUILTIN_* defines to govern builtin commands.
This will be usefull for kbuild process switch.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-annotate.c       |  8 ++++++-
 tools/perf/builtin-cmds.h           | 27 ++++++++++++++++++++++
 tools/perf/builtin-help.c           |  1 +
 tools/perf/builtin-kvm.c            | 19 ++++++++++------
 tools/perf/builtin-report.c         |  3 +++
 tools/perf/builtin-top.c            | 19 ++++++++++++----
 tools/perf/perf.c                   | 45 +++++++++++++++++++++++++++++++++++--
 tools/perf/ui/setup.c               |  6 +++--
 tools/perf/util/generate-cmdlist.sh | 10 +++++++++
 9 files changed, 122 insertions(+), 16 deletions(-)
 create mode 100644 tools/perf/builtin-cmds.h

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 1ec429f..d40070f 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -114,7 +115,7 @@ static void hists__find_annotations(struct hists *hists,
 				    struct perf_evsel *evsel,
 				    struct perf_annotate *ann)
 {
-	struct rb_node *nd = rb_first(&hists->entries), *next;
+	struct rb_node *nd = rb_first(&hists->entries);
 	int key = K_RIGHT;
 
 	while (nd) {
@@ -153,7 +154,9 @@ find_next:
 
 			/* skip missing symbols */
 			nd = rb_next(nd);
+#ifdef CONFIG_TUI
 		} else if (use_browser == 1) {
+			struct rb_node *next = NULL;
 			key = hist_entry__tui_annotate(he, evsel, NULL);
 			switch (key) {
 			case -1:
@@ -172,6 +175,7 @@ find_next:
 
 			if (next != NULL)
 				nd = next;
+#endif /* CONFIG_TUI */
 		} else {
 			hist_entry__tty_annotate(he, evsel, ann);
 			nd = rb_next(nd);
@@ -314,7 +318,9 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
+#ifdef CONFIG_TUI
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
+#endif /* CONFIG_TUI */
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
new file mode 100644
index 0000000..fec342a
--- /dev/null
+++ b/tools/perf/builtin-cmds.h
@@ -0,0 +1,27 @@
+#ifndef BUILTIN_CMDS_H
+#define BUILTIN_CMDS_H
+
+#define CONFIG_BUILTIN_REPORT 1
+#define CONFIG_BUILTIN_SCRIPT 1
+#define CONFIG_BUILTIN_BENCH 1
+#define CONFIG_BUILTIN_SCHED 1
+#define CONFIG_BUILTIN_TRACE 1
+#define CONFIG_BUILTIN_TOP 1
+#define CONFIG_BUILTIN_RECORD 1
+#define CONFIG_BUILTIN_BUILDID_LIST 1
+#define CONFIG_BUILTIN_INJECT 1
+#define CONFIG_BUILTIN_LOCK 1
+#define CONFIG_BUILTIN_KVM 1
+#define CONFIG_BUILTIN_BUILDID_CACHE 1
+#define CONFIG_BUILTIN_EVLIST 1
+#define CONFIG_BUILTIN_KMEM 1
+#define CONFIG_BUILTIN_STAT 1
+#define CONFIG_BUILTIN_DIFF 1
+#define CONFIG_BUILTIN_ANNOTATE 1
+#define CONFIG_BUILTIN_TIMECHART 1
+#define CONFIG_BUILTIN_LIST 1
+#define CONFIG_BUILTIN_HELP 1
+#define CONFIG_BUILTIN_PROBE 1
+#define CONFIG_BUILTIN_MEM 1
+
+#endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 178b88a..b6c78a6 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -7,6 +7,7 @@
 #include "util/cache.h"
 #include "builtin.h"
 #include "util/exec_cmd.h"
+#include "builtin-cmds.h"
 #include "common-cmds.h"
 #include "util/parse-options.h"
 #include "util/run-command.h"
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0f1e5a2..0d0d9c7 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1718,20 +1718,25 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	if (!strncmp(argv[0], "rec", 3))
 		return __cmd_record(file_name, argc, argv);
-	else if (!strncmp(argv[0], "rep", 3))
+
+	if (!strncmp(argv[0], "rep", 3))
 		return __cmd_report(file_name, argc, argv);
-	else if (!strncmp(argv[0], "diff", 4))
+
+	if (!strncmp(argv[0], "diff", 4))
 		return cmd_diff(argc, argv, NULL);
-	else if (!strncmp(argv[0], "top", 3))
+
+	if (!strncmp(argv[0], "top", 3))
 		return cmd_top(argc, argv, NULL);
-	else if (!strncmp(argv[0], "buildid-list", 12))
+
+	if (!strncmp(argv[0], "buildid-list", 12))
 		return __cmd_buildid_list(file_name, argc, argv);
+
 #if defined(__i386__) || defined(__x86_64__)
-	else if (!strncmp(argv[0], "stat", 4))
+	if (!strncmp(argv[0], "stat", 4))
 		return kvm_cmd_stat(file_name, argc, argv);
 #endif
-	else
-		usage_with_options(kvm_usage, kvm_options);
+
+	usage_with_options(kvm_usage, kvm_options);
 
 	return 0;
 }
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 21d830b..c97410a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -5,6 +5,7 @@
  * look up and read DSOs and symbol information and display
  * a histogram of results, along various sorting keys.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "util/util.h"
@@ -391,6 +392,7 @@ static int report__browse_hists(struct report *rep)
 	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
 
 	switch (use_browser) {
+#ifdef CONFIG_TUI
 	case 1:
 		ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
 						    rep->min_percent,
@@ -402,6 +404,7 @@ static int report__browse_hists(struct report *rep)
 		if (ret != K_SWITCH_INPUT_DATA)
 			ret = 0;
 		break;
+#endif /* CONFIG_TUI */
 	case 2:
 		ret = report__gtk_browse_hists(rep, help);
 		break;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 377971d..c668b0a 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -17,6 +17,7 @@
  *
  * Released under the GPL v2. (and only v2, not any later version)
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
@@ -534,6 +535,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 	return ret;
 }
 
+#ifdef CONFIG_TUI
 static void perf_top__sort_new_samples(void *arg)
 {
 	struct perf_top *t = arg;
@@ -576,6 +578,7 @@ static void *display_thread_tui(void *arg)
 	done = 1;
 	return NULL;
 }
+#endif /* CONFIG_TUI */
 
 static void *display_thread(void *arg)
 {
@@ -903,9 +906,12 @@ static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
 	return 0;
 }
 
+typedef void* (*display_fn_t)(void *);
+
 static int __cmd_top(struct perf_top *top)
 {
 	struct record_opts *opts = &top->record_opts;
+	display_fn_t display_fn = display_thread;
 	pthread_t thread;
 	int ret;
 
@@ -942,8 +948,8 @@ static int __cmd_top(struct perf_top *top)
 	 * XXX 'top' still doesn't start workloads like record, trace, but should,
 	 * so leave the check here.
 	 */
-        if (!target__none(&opts->target))
-                perf_evlist__enable(top->evlist);
+	if (!target__none(&opts->target))
+		perf_evlist__enable(top->evlist);
 
 	/* Wait for a minimal set of events before starting the snapshot */
 	poll(top->evlist->pollfd, top->evlist->nr_fds, 100);
@@ -951,8 +957,13 @@ static int __cmd_top(struct perf_top *top)
 	perf_top__mmap_read(top);
 
 	ret = -1;
-	if (pthread_create(&thread, NULL, (use_browser > 0 ? display_thread_tui :
-							    display_thread), top)) {
+
+#ifdef CONFIG_TUI
+	if (use_browser > 0)
+		display_fn = display_thread_tui;
+#endif
+
+	if (pthread_create(&thread, NULL, display_fn, top)) {
 		ui__error("Could not create display thread.\n");
 		goto out_delete;
 	}
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 95c58fc..8dd6f6f 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -7,6 +7,7 @@
  * perf top, perf record, perf report, etc.) are started.
  */
 #include "builtin.h"
+#include "builtin-cmds.h"
 
 #include "util/exec_cmd.h"
 #include "util/cache.h"
@@ -33,34 +34,74 @@ struct cmd_struct {
 };
 
 static struct cmd_struct commands[] = {
+#ifdef CONFIG_BUILTIN_BUILDID_CACHE
 	{ "buildid-cache", cmd_buildid_cache, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_BUILDID_LIST
 	{ "buildid-list", cmd_buildid_list, 0 },
+#endif
+#ifdef CONFIG_BUILTIN_DIFF
 	{ "diff",	cmd_diff,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_EVLIST
 	{ "evlist",	cmd_evlist,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_HELP
 	{ "help",	cmd_help,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LIST
 	{ "list",	cmd_list,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_RECORD
 	{ "record",	cmd_record,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_REPORT
 	{ "report",	cmd_report,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_BENCH
 	{ "bench",	cmd_bench,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_STAT
 	{ "stat",	cmd_stat,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TIMECHART
 	{ "timechart",	cmd_timechart,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_TOP
 	{ "top",	cmd_top,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_ANNOTATE
 	{ "annotate",	cmd_annotate,	0 },
+#endif
 	{ "version",	cmd_version,	0 },
+#ifdef CONFIG_BUILTIN_SCRIPT
 	{ "script",	cmd_script,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
-#ifdef HAVE_LIBELF_SUPPORT
+#endif
+#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_KMEM
 	{ "kmem",	cmd_kmem,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_LOCK
 	{ "lock",	cmd_lock,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
+#endif
 	{ "test",	cmd_test,	0 },
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_INJECT
 	{ "inject",	cmd_inject,	0 },
+#endif
+#ifdef CONFIG_BUILTIN_MEM
 	{ "mem",	cmd_mem,	0 },
+#endif
 };
 
 struct pager_config {
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index ba51fa8..ec7fd36 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -77,11 +77,13 @@ void setup_browser(bool fallback_to_pager)
 		       PERF_GTK_DSO);
 		sleep(1);
 		/* fall through */
+#ifdef CONFIG_TUI
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
 		/* fall through */
+#endif
 	default:
 		use_browser = 0;
 		if (fallback_to_pager)
@@ -96,11 +98,11 @@ void exit_browser(bool wait_for_ok)
 	case 2:
 		exit_gtk_browser(wait_for_ok);
 		break;
-
+#ifdef CONFIG_TUI
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-
+#endif
 	default:
 		break;
 	}
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d..05ee30f 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+function cfg()
+{
+     cfg=`echo $1 | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
+     echo "$cfg"
+}
+
 echo "/* Automatically generated by $0 */
 struct cmdname_help
 {
@@ -13,6 +19,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -20,6 +27,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
@@ -27,6 +35,7 @@ sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
 sort |
 while read cmd
 do
+     echo "#ifdef CONFIG_BUILTIN_$(cfg $cmd)"
      sed -n '
      /^NAME/,/perf-'"$cmd"'/H
      ${
@@ -34,6 +43,7 @@ do
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
      }' "Documentation/perf-$cmd.txt"
+     echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
 echo "};"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 03/13] perf tools: Kbuild source related fixies
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (2 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 02/13] perf tools: Kbuild builtin source related fixies Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 04/13] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
                             ` (9 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, namhyung,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker,
	Borislav Petkov, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Fixing several sources config dependencies to allow
separate config builds.

This commit was originally created by Jiri Olsa in 2013. Minor changes
were needed to get it working one year later:
* Remove #ifdef directives related with GUI / TUI (because of code
  changes in ui/setup.c)
* Fix a link issue if the option BUILTIN_TRACE is disabled.
* Fix typo (CONFIG_BULTIN_ instead CONFIG_BUILTIN_)

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-annotate.c    |  6 +++---
 tools/perf/builtin-lock.c        |  5 ++++-
 tools/perf/builtin-report.c      |  2 +-
 tools/perf/builtin-sched.c       |  3 +++
 tools/perf/builtin-top.c         |  4 ++--
 tools/perf/perf.c                | 10 ++++++++--
 tools/perf/ui/browsers/scripts.c |  4 ++++
 tools/perf/ui/setup.c            |  6 +++---
 8 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index d40070f..aea56c5 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -154,7 +154,7 @@ find_next:
 
 			/* skip missing symbols */
 			nd = rb_next(nd);
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 		} else if (use_browser == 1) {
 			struct rb_node *next = NULL;
 			key = hist_entry__tui_annotate(he, evsel, NULL);
@@ -318,9 +318,9 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
-#endif /* CONFIG_TUI */
+#endif
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 6148afc..f5404dc 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "builtin-cmds.h"
 #include "perf.h"
 
 #include "util/evlist.h"
@@ -994,9 +995,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
 				usage_with_options(report_usage, report_options);
 		}
 		rc = __cmd_report(false);
+#ifdef CONFIG_BUILTIN_SCRIPT
 	} else if (!strcmp(argv[0], "script")) {
 		/* Aliased to 'perf script' */
-		return cmd_script(argc, argv, prefix);
+		rc = cmd_script(argc, argv, prefix);
+#endif
 	} else if (!strcmp(argv[0], "info")) {
 		if (argc) {
 			argc = parse_options(argc, argv,
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c97410a..8dc8077 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -392,7 +392,7 @@ static int report__browse_hists(struct report *rep)
 	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
 
 	switch (use_browser) {
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
 						    rep->min_percent,
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index c38d06c..80515e0 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "builtin-cmds.h"
 #include "perf.h"
 
 #include "util/util.h"
@@ -1739,11 +1740,13 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (!argc)
 		usage_with_options(sched_usage, sched_options);
 
+#ifdef CONFIG_BUILTIN_SCRIPT
 	/*
 	 * Aliased to 'perf script' for now:
 	 */
 	if (!strcmp(argv[0], "script"))
 		return cmd_script(argc, argv, prefix);
+#endif
 
 	symbol__init();
 	if (!strncmp(argv[0], "rec", 3)) {
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c668b0a..1c807c3 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -535,7 +535,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 	return ret;
 }
 
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 static void perf_top__sort_new_samples(void *arg)
 {
 	struct perf_top *t = arg;
@@ -958,7 +958,7 @@ static int __cmd_top(struct perf_top *top)
 
 	ret = -1;
 
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	if (use_browser > 0)
 		display_fn = display_thread_tui;
 #endif
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 8dd6f6f..b094379 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -92,8 +92,10 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_KVM
 	{ "kvm",	cmd_kvm,	0 },
 #endif
+#ifdef CONFIG_BUILTIN_TEST
 	{ "test",	cmd_test,	0 },
-#if defined HAVE_LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
+#endif
+#ifdef CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_INJECT
@@ -524,7 +526,7 @@ int main(int argc, const char **argv)
 		goto out;
 	}
 	if (!prefixcmp(cmd, "trace")) {
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#ifdef CONFIG_BUILTIN_TRACE
 		set_buildid_dir();
 		setup_path();
 		argv[0] = "trace";
@@ -548,13 +550,17 @@ int main(int argc, const char **argv)
 	} else {
 		/* The user didn't specify a command; give them help */
 		printf("\n usage: %s\n\n", perf_usage_string);
+#ifdef CONFIG_BUILTIN_HELP
 		list_common_cmds_help();
 		printf("\n %s\n\n", perf_more_info_string);
+#endif
 		goto out;
 	}
 	cmd = argv[0];
 
+#ifdef CONFIG_BUILTIN_TEST
 	test_attr__init();
+#endif
 
 	/*
 	 * We use PATH to find perf commands, but we prepend some higher
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index 402d2bd..128988d 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -59,7 +59,11 @@ static int list_scripts(char *script_name)
 		paths[i] = names[i] + SCRIPT_NAMELEN;
 	}
 
+#ifdef CONFIG_BUILTIN_SCRIPT
 	num = find_scripts(names, paths);
+#else
+	num = 0;
+#endif
 	if (num > 0) {
 		choice = ui__popup_menu(num, names);
 		if (choice < num && choice >= 0) {
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index ec7fd36..efc2b21 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -77,7 +77,7 @@ void setup_browser(bool fallback_to_pager)
 		       PERF_GTK_DSO);
 		sleep(1);
 		/* fall through */
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
@@ -92,13 +92,13 @@ void setup_browser(bool fallback_to_pager)
 	}
 }
 
-void exit_browser(bool wait_for_ok)
+void exit_browser(bool wait_for_ok __maybe_unused)
 {
 	switch (use_browser) {
 	case 2:
 		exit_gtk_browser(wait_for_ok);
 		break;
-#ifdef CONFIG_TUI
+#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 04/13] perf tools: Add kbuild support into Makefile.kbuild
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (3 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 03/13] perf tools: Kbuild " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 05/13] perf kbuild: remove Makefile.perf Alexis Berlemont
                             ` (8 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, dsahern, mingo, sam, mmarek, namhyung,
	Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Paul Mackerras, Corey Ashford, Frederic Weisbecker,
	Borislav Petkov, linux-kbuild, Stephane Eranian

From: Jiri Olsa <jolsa@redhat.com>

Adding kbuild support into Makefile.kbuild. The 'legacy'
Makefile still stays untouched as it was.

It's possible to use kbuild by running 'make -f Makefile.kbuild'
with any option supported by 'legacy' Makefile.

We now have 2 config files:
  '.config' - user configured setup
  '.config-detected' - system detected setup

The '.config-detected' affects '.config' and if there's
configured feature in '.config' which was not detected
it is automatically disabled.

The '.config-detected' is re/created if:
  - there's no '.config-detected'
  - '.config' was changed

In a cleaned tree the perf is built with 'allyesconfig'
having disabled all non-detected features, just as it is
done now.

You can change '.config' via:
  make -f Makefile.kbuild menuconfig

There's difference for O=DIR build. The DIR is populated
based on kernel source tree, so the final binary is created
under DIR/tools/perf.

This commit was originally created by Jiri Olsa in February 2013; a
few changes were necessary to fit the perf version of June 2014:
* Add missing CFLAGS for specific .o targets
* Update Kbuild files (new source files, ...)
* Fix recursive invocation of config/features-checks
* Store .config-detected missing variables (libdir, ...)
* Fix missing dependencies between Kconfig options
* Fix installation of traceevent plugins

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/Kbuild                                |  47 +++
 tools/perf/Kconfig                               | 284 ++++++++++++++++
 tools/perf/Makefile.kbuild                       | 410 +++++++++++++++++++++++
 tools/perf/Makefile.perf                         |   2 +-
 tools/perf/arch/Kbuild                           |   3 +
 tools/perf/arch/x86/Kbuild                       |   1 +
 tools/perf/arch/x86/util/Kbuild                  |   4 +
 tools/perf/bench/Kbuild                          |  12 +
 tools/perf/builtin-cmds.h                        |   4 +
 tools/perf/config/Makefile                       |  53 ++-
 tools/perf/config/Makefile.fix-config            | 104 ++++++
 tools/perf/config/Makefile.fix-legacy            |  46 +++
 tools/perf/config/defconfig                      |  54 +++
 tools/perf/perf-sys.h                            |   4 +-
 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild   |   6 +
 tools/perf/scripts/python/Perf-Trace-Util/Kbuild |   5 +
 tools/perf/tests/Kbuild                          |  39 +++
 tools/perf/ui/Kbuild                             |  15 +
 tools/perf/ui/browsers/Kbuild                    |   9 +
 tools/perf/ui/gtk/Kbuild                         |   9 +
 tools/perf/ui/stdio/Kbuild                       |   1 +
 tools/perf/ui/tui/Kbuild                         |   4 +
 tools/perf/util/Kbuild                           | 123 +++++++
 tools/perf/util/PERF-VERSION-GEN                 |   4 +
 tools/perf/util/generate-cmdlist.sh              |   8 +-
 tools/perf/util/scripting-engines/Kbuild         |  11 +
 tools/perf/util/setup.py                         |   8 +-
 27 files changed, 1260 insertions(+), 10 deletions(-)
 create mode 100644 tools/perf/Kbuild
 create mode 100644 tools/perf/Kconfig
 create mode 100644 tools/perf/Makefile.kbuild
 create mode 100644 tools/perf/arch/Kbuild
 create mode 100644 tools/perf/arch/x86/Kbuild
 create mode 100644 tools/perf/arch/x86/util/Kbuild
 create mode 100644 tools/perf/bench/Kbuild
 create mode 100644 tools/perf/config/Makefile.fix-config
 create mode 100644 tools/perf/config/Makefile.fix-legacy
 create mode 100644 tools/perf/config/defconfig
 create mode 100644 tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/scripts/python/Perf-Trace-Util/Kbuild
 create mode 100644 tools/perf/tests/Kbuild
 create mode 100644 tools/perf/ui/Kbuild
 create mode 100644 tools/perf/ui/browsers/Kbuild
 create mode 100644 tools/perf/ui/gtk/Kbuild
 create mode 100644 tools/perf/ui/stdio/Kbuild
 create mode 100644 tools/perf/ui/tui/Kbuild
 create mode 100644 tools/perf/util/Kbuild
 create mode 100644 tools/perf/util/scripting-engines/Kbuild

diff --git a/tools/perf/Kbuild b/tools/perf/Kbuild
new file mode 100644
index 0000000..16cb804
--- /dev/null
+++ b/tools/perf/Kbuild
@@ -0,0 +1,47 @@
+obj-y += perf.o
+
+obj-$(CONFIG_BUILTIN_ANNOTATE)      += builtin-annotate.o
+obj-$(CONFIG_BUILTIN_BENCH)         += builtin-bench.o
+obj-$(CONFIG_BUILTIN_BENCH)         += bench/
+obj-$(CONFIG_BUILTIN_BUILDID_CACHE) += builtin-buildid-cache.o
+obj-$(CONFIG_BUILTIN_BUILDID_LIST)  += builtin-buildid-list.o
+obj-$(CONFIG_BUILTIN_DIFF)          += builtin-diff.o
+obj-$(CONFIG_BUILTIN_EVLIST)        += builtin-evlist.o
+obj-$(CONFIG_BUILTIN_HELP)          += builtin-help.o
+obj-$(CONFIG_BUILTIN_INJECT)        += builtin-inject.o
+obj-$(CONFIG_BUILTIN_KMEM)          += builtin-kmem.o
+obj-$(CONFIG_BUILTIN_KVM)           += builtin-kvm.o
+obj-$(CONFIG_BUILTIN_LIST)          += builtin-list.o
+obj-$(CONFIG_BUILTIN_LOCK)          += builtin-lock.o
+obj-$(CONFIG_BUILTIN_PROBE)         += builtin-probe.o
+obj-$(CONFIG_BUILTIN_RECORD)        += builtin-record.o
+obj-$(CONFIG_BUILTIN_REPORT)        += builtin-report.o
+obj-$(CONFIG_BUILTIN_SCHED)         += builtin-sched.o
+obj-$(CONFIG_BUILTIN_SCRIPT)        += builtin-script.o
+obj-$(CONFIG_BUILTIN_STAT)          += builtin-stat.o
+obj-$(CONFIG_BUILTIN_TIMECHART)     += builtin-timechart.o
+obj-$(CONFIG_BUILTIN_TOP)           += builtin-top.o
+obj-$(CONFIG_BUILTIN_TRACE)         += builtin-trace.o
+obj-$(CONFIG_BUILTIN_MEM)           += builtin-mem.o
+obj-$(CONFIG_BUILTIN_TEST)          += tests/
+
+obj-y += ../../lib/rbtree.o
+obj-y += ../lib/symbol/kallsyms.o
+
+obj-y += util/
+obj-y += ui/
+obj-y += arch/
+
+obj-$(CONFIG_LIBPERL)   += scripts/perl/Perf-Trace-Util/
+obj-$(CONFIG_LIBPYTHON) += scripts/python/Perf-Trace-Util/
+
+CFLAGS_rbtree.o += -Wno-unused-parameter
+
+CFLAGS_perf.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_perf.o += -include PERF-VERSION-FILE
+
+$(obj)/perf.o: $(obj)/PERF-VERSION-FILE
+
+CFLAGS_builtin-help.o += -D"PERF_HTML_PATH=KBUILD_STR($(htmldir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_INFO_PATH=KBUILD_STR($(infodir_SQ))"
+CFLAGS_builtin-help.o += -D"PERF_MAN_PATH=KBUILD_STR($(mandir_SQ))"
diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
new file mode 100644
index 0000000..f9fcf9e
--- /dev/null
+++ b/tools/perf/Kconfig
@@ -0,0 +1,284 @@
+
+mainmenu "The perf configuration"
+
+menu "Built-in commands"
+
+config BUILTIN_RECORD
+	bool "record"
+	default y
+        ---help---
+	  Run a command and record its profile into a perf archive.
+
+config BUILTIN_REPORT
+	bool "report"
+	default y
+        ---help---
+	  Read a perf archive (created by perf record) and display the
+	  profile.
+
+config BUILTIN_STAT
+	bool "stat"
+	default y
+        ---help---
+	  Run a command and gather performance counter statistics.
+
+config BUILTIN_TOP
+	bool "top"
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
+        ---help---
+	  Generate and display a performance counter profile in
+	  real-time.
+
+config BUILTIN_TRACE
+	bool "trace"
+	default y
+	depends on BUILTIN_RECORD && LIBAUDIT
+        ---help---
+	  Strace inspired tool.
+
+config BUILTIN_ANNOTATE
+	bool "annotate"
+	default y
+        ---help---
+	  Read a perf archive (created by perf record) and display
+	  annotated code.
+
+config BUILTIN_BENCH
+	bool "bench"
+	default y
+        ---help---
+	  General framework for benchmark suites.
+
+config BUILTIN_BUILDID_CACHE
+	bool "buildid-cache"
+	default y
+        ---help---
+	  Manage build-id cache.
+
+config BUILTIN_BUILDID_LIST
+	bool "buildid-list"
+	default y
+        ---help---
+	  List the buildids in a perf archive file.
+
+config BUILTIN_DIFF
+	bool "diff"
+	default y
+        ---help---
+	  Read perf archive files and display the differential
+	  profile.
+
+config BUILTIN_EVLIST
+	bool "evlist"
+	default y
+        ---help---
+	  List the event names in a perf archive file
+
+config BUILTIN_HELP
+	bool "help"
+	default y
+        ---help---
+	  Display help information about perf
+
+config BUILTIN_INJECT
+	bool "inject"
+	default y
+        ---help---
+	  The inject feature reads a perf-record event stream and
+	  repipes it to stdout.
+
+config BUILTIN_KMEM
+	bool "kmem"
+	default y
+	depends on BUILTIN_RECORD
+        ---help---
+	  Tool to trace/measure kernel memory(slab) properties.
+
+config BUILTIN_KVM
+	bool "kvm"
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT && \
+		BUILTIN_RECORD && BUILTIN_BUILDID_LIST && \
+		BUILTIN_TOP && BUILTIN_DIFF && BUILTIN_STAT
+        ---help---
+	  Tool to trace/measure kvm guest os
+
+config BUILTIN_LIST
+	bool "list"
+	default y
+        ---help---
+	  List all symbolic event types.
+
+config BUILTIN_LOCK
+	bool "lock"
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
+        ---help---
+	  Analyze lock events.
+
+config BUILTIN_PROBE
+	bool "probe"
+	default y
+	depends on LIBELF
+        ---help---
+	  Define new dynamic tracepoints
+
+config BUILTIN_SCHED
+	bool "sched"
+	default y
+	depends on BUILTIN_RECORD
+        ---help---
+	  Tool to trace/measure scheduler properties (latencies).
+
+config BUILTIN_SCRIPT
+	bool "script"
+	default y
+	depends on BUILTIN_RECORD
+        ---help---
+	  Read perf archive file (created by perf record) and display
+	  trace output.
+
+config BUILTIN_TIMECHART
+	bool "timechart"
+	default y
+	depends on BUILTIN_RECORD
+        ---help---
+	  Tool to visualize total system behavior during a workload.
+
+config BUILTIN_MEM
+	bool "mem"
+	default y
+	depends on BUILTIN_RECORD && BUILTIN_REPORT
+        ---help---
+	  Profile memory accesses.
+
+config BUILTIN_TEST
+	bool "test"
+	default y
+        ---help---
+	  Runs sanity tests.
+
+endmenu
+
+menu "GUI"
+
+config STDIO
+	bool "Terminal"
+	default y
+        ---help---
+	  Most basic display mode.
+
+config TUI
+	bool "Tui (slang based)"
+	default y
+        ---help---
+	  Text-based user interface which provides windowing
+	  facilities.
+
+config GTK2
+	bool "Gtk2"
+	default y
+        ---help---
+	  Elaborate display mode based on libgtk2.
+
+endmenu
+
+menu "Libraries / Dependencies"
+
+config LIBAUDIT
+	bool "Audit (libaudit)"
+	default y
+        ---help---
+	  Linux audit framework dependency.
+
+config LIBPERL
+	bool "Perl"
+	default y
+        ---help---
+	  Libperl dependency needed by the perf script feature.
+
+config LIBPYTHON
+	bool "Python"
+	default y
+        ---help---
+	  Libpython dependency needed by the perf script feature.
+
+choice
+	prompt "Elf library"
+	default LIBELF
+        ---help---
+	  Perf needs ELF files manipulation facilities. To fulfill
+	  these tasks, perf can rely on either the libelf library or a
+	  minimal builtin support.
+
+
+	config LIBELF
+	bool "elf"
+	---help---
+	  Libelf library.
+
+	config LIBELF_MINIMAL
+	bool "builtin support"
+	---help---
+	  Builtin elf support.
+endchoice
+
+config LIBUNWIND
+	bool "User space libunwind callchains"
+	default y
+        ---help---
+	  The library libunwind provides a portable C API to determine
+	  the call-chain of a program.
+
+config LIBUNWIND_DIR
+	string "libunwind directory"
+	depends on LIBUNWIND
+        ---help---
+	  Directory holding the libuwind dependency (headers +
+	  libraries).
+
+config NUMA
+	bool "Numa support (bench)"
+	default y
+        ---help---
+	  The library libnuma offers facilities to configure NUMA
+	  policies supported by the linux kernel.
+
+config DEMANGLE
+	bool "Demangle symbols"
+	default y
+        ---help---
+	  Enable demangling so as to display human-readable
+	  symbols. This option is convenient with C++ programs.
+
+config BIONIC
+	bool "Bionic support"
+	default n
+        ---help---
+	  The Bionic libc is a derivation of the BSD's standard C
+	  library code developed by Google for their Android operating
+	  system.
+
+endmenu
+
+menu "Build"
+config DEBUG
+	bool "Compile with debug info"
+	default n
+        ---help---
+	  Compile with debug info.
+
+config DEBUG_PARSER
+	bool "Compile with parsers debug info"
+	default n
+        ---help---
+	  Compile with parsers debug info.
+
+config BACKTRACE
+	bool "Compile with dump_stack support"
+	default y
+        ---help---
+	  Compile with dump_stack support.
+
+endmenu
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
new file mode 100644
index 0000000..4f0aa34
--- /dev/null
+++ b/tools/perf/Makefile.kbuild
@@ -0,0 +1,410 @@
+srctree := $(abspath $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)/../../))
+objtree := $(abspath $(if $(KBUILD_SRC),$(CURDIR),$(CURDIR)/../..))
+
+VPATH   := $(srctree)
+
+export srctree VPATH
+
+MAKEFLAGS += --include-dir=$(srctree)
+MAKEFLAGS += --no-builtin-rules
+MAKEFLAGS += --no-print-directory
+
+ifeq ("$(origin V)", "command line")
+KBUILD_VERBOSE = $(V)
+endif
+
+ifndef KBUILD_VERBOSE
+KBUILD_VERBOSE = 0
+endif
+
+ifeq ($(KBUILD_VERBOSE),1)
+quiet =
+Q =
+else
+quiet=quiet_
+Q = @
+endif
+
+# If the user is running make -s (silent mode), suppress echoing of
+# commands
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+quiet=silent_
+endif
+
+export quiet Q KBUILD_VERBOSE
+
+ifndef V
+QUIET_LINK  = @echo '  LD      $@';
+QUIET_GEN   = @echo '  GEN     $@';
+QUIET_CLEAN = @echo '  CLEAN   tools/perf';
+endif
+
+export QUIET_BISON QUIET_FLEX
+
+ifeq ($(KBUILD_SRC),)
+
+ifeq ("$(origin O)", "command line")
+KBUILD_OUTPUT := $(O)
+else
+KBUILD_OUTPUT := $(objtree)
+endif
+
+# Invoke a second make in the output directory, passing relevant variables
+# check that the output directory actually exists
+saved-output := $(KBUILD_OUTPUT)
+KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+$(if $(KBUILD_OUTPUT),, \
+     $(error output directory "$(saved-output)" does not exist))
+
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/lib)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/include/config)
+dummy := $(shell mkdir -p $(KBUILD_OUTPUT)/tools/perf)
+
+PHONY += $(MAKECMDGOALS) sub-make
+
+$(filter-out sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) all: sub-make
+        @:
+
+sub-make: FORCE
+	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+	KBUILD_SRC=$(srctree) \
+	-f $(CURDIR)/Makefile.kbuild \
+	$(filter-out sub-make,$(MAKECMDGOALS))
+
+# Leave processing to above invocation of make
+skip-makefile := 1
+endif # ifeq ($(KBUILD_SRC),)
+
+export KBUILD_SRC
+
+ifeq ($(skip-makefile),)
+
+build := -f $(srctree)/scripts/Makefile.build obj
+
+src-kernel := $(srctree)
+src-perf   := $(srctree)/tools/perf
+obj-kernel := $(objtree)
+obj-perf   := $(objtree)/tools/perf
+
+VPATH += $(src-perf)
+
+export src-perf obj-perf
+
+OUTPUT := $(obj-perf)/
+
+export OUTPUT DESTDIR
+
+AS      = as
+LD      = ld
+CC      = gcc
+CPP     = $(CC) -E
+HOSTCC  = gcc
+FLEX    = flex
+BISON   = bison
+INSTALL = install
+PKG_CONFIG = pkg-config
+
+export AS LD CC CPP HOSTCC FLEX BISON PKG_CONFIG
+
+# kbuild related config
+CONFIG_SHELL          := /bin/sh
+
+KBUILD_KCONFIG        := $(src-perf)/Kconfig
+KCONFIG_CONFIG        ?= $(obj-perf)/.config
+KCONFIG_TRISTATE      := $(obj-perf)/include/config/tristate.conf
+KCONFIG_AUTOHEADER    := $(obj-perf)/include/generated/autoconf.h
+KCONFIG_AUTOCONFIG    := $(obj-perf)/include/config/auto.conf
+KCONFIG_SCRIPT        := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
+
+export CONFIG_SHELL
+export KBUILD_KCONFIG
+export KCONFIG_CONFIG KCONFIG_TRISTATE
+export KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG KCONFIG_SCRIPT
+
+# perf detected config
+CONFIG_DETECTED := $(obj-perf)/.config-detected
+
+export CONFIG_DETECTED
+
+# external .a libs
+LIBTRACEEVENT   := $(obj-kernel)/tools/lib/traceevent/libtraceevent.a
+LIBAPIKFS       := $(obj-kernel)/tools/lib/api/libapikfs.a
+LIBS_A          := $(LIBTRACEEVENT) $(LIBAPIKFS)
+
+export LIBTRACEEVENT LIBAPIKFS
+
+all:
+
+scripts_basic:
+	$(Q)$(MAKE) $(build)=scripts/basic
+
+defconfig: scripts_basic
+	$(Q)cp $(src-perf)/config/defconfig $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig oldconfig
+
+%config: scripts_basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig $@
+
+$(KCONFIG_CONFIG):
+	$(Q)$(MAKE) $(build)=scripts/basic
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig allyesconfig
+
+$(CONFIG_DETECTED): $(KCONFIG_CONFIG)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile
+
+# no need to include auto.conf.cmd, because .config
+# is the only dependency here
+$(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
+	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
+	$(Q)mkdir -p $(obj-perf)/include/config
+	$(Q)mkdir -p $(obj-perf)/include/generated
+	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
+	@touch $(CONFIG_DETECTED) # final touch.. to keep the time dependency correct
+
+clean-dirs := $(addprefix _clean_, tools/perf/)
+
+$(clean-dirs):
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
+
+clean: $(clean-dirs) $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean
+	$(Q)$(QUIET_CLEAN)
+	$(Q)rm -f $(obj-perf)/perf
+	$(Q)rm -f $(obj-perf)/common-cmds.h
+	$(Q)rm -f $(obj-perf)/python/perf.so
+	$(Q)rm -rf $(obj-perf)/include/generated $(obj-perf)/include/config
+	$(Q)find $(obj-perf) \
+		\( -name '*.[oas]' -o -name '.*.cmd' \
+		-o -name '.*.d' -o -name '.*.tmp' \
+		-o -name '*-flex.[ch]' -o -name '*-bison.[ch]' \
+		\) -type f -print | xargs rm -f
+	$(Q)$(python-clean)
+	$(Q)rm -f $(CONFIG_DETECTED) $(KCONFIG_CONFIG)
+
+TAGS tags:
+	$(Q)rm -f $(src-perf)/tags
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs ctags -a
+
+cscope:
+	$(Q)rm -f $(src-perf)/cscope*
+	$(QUIET_GEN)cd $(src-perf); find . -name '*.[hcS]' -print | xargs cscope -b
+
+PHONY += clean $(clean-dirs) tags TAGS cscope
+
+ifneq ($(filter %config help clean tags TAGS cscope,$(MAKECMDGOALS)),)
+dont-detect := 1
+endif
+
+ifndef dont-detect
+# detected config variables
+include $(CONFIG_DETECTED)
+
+# Following variables are needed within Kbuild files, we need
+# to export them as they are not part of the .config set.
+export CONFIG_ARCH := $(ARCH)
+export CONFIG_X86_64
+export htmldir_SQ
+export infodir_SQ
+export mandir_SQ
+export perfexecdir_SQ
+export prefix_SQ
+export PARSER_DEBUG_BISON
+export PARSER_DEBUG_FLEX
+export ETC_PERFCONFIG_SQ
+export libdir_SQ
+export plugindir_SQ
+export PYTHON_EMBED_CCOPTS
+export PERL_EMBED_CCOPTS
+export GTK_CFLAGS
+
+endif
+
+# let sources know it's kbuild
+CFLAGS += -DCONFIG_KBUILD
+
+# kbuild related config
+LINUXINCLUDE    := $(CFLAGS)
+KBUILD_BUILTIN  := 1
+KBUILD_CHECKSRC := 0
+
+export LINUXINCLUDE
+export KBUILD_BUILTIN KBUILD_CHECKSRC
+
+# pyuthon language binding
+PYTHON_EXTBUILD     := $(src-perf)/python_ext_build/
+PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
+PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
+
+export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
+
+python-clean := rm -rf $(PYTHON_EXTBUILD) $(obj-perf)/python/perf.so
+
+PYTHON_EXT_SRCS   := $(addprefix $(src-perf)/,$(shell grep -v ^\# $(src-perf)/util/python-ext-sources))
+PYTHON_EXT_DEPS   := $(src-perf)/util/python-ext-sources $(src-perf)/util/setup.py
+PYTHON_EXT_CFLAGS := $(CFLAGS) -w
+
+export PYTHON_EXT_SRCS
+
+
+$(obj-perf)/python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
+	$(QUIET_GEN)CFLAGS='$(PYTHON_EXT_CFLAGS)' $(PYTHON_WORD) $(src-perf)/util/setup.py \
+	  --quiet build_ext; \
+	mkdir -p $(obj-perf)/python && \
+	cp $(PYTHON_EXTBUILD_LIB)perf.so $(obj-perf)/python/
+
+all: tools/perf/PERF-VERSION-FILE scripts_basic $(KCONFIG_AUTOCONFIG) tools/perf/perf $(LANG_BINDINGS)
+
+$(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/command-list.txt
+	$(QUIET_GEN)$(src-perf)/util/generate-cmdlist.sh $(src-perf) > $@+ && mv $@+ $@
+
+PHONY += all scripts_basic
+
+$(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
+	$(Q)$(MAKE) $(build)=tools/perf
+
+LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+
+tools/perf/perf: $(obj-perf)/built-in.o $(LIBS_A)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(LIBS) $(GTK_LIBS)
+
+$(LIBTRACEEVENT): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -C $(src-kernel)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent
+
+$(LIBTRACEEVENT)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/traceevent
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent clean
+
+$(LIBTRACEEVENT)-install: $(LIBTRACEEVENT) FORCE
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/traceevent O=$(obj-kernel)/tools/lib/traceevent plugin_dir=$(plugindir_SQ) install
+
+$(LIBAPIKFS): FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -C $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api
+
+$(LIBAPIKFS)-clean: FORCE
+	@mkdir -p $(obj-kernel)/tools/lib/api
+	$(Q)$(MAKE) -sC $(srctree)/tools/lib/api O=$(obj-kernel)/tools/lib/api clean
+
+tools/perf/PERF-VERSION-FILE: FORCE
+	$(QUIET_GEN)$(SHELL_PATH) $(src-perf)/util/PERF-VERSION-GEN $(obj-perf)/
+
+
+# Single targets
+# ---------------------------------------------------------------------------
+# Single targets are compatible with:
+# - build with mixed source and output
+# - build with separate output dir 'make O=...'
+# - external modules
+#
+#  target-dir => where to store outputfile
+#  build-dir  => directory in kernel source tree to use
+
+build-dir  = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(patsubst %/,%,$(dir $@))))
+target-dir = $(patsubst $(obj-kernel)/%,%,$(abspath $(obj-perf)/$(dir $@)))
+
+%.o: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.i: %.c scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.s: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+%.o: %.S scripts_basic FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)/$(notdir $@)
+
+SCRIPT_SH += $(src-perf)/perf-archive.sh
+SCRIPTS    = $(patsubst %.sh,%,$(SCRIPT_SH))
+
+$(SCRIPTS) : % : %.sh
+	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(perf-obj)$@'
+
+all: $(SCRIPTS)
+
+install-bin: all
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) $(obj-perf)/perf '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) $(src-perf)/perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
+	$(INSTALL) $(src-perf)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
+	$(INSTALL) $(src-perf)/scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) $(src-perf)/scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
+	$(INSTALL) $(src-perf)/scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
+	$(INSTALL) $(src-perf)/scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
+	$(INSTALL) $(src-perf)/perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) $(src-perf)/tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+	$(INSTALL) $(src-perf)/tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
+
+install: install-bin try-install-man $(LIBTRACEEVENT)-install
+
+DOC_TARGETS := doc man html info pdf
+
+$(DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:doc=all)
+
+INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
+INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
+
+# 'make install-doc' should call 'make -C Documentation install'
+$(INSTALL_DOC_TARGETS):
+	$(Q)$(MAKE) -C $(src-perf)/Documentation $(@:-doc=)
+
+help:
+	@echo 'Perf make targets:'
+	@echo '  doc		- make *all* documentation (see below)'
+	@echo '  man		- make manpage documentation (access with man <foo>)'
+	@echo '  html		- make html documentation'
+	@echo '  info		- make GNU info documentation (access with info <foo>)'
+	@echo '  pdf		- make pdf documentation'
+	@echo '  TAGS		- use etags to make tag information for source browsing'
+	@echo '  tags		- use ctags to make tag information for source browsing'
+	@echo '  cscope	- use cscope to make interactive browsing database'
+	@echo ''
+	@echo 'Perf install targets:'
+	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
+	@echo '  HINT: use "make prefix=<path> <install target>" to install to a particular'
+	@echo '        path like make prefix=/usr/local install install-doc'
+	@echo '  install	- install compiled binaries'
+	@echo '  install-doc	- install *all* documentation'
+	@echo '  install-man	- install manpage documentation'
+	@echo '  install-html	- install html documentation'
+	@echo '  install-info	- install GNU info documentation'
+	@echo '  install-pdf	- install pdf documentation'
+	@echo ''
+	@echo '  quick-install-doc	- alias for quick-install-man'
+	@echo '  quick-install-man	- install the documentation quickly'
+	@echo '  quick-install-html	- install the html documentation quickly'
+	@echo ''
+	@echo 'Perf maintainer targets:'
+	@echo '  clean			- clean all binary objects and build output'
+
+
+ifdef MAKE_DEBUG
+dummy := $(info DEBUG MAKEFLAGS             $(MAKEFLAGS))
+dummy := $(info DEBUG VPATH                 $(VPATH))
+dummy := $(info DEBUG srctree               $(srctree))
+dummy := $(info DEBUG objtree               $(objtree))
+dummy := $(info DEBUG src-kernel            $(src-kernel))
+dummy := $(info DEBUG src-perf              $(src-perf))
+dummy := $(info DEBUG obj-kernel            $(obj-kernel))
+dummy := $(info DEBUG obj-perf              $(obj-perf))
+dummy := $(info DEBUG KBUILD_KCONFIG        $(KBUILD_KCONFIG))
+dummy := $(info DEBUG KCONFIG_CONFIG        $(KCONFIG_CONFIG))
+dummy := $(info DEBUG KCONFIG_TRISTATE      $(KCONFIG_TRISTATE))
+dummy := $(info DEBUG KCONFIG_AUTOHEADER    $(KCONFIG_AUTOHEADER))
+dummy := $(info DEBUG KCONFIG_AUTOCONFIG    $(KCONFIG_AUTOCONFIG))
+dummy := $(info DEBUG TRACE_EVENT_DIR       $(TRACE_EVENT_DIR))
+dummy := $(info DEBUG LIBAPIKFS             $(LIBAPIKFS))
+endif
+
+endif  # skip-makefile
+
+PHONY += FORCE
+.PHONY: $(PHONY)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 9670a16..a916c4e 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -611,7 +611,7 @@ $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPU
 $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
 
 $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
+	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
 
 $(SCRIPTS) : % : %.sh
 	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
diff --git a/tools/perf/arch/Kbuild b/tools/perf/arch/Kbuild
new file mode 100644
index 0000000..5cf419e
--- /dev/null
+++ b/tools/perf/arch/Kbuild
@@ -0,0 +1,3 @@
+obj-y += common.o
+
+obj-y += $(CONFIG_ARCH)/
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
new file mode 100644
index 0000000..52fd6fa
--- /dev/null
+++ b/tools/perf/arch/x86/Kbuild
@@ -0,0 +1 @@
+obj-y += util/
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
new file mode 100644
index 0000000..e033b94
--- /dev/null
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -0,0 +1,4 @@
+obj-y += dwarf-regs.o
+obj-y += header.o
+obj-y += tsc.o
+obj-$(CONFIG_LIBUNWIND) += unwind.o
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
new file mode 100644
index 0000000..e604fe2
--- /dev/null
+++ b/tools/perf/bench/Kbuild
@@ -0,0 +1,12 @@
+obj-y += mem-memcpy.o
+obj-y += mem-memset.o
+obj-y += sched-messaging.o
+obj-y += sched-pipe.o
+obj-y += futex-hash.o
+obj-y += futex-requeue.o
+obj-y += futex-wake.o
+
+obj-$(CONFIG_NUMA) += numa.o
+
+obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
+obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
index fec342a..49550c9 100644
--- a/tools/perf/builtin-cmds.h
+++ b/tools/perf/builtin-cmds.h
@@ -1,6 +1,7 @@
 #ifndef BUILTIN_CMDS_H
 #define BUILTIN_CMDS_H
 
+#ifndef CONFIG_KBUILD
 #define CONFIG_BUILTIN_REPORT 1
 #define CONFIG_BUILTIN_SCRIPT 1
 #define CONFIG_BUILTIN_BENCH 1
@@ -23,5 +24,8 @@
 #define CONFIG_BUILTIN_HELP 1
 #define CONFIG_BUILTIN_PROBE 1
 #define CONFIG_BUILTIN_MEM 1
+#else
+#include "generated/autoconf.h"
+#endif /* CONFIG_KBUILD */
 
 #endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f30ac5e..f67cc75 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -24,6 +24,7 @@ ifeq ($(ARCH),x86)
     CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
     ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
     LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+    CONFIG_X86_64=y
   else
     LIBUNWIND_LIBS = -lunwind -lunwind-x86
   endif
@@ -84,6 +85,10 @@ ifndef NO_LIBELF
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
 endif
 
+ifdef KCONFIG_CONFIG
+include $(src-perf)/config/Makefile.fix-legacy
+endif
+
 # include ARCH specific config
 -include $(src-perf)/arch/$(ARCH)/Makefile
 
@@ -136,7 +141,7 @@ endif
 
 feature_check = $(eval $(feature_check_code))
 define feature_check_code
-  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
+  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(src-perf)/config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
 endef
 
 feature_set = $(eval $(feature_set_code))
@@ -233,7 +238,7 @@ ifeq ($(feature-all), 1)
   #
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
 else
-  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
+  $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C $(src-perf)/config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
   $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
 endif
 
@@ -248,6 +253,7 @@ ifeq ($(DEBUG),0)
 endif
 
 CFLAGS += -I$(src-perf)/util/include
+CFLAGS += -I$(obj-perf)/include
 CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
 CFLAGS += -I$(srctree)/tools/include/
 CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
@@ -736,3 +742,46 @@ endif
 ifeq ($(display_lib),1)
   $(info )
 endif
+
+ifdef CONFIG_DETECTED
+
+store = @echo "$(1)=$($(1))" >> $(CONFIG_DETECTED)
+
+all:
+	$(call store,ARCH)
+	$(call store,CFLAGS)
+	$(call store,LDFLAGS)
+	$(call store,EXTLIBS)
+	$(call store,htmldir_SQ)
+	$(call store,infodir_SQ)
+	$(call store,mandir_SQ)
+	$(call store,perfexecdir_SQ)
+	$(call store,prefix_SQ)
+	$(call store,PARSER_DEBUG_BISON)
+	$(call store,PARSER_DEBUG_FLEX)
+	$(call store,PYTHON_EMBED_CCOPTS)
+	$(call store,PERL_EMBED_CCOPTS)
+	$(call store,CONFIG_X86_64)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_LIBPERL)
+	$(call store,NO_LIBPYTHON)
+	$(call store,NO_NEWT)
+	$(call store,NO_GTK2)
+	$(call store,NO_DEMANGLE)
+	$(call store,NO_LIBELF)
+	$(call store,NO_LIBUNWIND)
+	$(call store,NO_BACKTRACE)
+	$(call store,NO_LIBNUMA)
+	$(call store,NO_LIBAUDIT)
+	$(call store,NO_LIBBIONIC)
+	$(call store,ETC_PERFCONFIG_SQ)
+	$(call store,DESTDIR_SQ)
+	$(call store,bindir_SQ)
+	$(call store,libdir_SQ)
+	$(call store,plugindir_SQ)
+	$(call store,perfexec_instdir_SQ)
+	$(call store,sysconfdir_SQ)
+	$(call store,GTK_CFLAGS)
+	$(call store,GTK_LIBS)
+
+endif # CONFIG_DETECTED
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
new file mode 100644
index 0000000..7f65fdb
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-config
@@ -0,0 +1,104 @@
+include $(CONFIG_DETECTED)
+include $(KCONFIG_CONFIG)
+
+CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
+
+# NO_LIBPERL
+ifdef CONFIG_LIBPERL
+ifdef NO_LIBPERL
+dummy := $(info Disabling CONFIG_LIBPERL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
+endif
+endif
+
+# NO_LIBPYTHON
+ifdef CONFIG_LIBPYTHON
+ifdef NO_LIBPYTHON
+dummy := $(info Disabling CONFIG_LIBPYTHON)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_NEWT
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_NEWT
+ifdef CONFIG_TUI
+ifdef NO_SLANG
+dummy := $(info Disabling CONFIG_TUI)
+dummy := $(shell $(CONFIG) -d CONFIG_TUI)
+endif
+endif
+
+# NO_GTK2
+ifdef CONFIG_GTK2
+ifdef NO_GTK2
+dummy := $(info Disabling CONFIG_GTK2)
+dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
+endif
+endif
+
+# NO_DEMANGLE
+ifdef CONFIG_DEMANGLE
+ifdef NO_DEMANGLE
+dummy := $(info Disabling CONFIG_DEMANGLE)
+dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
+endif
+endif
+
+# NO_LIBELF
+ifdef CONFIG_LIBELF
+ifdef NO_LIBELF
+dummy := $(info Disabling CONFIG_LIBELF)
+dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
+dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
+endif
+endif
+
+# NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
+ifdef NO_LIBUNWIND
+dummy := $(info Disabling CONFIG_LIBUNWIND)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
+endif
+endif
+
+# NO_BACKTRACE
+ifdef CONFIG_BACKTRACE
+ifdef NO_BACKTRACE
+dummy := $(info Disabling CONFIG_BACKTRACE)
+dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
+endif
+endif
+
+# NO_LIBNUMA
+ifdef CONFIG_NUMA
+ifdef NO_LIBNUMA
+dummy := $(info Disabling CONFIG_NUMA)
+dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
+endif
+endif
+
+# NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
+ifdef NO_LIBAUDIT
+dummy := $(info Disabling CONFIG_LIBAUDIT)
+dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
+endif
+endif
+
+# NO_LIBBIONIC
+ifdef CONFIG_BIONIC
+ifdef NO_LIBBIONIC
+dummy := $(info Disabling CONFIG_BIONIC)
+dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
+endif
+endif
+
+all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
new file mode 100644
index 0000000..2ec91f3
--- /dev/null
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -0,0 +1,46 @@
+
+include $(KCONFIG_CONFIG)
+
+ifndef CONFIG_LIBPERL
+NO_LIBPERL := 1
+endif
+
+ifndef CONFIG_LIBPYTHON
+NO_LIBPYTHON := 1
+endif
+
+ifndef CONFIG_TUI
+NO_SLANG := 1
+endif
+
+ifndef CONFIG_GTK2
+NO_GTK2 := 1
+endif
+
+ifndef CONFIG_DEMANGLE
+NO_DEMANGLE := 1
+endif
+
+ifndef CONFIG_LIBELF
+NO_LIBELF := 1
+endif
+
+ifndef CONFIG_LIBUNWIND
+NO_LIBUNWIND := 1
+endif
+
+ifndef CONFIG_BACKTRACE
+NO_BACKTRACE := 1
+endif
+
+ifndef CONFIG_NUMA
+export NO_LIBNUMA := 1
+endif
+
+ifndef CONFIG_LIBAUDIT
+NO_LIBAUDIT := 1
+endif
+
+ifdef CONFIG_BIONIC
+NO_LIBBIONIC := 1
+endif
diff --git a/tools/perf/config/defconfig b/tools/perf/config/defconfig
new file mode 100644
index 0000000..7a385f1
--- /dev/null
+++ b/tools/perf/config/defconfig
@@ -0,0 +1,54 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux Kernel Configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+# CONFIG_BUILTIN_ANNOTATE is not set
+# CONFIG_BUILTIN_BENCH is not set
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+# CONFIG_BUILTIN_KMEM is not set
+# CONFIG_BUILTIN_KVM is not set
+# CONFIG_BUILTIN_LIST is not set
+# CONFIG_BUILTIN_LOCK is not set
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# Libraries
+#
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_BACKTRACE=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_NUMA is not set
+# CONFIG_DEMANGLE is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+# CONFIG_GTK2 is not set
+
+#
+# Build
+#
+CONFIG_DEBUG=y
+# CONFIG_DEBUG_PARSER is not set
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index 5268a14..95cf2fd 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -8,6 +8,8 @@
 #include <linux/perf_event.h>
 #include <asm/unistd.h>
 
+#include "generated/autoconf.h"
+
 #if defined(__i386__)
 #define mb()		asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
 #define wmb()		asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
@@ -180,7 +182,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
+#ifdef CONFIG_BUILTIN_TEST
 	if (unlikely(test_attr__enabled))
 		test_attr__open(attr, pid, cpu, fd, group_fd, flags);
 #endif
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..fd9aa3c
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Kbuild
@@ -0,0 +1,6 @@
+obj-y += Context.o
+
+CFLAGS_Context.o := $(PERL_EMBED_CCOPTS)
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs
+CFLAGS_Context.o += -Wno-undef -Wno-switch-default
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Kbuild b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
new file mode 100644
index 0000000..7884730
--- /dev/null
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Kbuild
@@ -0,0 +1,5 @@
+obj-y += Context.o
+
+CFLAGS_Context.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_Context.o += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs
diff --git a/tools/perf/tests/Kbuild b/tools/perf/tests/Kbuild
new file mode 100644
index 0000000..ac26996
--- /dev/null
+++ b/tools/perf/tests/Kbuild
@@ -0,0 +1,39 @@
+obj-y += builtin-test.o
+obj-y += attr.o
+obj-y += dso-data.o
+obj-y += evsel-roundtrip-name.o
+obj-y += evsel-tp-sched.o
+obj-y += hists_link.o
+obj-y += mmap-basic.o
+obj-y += open-syscall-all-cpus.o
+obj-y += open-syscall.o
+obj-y += open-syscall-tp-fields.o
+obj-y += parse-events.o
+obj-y += perf-record.o
+obj-y += pmu.o
+obj-y += python-use.o
+obj-y += rdpmc.o
+obj-y += vmlinux-kallsyms.o
+obj-y += bp_signal.o
+obj-y += bp_signal_overflow.o
+obj-y += sw-clock.o
+obj-y += task-exit.o
+obj-y += code-reading.o
+obj-y += sample-parsing.o
+obj-y += keep-tracking.o
+obj-y += parse-no-sample-id-all.o
+obj-y += mmap-thread-lookup.o
+obj-y += thread-mg-share.o
+obj-y += hists_output.o
+obj-y += hists_cumulate.o
+obj-y += hists_common.o
+obj-y += hists_filter.o
+
+# TODO: this should only be included if arch = x86
+obj-y += perf-time-to-tsc.o
+
+CFLAGS_python-use.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_python-use.o += -D"PYTHONPATH=KBUILD_STR(python)"
+
+CFLAGS_attr.o += -D"PYTHON=KBUILD_STR($(PYTHON_WORD))"
+CFLAGS_attr.o += -D"BINDIR=KBUILD_STR($(bindir_SQ))"
diff --git a/tools/perf/ui/Kbuild b/tools/perf/ui/Kbuild
new file mode 100644
index 0000000..44ad988
--- /dev/null
+++ b/tools/perf/ui/Kbuild
@@ -0,0 +1,15 @@
+obj-$(CONFIG_TUI) += browser.o
+obj-y += helpline.o
+obj-y += hist.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
+
+obj-y += browsers/
+obj-y += stdio/
+
+obj-$(CONFIG_TUI)  += tui/
+obj-$(CONFIG_GTK2) += gtk/
+
+CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_setup.o += -D"LIBDIR=KBUILD_STR($(libdir_SQ))"
\ No newline at end of file
diff --git a/tools/perf/ui/browsers/Kbuild b/tools/perf/ui/browsers/Kbuild
new file mode 100644
index 0000000..3a5fd55
--- /dev/null
+++ b/tools/perf/ui/browsers/Kbuild
@@ -0,0 +1,9 @@
+obj-$(CONFIG_TUI) += annotate.o
+obj-$(CONFIG_TUI) += header.o
+obj-$(CONFIG_TUI) += hists.o
+obj-$(CONFIG_TUI) += map.o
+obj-$(CONFIG_TUI) += scripts.o
+
+CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_map.o += -DENABLE_SLFUTURE_CONST
+CFLAGS_scripts.o += -DENABLE_SLFUTURE_CONST
diff --git a/tools/perf/ui/gtk/Kbuild b/tools/perf/ui/gtk/Kbuild
new file mode 100644
index 0000000..83e3e58
--- /dev/null
+++ b/tools/perf/ui/gtk/Kbuild
@@ -0,0 +1,9 @@
+obj-y += browser.o
+obj-y += hists.o
+obj-y += setup.o
+obj-y += util.o
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += annotate.o
+
+subdir-ccflags-y := $(GTK_CFLAGS)
\ No newline at end of file
diff --git a/tools/perf/ui/stdio/Kbuild b/tools/perf/ui/stdio/Kbuild
new file mode 100644
index 0000000..9de4bd9
--- /dev/null
+++ b/tools/perf/ui/stdio/Kbuild
@@ -0,0 +1 @@
+obj-y += hist.o
diff --git a/tools/perf/ui/tui/Kbuild b/tools/perf/ui/tui/Kbuild
new file mode 100644
index 0000000..e282409
--- /dev/null
+++ b/tools/perf/ui/tui/Kbuild
@@ -0,0 +1,4 @@
+obj-y += helpline.o
+obj-y += progress.o
+obj-y += setup.o
+obj-y += util.o
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
new file mode 100644
index 0000000..4ddd43d
--- /dev/null
+++ b/tools/perf/util/Kbuild
@@ -0,0 +1,123 @@
+obj-y += abspath.o
+obj-y += alias.o
+obj-y += annotate.o
+obj-y += bitmap.o
+obj-y += build-id.o
+obj-y += callchain.o
+obj-y += cgroup.o
+obj-y += color.o
+obj-y += comm.o
+obj-y += config.o
+obj-y += cpumap.o
+obj-y += ctype.o
+obj-y += debug.o
+obj-y += dso.o
+obj-y += environment.o
+obj-y += event.o
+obj-y += evlist.o
+obj-y += evsel.o
+obj-y += exec_cmd.o
+obj-y += header.o
+obj-y += help.o
+obj-y += hist.o
+obj-y += hweight.o
+obj-y += intlist.o
+obj-y += levenshtein.o
+obj-y += machine.o
+obj-y += map.o
+obj-y += pager.o
+obj-y += parse-options.o
+obj-y += path.o
+obj-y += pmu-flex.o
+obj-y += pmu-bison.o
+obj-y += pmu.o
+obj-y += pstack.o
+obj-y += quote.o
+obj-y += rblist.o
+obj-y += run-command.o
+obj-y += session.o
+obj-y += sigchain.o
+obj-y += sort.o
+obj-y += stat.o
+obj-y += record.o
+obj-y += srcline.o
+obj-y += data.o
+obj-y += strbuf.o
+obj-y += strfilter.o
+obj-y += string.o
+obj-y += strlist.o
+obj-y += svghelper.o
+obj-y += symbol.o
+obj-y += perf_regs.o
+
+
+obj-$(CONFIG_LIBUNWIND) += unwind.o
+
+obj-$(CONFIG_LIBELF) += symbol-elf.o
+obj-$(CONFIG_LIBELF) += dwarf-aux.o
+obj-$(CONFIG_LIBELF) += probe-event.o
+obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
+
+obj-y += target.o
+obj-y += thread.o
+obj-y += thread_map.o
+obj-y += top.o
+obj-y += usage.o
+obj-y += util.o
+obj-y += values.o
+obj-y += xyarray.o
+obj-y += vdso.o
+obj-y += wrapper.o
+obj-y += trace-event.o
+obj-y += trace-event-info.o
+obj-y += trace-event-parse.o
+obj-$(CONFIG_BUILTIN_SCRIPT) += trace-event-scripting.o
+obj-y += trace-event-read.o
+
+obj-$(CONFIG_BUILTIN_SCRIPT) += scripting-engines/
+
+define bison
+$(Q)echo '  BI      $@'
+$(Q)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) -o $@ -p $1
+endef
+
+define flex
+$(Q)echo '  FL      $@';
+$(Q)$(FLEX) --header-file=$(basename $@).h $(PARSER_DEBUG_FLEX) -t $< > $@
+endef
+
+obj-y += parse-events-flex.o
+obj-y += parse-events-bison.o
+obj-y += parse-events.o
+
+$(obj)/parse-events-bison.c: $(src)/parse-events.y
+	$(call bison,parse_events_)
+
+$(obj)/parse-events-flex.c: $(src)/parse-events.l $(obj)/parse-events-bison.c
+	$(call flex)
+
+$(src)/parse-events-flex.o: $(src)/parse-events-flex.c
+$(src)/parse-events-bison.o: $(src)/parse-events-bison.c
+
+$(src)/parse-events.o: $(src)/parse-events-flex.o
+
+$(src)/pmu-bison.c: $(src)/pmu.y
+	$(call bison,perf_pmu_)
+
+$(src)/pmu-flex.c: $(src)/pmu.l $(src)/pmu-bison.c
+	$(call flex)
+
+$(src)/pmu-flex.o: $(src)/pmu-flex.c
+$(src)/pmu-bison.o: $(src)/pmu-bison.c
+
+CFLAGS_parse-events-flex.o  += -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events.o  += -Wno-redundant-decls
+CFLAGS_pmu-flex.o  += -w
+CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+
+CFLAGS_config.o += -D"ETC_PERFCONFIG=KBUILD_STR($(ETC_PERFCONFIG_SQ))"
+CFLAGS_exec_cmd.o += -D"PERF_EXEC_PATH=KBUILD_STR($(perfexecdir_SQ))"
+CFLAGS_exec_cmd.o += -D"PREFIX=KBUILD_STR($(prefix_SQ))"
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 39f1750..efb74f0 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -9,6 +9,10 @@ GVF=${OUTPUT}PERF-VERSION-FILE
 LF='
 '
 
+if [ "${srctree}x" = "x" ]; then
+srctree=../..
+fi
+
 #
 # First check if there is a .git to get the version from git describe
 # otherwise try to get the version from the kernel Makefile
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 05ee30f..5d84ffc 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -15,7 +15,7 @@ struct cmdname_help
 
 static struct cmdname_help common_cmds[] = {"
 
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -26,12 +26,12 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 
 echo "#ifdef HAVE_LIBELF_SUPPORT"
-sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' command-list.txt |
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
 do
@@ -42,7 +42,7 @@ do
             x
             s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
 	    p
-     }' "Documentation/perf-$cmd.txt"
+     }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
diff --git a/tools/perf/util/scripting-engines/Kbuild b/tools/perf/util/scripting-engines/Kbuild
new file mode 100644
index 0000000..ebe216c
--- /dev/null
+++ b/tools/perf/util/scripting-engines/Kbuild
@@ -0,0 +1,11 @@
+obj-$(CONFIG_LIBPERL)   += trace-event-perl.o
+obj-$(CONFIG_LIBPYTHON) += trace-event-python.o
+
+CFLAGS_trace-event-perl.o   := $(PERL_EMBED_CCOPTS)
+CFLAGS_trace-event-perl.o   += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_trace-event-perl.o   += -Wno-unused-parameter -Wno-shadow -Wno-undef
+CFLAGS_trace-event-perl.o   += -Wno-switch-default
+
+CFLAGS_trace-event-python.o := $(PYTHON_EMBED_CCOPTS)
+CFLAGS_trace-event-python.o += -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_trace-event-python.o += -Wno-unused-parameter -Wno-shadow
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index d0aee4b..a5c73de 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -2,6 +2,7 @@
 
 from distutils.core import setup, Extension
 from os import getenv
+from os import environ
 
 from distutils.command.build_ext   import build_ext   as _build_ext
 from distutils.command.install_lib import install_lib as _install_lib
@@ -27,8 +28,11 @@ build_tmp = getenv('PYTHON_EXTBUILD_TMP')
 libtraceevent = getenv('LIBTRACEEVENT')
 libapikfs = getenv('LIBAPIKFS')
 
-ext_sources = [f.strip() for f in file('util/python-ext-sources')
-				if len(f.strip()) > 0 and f[0] != '#']
+if environ.has_key('PYTHON_EXT_SRCS'):
+    ext_sources = getenv('PYTHON_EXT_SRCS').split()
+else:
+    ext_sources = [f.strip() for f in file('util/python-ext-sources')
+                                   if len(f.strip()) > 0 and f[0] != '#']
 
 perf = Extension('perf',
 		  sources = ext_sources,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 05/13] perf kbuild: remove Makefile.perf
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (4 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 04/13] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 06/13] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
                             ` (7 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

The file Makefile.perf contained legacy build rules. It is replaced by
Makefile.kbuild which relies on Kbuild. Consequently, some minor
points need updates:
* The constant CONFIG_KBUILD can be removed
* The main Makefile wrapper now call Makefile.kbuild instead of
  Makefile.perf
---
 tools/perf/Makefile           |   2 +-
 tools/perf/Makefile.kbuild    |   2 +-
 tools/perf/Makefile.perf      | 938 ------------------------------------------
 tools/perf/builtin-annotate.c |   4 +-
 tools/perf/builtin-cmds.h     |  25 --
 tools/perf/builtin-report.c   |   2 +-
 tools/perf/builtin-top.c      |   4 +-
 tools/perf/ui/setup.c         |   4 +-
 8 files changed, 9 insertions(+), 972 deletions(-)
 delete mode 100644 tools/perf/Makefile.perf

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index cb2e586..4512f16 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -55,7 +55,7 @@ define print_msg
 endef
 
 define make
-  @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
+  @$(MAKE) -f Makefile.kbuild --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
 endef
 
 #
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 4f0aa34..7b7641c 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -43,7 +43,7 @@ export QUIET_BISON QUIET_FLEX
 
 ifeq ($(KBUILD_SRC),)
 
-ifeq ("$(origin O)", "command line")
+ifneq ($(O),)
 KBUILD_OUTPUT := $(O)
 else
 KBUILD_OUTPUT := $(objtree)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
deleted file mode 100644
index a916c4e..0000000
--- a/tools/perf/Makefile.perf
+++ /dev/null
@@ -1,938 +0,0 @@
-include ../scripts/Makefile.include
-
-# The default target of this Makefile is...
-all:
-
-include config/utilities.mak
-
-# Define V to have a more verbose compile.
-#
-# Define VF to have a more verbose feature check output.
-#
-# Define O to save output files in a separate directory.
-#
-# Define ARCH as name of target architecture if you want cross-builds.
-#
-# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
-#
-# Define NO_LIBPERL to disable perl script extension.
-#
-# Define NO_LIBPYTHON to disable python script extension.
-#
-# Define PYTHON to point to the python binary if the default
-# `python' is not correct; for example: PYTHON=python2
-#
-# Define PYTHON_CONFIG to point to the python-config binary if
-# the default `$(PYTHON)-config' is not correct.
-#
-# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
-#
-# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
-#
-# Define LDFLAGS=-static to build a static binary.
-#
-# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
-#
-# Define NO_DWARF if you do not want debug-info analysis feature at all.
-#
-# Define WERROR=0 to disable treating any warnings as errors.
-#
-# Define NO_NEWT if you do not want TUI support. (deprecated)
-#
-# Define NO_SLANG if you do not want TUI support.
-#
-# Define NO_GTK2 if you do not want GTK+ GUI support.
-#
-# Define NO_DEMANGLE if you do not want C++ symbol demangling.
-#
-# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
-#
-# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
-# backtrace post unwind.
-#
-# Define NO_BACKTRACE if you do not want stack backtrace debug feature
-#
-# Define NO_LIBNUMA if you do not want numa perf benchmark
-#
-# Define NO_LIBAUDIT if you do not want libaudit support
-#
-# Define NO_LIBBIONIC if you do not want bionic support
-#
-# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
-# for dwarf backtrace post unwind.
-
-ifeq ($(srctree),)
-srctree := $(patsubst %/,%,$(dir $(shell pwd)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
-#$(info Determined 'srctree' to be $(srctree))
-endif
-
-ifneq ($(objtree),)
-#$(info Determined 'objtree' to be $(objtree))
-endif
-
-ifneq ($(OUTPUT),)
-#$(info Determined 'OUTPUT' to be $(OUTPUT))
-endif
-
-$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
-	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
-	@touch $(OUTPUT)PERF-VERSION-FILE
-
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-PKG_CONFIG = $(CROSS_COMPILE)pkg-config
-
-RM      = rm -f
-LN      = ln -f
-MKDIR   = mkdir
-FIND    = find
-INSTALL = install
-FLEX    = flex
-BISON   = bison
-STRIP   = strip
-
-LIB_DIR          = $(srctree)/tools/lib/api/
-TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
-
-# include config/Makefile by default and rule out
-# non-config cases
-config := 1
-
-NON_CONFIG_TARGETS := clean TAGS tags cscope help
-
-ifdef MAKECMDGOALS
-ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
-  config := 0
-endif
-endif
-
-ifeq ($(config),1)
-include config/Makefile
-endif
-
-export prefix bindir sharedir sysconfdir DESTDIR
-
-# sparse is architecture-neutral, which means that we need to tell it
-# explicitly what architecture to check for. Fix this up for yours..
-SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
-
-# Guard against environment variables
-BUILTIN_OBJS =
-LIB_H =
-LIB_OBJS =
-GTK_OBJS =
-PYRF_OBJS =
-SCRIPT_SH =
-
-SCRIPT_SH += perf-archive.sh
-
-grep-libs = $(filter -l%,$(1))
-strip-libs = $(filter-out -l%,$(1))
-
-ifneq ($(OUTPUT),)
-  TE_PATH=$(OUTPUT)
-ifneq ($(subdir),)
-  LIB_PATH=$(OUTPUT)/../lib/api/
-else
-  LIB_PATH=$(OUTPUT)
-endif
-else
-  TE_PATH=$(TRACE_EVENT_DIR)
-  LIB_PATH=$(LIB_DIR)
-endif
-
-LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
-export LIBTRACEEVENT
-
-LIBAPIKFS = $(LIB_PATH)libapikfs.a
-export LIBAPIKFS
-
-# python extension build directories
-PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
-PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
-PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
-export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
-
-python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
-
-PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
-PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPIKFS)
-
-$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
-	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
-	  --quiet build_ext; \
-	mkdir -p $(OUTPUT)python && \
-	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
-#
-# No Perl scripts right now:
-#
-
-SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
-
-#
-# Single 'perf' binary right now:
-#
-PROGRAMS += $(OUTPUT)perf
-
-# what 'all' will build and 'install' will install, in perfexecdir
-ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
-
-# what 'all' will build but not install in perfexecdir
-OTHER_PROGRAMS = $(OUTPUT)perf
-
-# Set paths to tools early so that they can be used for version tests.
-ifndef SHELL_PATH
-  SHELL_PATH = /bin/sh
-endif
-ifndef PERL_PATH
-  PERL_PATH = /usr/bin/perl
-endif
-
-export PERL_PATH
-
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
-
-$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
-	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
-
-$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
-	$(QUIET_FLEX)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
-
-$(OUTPUT)util/pmu-bison.c: util/pmu.y
-	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
-
-$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
-$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
-
-LIB_FILE=$(OUTPUT)libperf.a
-
-LIB_H += ../lib/symbol/kallsyms.h
-LIB_H += ../../include/uapi/linux/perf_event.h
-LIB_H += ../../include/linux/rbtree.h
-LIB_H += ../../include/linux/list.h
-LIB_H += ../../include/uapi/linux/const.h
-LIB_H += ../include/linux/hash.h
-LIB_H += ../../include/linux/stringify.h
-LIB_H += util/include/linux/bitmap.h
-LIB_H += util/include/linux/bitops.h
-LIB_H += ../include/linux/compiler.h
-LIB_H += util/include/linux/const.h
-LIB_H += util/include/linux/ctype.h
-LIB_H += util/include/linux/kernel.h
-LIB_H += util/include/linux/list.h
-LIB_H += ../include/linux/export.h
-LIB_H += util/include/linux/poison.h
-LIB_H += util/include/linux/rbtree.h
-LIB_H += util/include/linux/rbtree_augmented.h
-LIB_H += util/include/linux/string.h
-LIB_H += ../include/linux/types.h
-LIB_H += util/include/linux/linkage.h
-LIB_H += util/include/asm/asm-offsets.h
-LIB_H += ../include/asm/bug.h
-LIB_H += util/include/asm/byteorder.h
-LIB_H += util/include/asm/hweight.h
-LIB_H += util/include/asm/swab.h
-LIB_H += util/include/asm/system.h
-LIB_H += util/include/asm/uaccess.h
-LIB_H += util/include/dwarf-regs.h
-LIB_H += util/include/asm/dwarf2.h
-LIB_H += util/include/asm/cpufeature.h
-LIB_H += util/include/asm/unistd_32.h
-LIB_H += util/include/asm/unistd_64.h
-LIB_H += perf.h
-LIB_H += util/annotate.h
-LIB_H += util/cache.h
-LIB_H += util/callchain.h
-LIB_H += util/build-id.h
-LIB_H += util/debug.h
-LIB_H += util/pmu.h
-LIB_H += util/event.h
-LIB_H += util/evsel.h
-LIB_H += util/evlist.h
-LIB_H += util/exec_cmd.h
-LIB_H += util/levenshtein.h
-LIB_H += util/machine.h
-LIB_H += util/map.h
-LIB_H += util/parse-options.h
-LIB_H += util/parse-events.h
-LIB_H += util/quote.h
-LIB_H += util/util.h
-LIB_H += util/xyarray.h
-LIB_H += util/header.h
-LIB_H += util/help.h
-LIB_H += util/session.h
-LIB_H += util/strbuf.h
-LIB_H += util/strlist.h
-LIB_H += util/strfilter.h
-LIB_H += util/svghelper.h
-LIB_H += util/tool.h
-LIB_H += util/run-command.h
-LIB_H += util/sigchain.h
-LIB_H += util/dso.h
-LIB_H += util/symbol.h
-LIB_H += util/color.h
-LIB_H += util/values.h
-LIB_H += util/sort.h
-LIB_H += util/hist.h
-LIB_H += util/comm.h
-LIB_H += util/thread.h
-LIB_H += util/thread_map.h
-LIB_H += util/trace-event.h
-LIB_H += util/probe-finder.h
-LIB_H += util/dwarf-aux.h
-LIB_H += util/probe-event.h
-LIB_H += util/pstack.h
-LIB_H += util/cpumap.h
-LIB_H += util/top.h
-LIB_H += $(ARCH_INCLUDE)
-LIB_H += util/cgroup.h
-LIB_H += $(LIB_INCLUDE)traceevent/event-parse.h
-LIB_H += util/target.h
-LIB_H += util/rblist.h
-LIB_H += util/intlist.h
-LIB_H += util/perf_regs.h
-LIB_H += util/unwind.h
-LIB_H += util/vdso.h
-LIB_H += ui/helpline.h
-LIB_H += ui/progress.h
-LIB_H += ui/util.h
-LIB_H += ui/ui.h
-LIB_H += util/data.h
-
-LIB_OBJS += $(OUTPUT)util/abspath.o
-LIB_OBJS += $(OUTPUT)util/alias.o
-LIB_OBJS += $(OUTPUT)util/annotate.o
-LIB_OBJS += $(OUTPUT)util/build-id.o
-LIB_OBJS += $(OUTPUT)util/config.o
-LIB_OBJS += $(OUTPUT)util/ctype.o
-LIB_OBJS += $(OUTPUT)util/pmu.o
-LIB_OBJS += $(OUTPUT)util/environment.o
-LIB_OBJS += $(OUTPUT)util/event.o
-LIB_OBJS += $(OUTPUT)util/evlist.o
-LIB_OBJS += $(OUTPUT)util/evsel.o
-LIB_OBJS += $(OUTPUT)util/exec_cmd.o
-LIB_OBJS += $(OUTPUT)util/help.o
-LIB_OBJS += $(OUTPUT)util/kallsyms.o
-LIB_OBJS += $(OUTPUT)util/levenshtein.o
-LIB_OBJS += $(OUTPUT)util/parse-options.o
-LIB_OBJS += $(OUTPUT)util/parse-events.o
-LIB_OBJS += $(OUTPUT)util/path.o
-LIB_OBJS += $(OUTPUT)util/rbtree.o
-LIB_OBJS += $(OUTPUT)util/bitmap.o
-LIB_OBJS += $(OUTPUT)util/hweight.o
-LIB_OBJS += $(OUTPUT)util/run-command.o
-LIB_OBJS += $(OUTPUT)util/quote.o
-LIB_OBJS += $(OUTPUT)util/strbuf.o
-LIB_OBJS += $(OUTPUT)util/string.o
-LIB_OBJS += $(OUTPUT)util/strlist.o
-LIB_OBJS += $(OUTPUT)util/strfilter.o
-LIB_OBJS += $(OUTPUT)util/top.o
-LIB_OBJS += $(OUTPUT)util/usage.o
-LIB_OBJS += $(OUTPUT)util/wrapper.o
-LIB_OBJS += $(OUTPUT)util/sigchain.o
-LIB_OBJS += $(OUTPUT)util/dso.o
-LIB_OBJS += $(OUTPUT)util/symbol.o
-LIB_OBJS += $(OUTPUT)util/symbol-elf.o
-LIB_OBJS += $(OUTPUT)util/color.o
-LIB_OBJS += $(OUTPUT)util/pager.o
-LIB_OBJS += $(OUTPUT)util/header.o
-LIB_OBJS += $(OUTPUT)util/callchain.o
-LIB_OBJS += $(OUTPUT)util/values.o
-LIB_OBJS += $(OUTPUT)util/debug.o
-LIB_OBJS += $(OUTPUT)util/machine.o
-LIB_OBJS += $(OUTPUT)util/map.o
-LIB_OBJS += $(OUTPUT)util/pstack.o
-LIB_OBJS += $(OUTPUT)util/session.o
-LIB_OBJS += $(OUTPUT)util/comm.o
-LIB_OBJS += $(OUTPUT)util/thread.o
-LIB_OBJS += $(OUTPUT)util/thread_map.o
-LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
-LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
-LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
-LIB_OBJS += $(OUTPUT)util/pmu-flex.o
-LIB_OBJS += $(OUTPUT)util/pmu-bison.o
-LIB_OBJS += $(OUTPUT)util/trace-event-read.o
-LIB_OBJS += $(OUTPUT)util/trace-event-info.o
-LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
-LIB_OBJS += $(OUTPUT)util/trace-event.o
-LIB_OBJS += $(OUTPUT)util/svghelper.o
-LIB_OBJS += $(OUTPUT)util/sort.o
-LIB_OBJS += $(OUTPUT)util/hist.o
-LIB_OBJS += $(OUTPUT)util/probe-event.o
-LIB_OBJS += $(OUTPUT)util/util.o
-LIB_OBJS += $(OUTPUT)util/xyarray.o
-LIB_OBJS += $(OUTPUT)util/cpumap.o
-LIB_OBJS += $(OUTPUT)util/cgroup.o
-LIB_OBJS += $(OUTPUT)util/target.o
-LIB_OBJS += $(OUTPUT)util/rblist.o
-LIB_OBJS += $(OUTPUT)util/intlist.o
-LIB_OBJS += $(OUTPUT)util/vdso.o
-LIB_OBJS += $(OUTPUT)util/stat.o
-LIB_OBJS += $(OUTPUT)util/record.o
-LIB_OBJS += $(OUTPUT)util/srcline.o
-LIB_OBJS += $(OUTPUT)util/data.o
-
-LIB_OBJS += $(OUTPUT)ui/setup.o
-LIB_OBJS += $(OUTPUT)ui/helpline.o
-LIB_OBJS += $(OUTPUT)ui/progress.o
-LIB_OBJS += $(OUTPUT)ui/util.o
-LIB_OBJS += $(OUTPUT)ui/hist.o
-LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
-
-LIB_OBJS += $(OUTPUT)arch/common.o
-
-LIB_OBJS += $(OUTPUT)tests/parse-events.o
-LIB_OBJS += $(OUTPUT)tests/dso-data.o
-LIB_OBJS += $(OUTPUT)tests/attr.o
-LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
-LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
-LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
-LIB_OBJS += $(OUTPUT)tests/perf-record.o
-LIB_OBJS += $(OUTPUT)tests/rdpmc.o
-LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
-LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
-LIB_OBJS += $(OUTPUT)tests/pmu.o
-LIB_OBJS += $(OUTPUT)tests/hists_common.o
-LIB_OBJS += $(OUTPUT)tests/hists_link.o
-LIB_OBJS += $(OUTPUT)tests/hists_filter.o
-LIB_OBJS += $(OUTPUT)tests/hists_output.o
-LIB_OBJS += $(OUTPUT)tests/hists_cumulate.o
-LIB_OBJS += $(OUTPUT)tests/python-use.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal.o
-LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
-LIB_OBJS += $(OUTPUT)tests/task-exit.o
-LIB_OBJS += $(OUTPUT)tests/sw-clock.o
-ifeq ($(ARCH),x86)
-LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
-endif
-LIB_OBJS += $(OUTPUT)tests/code-reading.o
-LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
-LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
-ifndef NO_DWARF_UNWIND
-ifeq ($(ARCH),$(filter $(ARCH),x86 arm))
-LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o
-endif
-endif
-LIB_OBJS += $(OUTPUT)tests/mmap-thread-lookup.o
-LIB_OBJS += $(OUTPUT)tests/thread-mg-share.o
-
-BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
-BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
-# Benchmark modules
-BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
-BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
-ifeq ($(RAW_ARCH),x86_64)
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
-endif
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
-
-BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
-BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
-BUILTIN_OBJS += $(OUTPUT)builtin-help.o
-BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
-BUILTIN_OBJS += $(OUTPUT)builtin-list.o
-BUILTIN_OBJS += $(OUTPUT)builtin-record.o
-BUILTIN_OBJS += $(OUTPUT)builtin-report.o
-BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
-BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
-BUILTIN_OBJS += $(OUTPUT)builtin-top.o
-BUILTIN_OBJS += $(OUTPUT)builtin-script.o
-BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
-BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
-BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
-BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
-BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
-BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
-
-PERFLIBS = $(LIB_FILE) $(LIBAPIKFS) $(LIBTRACEEVENT)
-
-# We choose to avoid "if .. else if .. else .. endif endif"
-# because maintaining the nesting to match is a pain.  If
-# we had "elif" things would have been much nicer...
-
--include arch/$(ARCH)/Makefile
-
-ifneq ($(OUTPUT),)
-  CFLAGS += -I$(OUTPUT)
-endif
-
-ifdef NO_LIBELF
-EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
-
-# Remove ELF/DWARF dependent codes
-LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
-LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
-
-BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
-
-# Use minimal symbol handling
-LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
-
-else # NO_LIBELF
-ifndef NO_DWARF
-  LIB_OBJS += $(OUTPUT)util/probe-finder.o
-  LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
-endif # NO_DWARF
-endif # NO_LIBELF
-
-ifndef NO_LIBDW_DWARF_UNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libdw.o
-  LIB_H += util/unwind-libdw.h
-endif
-
-ifndef NO_LIBUNWIND
-  LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o
-endif
-LIB_OBJS += $(OUTPUT)tests/keep-tracking.o
-
-ifndef NO_LIBAUDIT
-  BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
-endif
-
-ifndef NO_SLANG
-  LIB_OBJS += $(OUTPUT)ui/browser.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/map.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
-  LIB_OBJS += $(OUTPUT)ui/browsers/header.o
-  LIB_OBJS += $(OUTPUT)ui/tui/setup.o
-  LIB_OBJS += $(OUTPUT)ui/tui/util.o
-  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
-  LIB_OBJS += $(OUTPUT)ui/tui/progress.o
-  LIB_H += ui/tui/tui.h
-  LIB_H += ui/browser.h
-  LIB_H += ui/browsers/map.h
-  LIB_H += ui/keysyms.h
-  LIB_H += ui/libslang.h
-endif
-
-ifndef NO_GTK2
-  ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
-
-  GTK_OBJS += $(OUTPUT)ui/gtk/browser.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/hists.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/setup.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/util.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/helpline.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/progress.o
-  GTK_OBJS += $(OUTPUT)ui/gtk/annotate.o
-
-install-gtk: $(OUTPUT)libperf-gtk.so
-	$(call QUIET_INSTALL, 'GTK UI') \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
-		$(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
-endif
-
-ifndef NO_LIBPERL
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
-  LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
-endif
-
-ifndef NO_LIBPYTHON
-  LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-  LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-endif
-
-ifeq ($(NO_PERF_REGS),0)
-  ifeq ($(ARCH),x86)
-    LIB_H += arch/x86/include/perf_regs.h
-  endif
-  LIB_OBJS += $(OUTPUT)util/perf_regs.o
-endif
-
-ifndef NO_LIBNUMA
-  BUILTIN_OBJS += $(OUTPUT)bench/numa.o
-endif
-
-ifdef ASCIIDOC8
-  export ASCIIDOC8
-endif
-
-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
-
-export INSTALL SHELL_PATH
-
-### Build rules
-
-SHELL = $(SHELL_PATH)
-
-all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
-
-please_set_SHELL_PATH_to_a_more_modern_shell:
-	@$$(:)
-
-shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
-
-strip: $(PROGRAMS) $(OUTPUT)perf
-	$(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
-
-$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		$(CFLAGS) -c $(filter %.c,$^) -o $@
-
-$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
-               $(BUILTIN_OBJS) $(LIBS) -o $@
-
-$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H)
-	$(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
-
-$(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS)
-	$(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS)
-
-$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
-		'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-		'-DPERF_INFO_PATH="$(infodir_SQ)"' $<
-
-$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
-
-$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
-	$(QUIET_GEN). util/generate-cmdlist.sh ./ > $@+ && mv $@+ $@
-
-$(SCRIPTS) : % : %.sh
-	$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
-
-# These can record PERF_VERSION
-$(OUTPUT)perf.o perf.spec \
-	$(SCRIPTS) \
-	: $(OUTPUT)PERF-VERSION-FILE
-
-.SUFFIXES:
-
-#
-# If a target does not match any of the later rules then prefix it by $(OUTPUT)
-# This makes targets like 'make O=/tmp/perf perf.o' work in a natural way.
-#
-ifneq ($(OUTPUT),)
-%.o: $(OUTPUT)%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-util/%.o: $(OUTPUT)util/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-bench/%.o: $(OUTPUT)bench/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-tests/%.o: $(OUTPUT)tests/%.o
-	@echo "    # Redirected target $@ => $(OUTPUT)$@"
-endif
-
-# These two need to be here so that when O= is not used they take precedence
-# over the general rule for .o
-
-$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
-
-$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
-
-$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
-$(OUTPUT)%.o: %.S
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-$(OUTPUT)%.s: %.S
-	$(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
-
-$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
-		'-DPREFIX="$(prefix_SQ)"' \
-		$<
-
-$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		'-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
-		-DPYTHONPATH='"$(OUTPUT)python"' \
-		-DPYTHON='"$(PYTHON_WORD)"' \
-		$<
-
-$(OUTPUT)tests/dwarf-unwind.o: tests/dwarf-unwind.c
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -fno-optimize-sibling-calls $<
-
-$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)ui/setup.o: ui/setup.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DLIBDIR='"$(libdir_SQ)"' $<
-
-$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
-
-$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
-
-$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
-$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
-
-$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $<
-
-$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
-
-$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
-
-$(OUTPUT)perf-%: %.o $(PERFLIBS)
-	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
-
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
-$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
-
-# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
-# we depend the various files onto their directories.
-DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS)
-DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
-# no need to add flex objects, because they depend on bison ones
-DIRECTORY_DEPS += $(OUTPUT)util/parse-events-bison.c
-DIRECTORY_DEPS += $(OUTPUT)util/pmu-bison.c
-
-OUTPUT_DIRECTORIES := $(sort $(dir $(DIRECTORY_DEPS)))
-
-$(DIRECTORY_DEPS): | $(OUTPUT_DIRECTORIES)
-# In the second step, we make a rule to actually create these directories
-$(OUTPUT_DIRECTORIES):
-	$(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
-
-$(LIB_FILE): $(LIB_OBJS)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
-
-# libtraceevent.a
-TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch])
-
-LIBTRACEEVENT_FLAGS  = $(QUIET_SUBDIR1) O=$(OUTPUT)
-LIBTRACEEVENT_FLAGS += CFLAGS="-g -Wall $(EXTRA_CFLAGS)"
-LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
-
-$(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins
-
-$(LIBTRACEEVENT)-clean:
-	$(call QUIET_CLEAN, libtraceevent)
-	@$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
-
-install-traceevent-plugins: $(LIBTRACEEVENT)
-	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) install_plugins
-
-LIBAPIKFS_SOURCES = $(wildcard $(LIB_PATH)fs/*.[ch])
-
-# if subdir is set, we've been called from above so target has been built
-# already
-$(LIBAPIKFS): $(LIBAPIKFS_SOURCES)
-ifeq ($(subdir),)
-	$(QUIET_SUBDIR0)$(LIB_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libapikfs.a
-endif
-
-$(LIBAPIKFS)-clean:
-ifeq ($(subdir),)
-	$(call QUIET_CLEAN, libapikfs)
-	@$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
-endif
-
-help:
-	@echo 'Perf make targets:'
-	@echo '  doc		- make *all* documentation (see below)'
-	@echo '  man		- make manpage documentation (access with man <foo>)'
-	@echo '  html		- make html documentation'
-	@echo '  info		- make GNU info documentation (access with info <foo>)'
-	@echo '  pdf		- make pdf documentation'
-	@echo '  TAGS		- use etags to make tag information for source browsing'
-	@echo '  tags		- use ctags to make tag information for source browsing'
-	@echo '  cscope	- use cscope to make interactive browsing database'
-	@echo ''
-	@echo 'Perf install targets:'
-	@echo '  NOTE: documentation build requires asciidoc, xmlto packages to be installed'
-	@echo '  HINT: use "prefix" or "DESTDIR" to install to a particular'
-	@echo '        path like "make prefix=/usr/local install install-doc"'
-	@echo '  install	- install compiled binaries'
-	@echo '  install-doc	- install *all* documentation'
-	@echo '  install-man	- install manpage documentation'
-	@echo '  install-html	- install html documentation'
-	@echo '  install-info	- install GNU info documentation'
-	@echo '  install-pdf	- install pdf documentation'
-	@echo ''
-	@echo '  quick-install-doc	- alias for quick-install-man'
-	@echo '  quick-install-man	- install the documentation quickly'
-	@echo '  quick-install-html	- install the html documentation quickly'
-	@echo ''
-	@echo 'Perf maintainer targets:'
-	@echo '  clean			- clean all binary objects and build output'
-
-
-DOC_TARGETS := doc man html info pdf
-
-INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
-INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
-
-# 'make doc' should call 'make -C Documentation all'
-$(DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
-
-TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol
-TAG_FILES= ../../include/uapi/linux/perf_event.h
-
-TAGS:
-	$(QUIET_GEN)$(RM) TAGS; \
-	$(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs etags -a $(TAG_FILES)
-
-tags:
-	$(QUIET_GEN)$(RM) tags; \
-	$(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs ctags -a $(TAG_FILES)
-
-cscope:
-	$(QUIET_GEN)$(RM) cscope*; \
-	$(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs cscope -b $(TAG_FILES)
-
-### Detect prefix changes
-TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
-             $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):$(plugindir_SQ)
-
-$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
-	@FLAGS='$(TRACK_CFLAGS)'; \
-	    if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
-		echo 1>&2 "  FLAGS:   * new build flags or prefix"; \
-		echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
-            fi
-
-### Testing rules
-
-# GNU make supports exporting all variables by "export" without parameters.
-# However, the environment gets quite big, and some programs have problems
-# with that.
-
-check: $(OUTPUT)common-cmds.h
-	if sparse; \
-	then \
-		for i in *.c */*.c; \
-		do \
-			sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
-		done; \
-	else \
-		exit 1; \
-	fi
-
-### Installation rules
-
-install-gtk:
-
-install-bin: all install-gtk
-	$(call QUIET_INSTALL, binaries) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
-		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
-	$(call QUIET_INSTALL, libexec) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-	$(call QUIET_INSTALL, perf-archive) \
-		$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
-ifndef NO_LIBPERL
-	$(call QUIET_INSTALL, perl-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \
-		$(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
-endif
-ifndef NO_LIBPYTHON
-	$(call QUIET_INSTALL, python-scripts) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \
-		$(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
-		$(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \
-		$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
-endif
-	$(call QUIET_INSTALL, perf_completion-script) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
-		$(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
-	$(call QUIET_INSTALL, tests) \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
-		$(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
-
-install: install-bin try-install-man install-traceevent-plugins
-
-install-python_ext:
-	$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
-
-# 'make install-doc' should call 'make -C Documentation install'
-$(INSTALL_DOC_TARGETS):
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
-
-### Cleaning rules
-
-#
-# This is here, not in config/Makefile, because config/Makefile does
-# not get included for the clean target:
-#
-config-clean:
-	$(call QUIET_CLEAN, config)
-	@$(MAKE) -C config/feature-checks clean >/dev/null
-
-clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
-	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
-	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
-	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
-	$(python-clean)
-
-#
-# Trick: if ../../.git does not exist - we are building out of tree for example,
-# then force version regeneration:
-#
-ifeq ($(wildcard ../../.git/HEAD),)
-    GIT-HEAD-PHONY = ../../.git/HEAD
-else
-    GIT-HEAD-PHONY =
-endif
-
-.PHONY: all install clean config-clean strip install-gtk
-.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS
-
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index aea56c5..2c7e1de 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -154,7 +154,7 @@ find_next:
 
 			/* skip missing symbols */
 			nd = rb_next(nd);
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 		} else if (use_browser == 1) {
 			struct rb_node *next = NULL;
 			key = hist_entry__tui_annotate(he, evsel, NULL);
@@ -318,7 +318,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
 #endif
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
index 49550c9..863727f 100644
--- a/tools/perf/builtin-cmds.h
+++ b/tools/perf/builtin-cmds.h
@@ -1,31 +1,6 @@
 #ifndef BUILTIN_CMDS_H
 #define BUILTIN_CMDS_H
 
-#ifndef CONFIG_KBUILD
-#define CONFIG_BUILTIN_REPORT 1
-#define CONFIG_BUILTIN_SCRIPT 1
-#define CONFIG_BUILTIN_BENCH 1
-#define CONFIG_BUILTIN_SCHED 1
-#define CONFIG_BUILTIN_TRACE 1
-#define CONFIG_BUILTIN_TOP 1
-#define CONFIG_BUILTIN_RECORD 1
-#define CONFIG_BUILTIN_BUILDID_LIST 1
-#define CONFIG_BUILTIN_INJECT 1
-#define CONFIG_BUILTIN_LOCK 1
-#define CONFIG_BUILTIN_KVM 1
-#define CONFIG_BUILTIN_BUILDID_CACHE 1
-#define CONFIG_BUILTIN_EVLIST 1
-#define CONFIG_BUILTIN_KMEM 1
-#define CONFIG_BUILTIN_STAT 1
-#define CONFIG_BUILTIN_DIFF 1
-#define CONFIG_BUILTIN_ANNOTATE 1
-#define CONFIG_BUILTIN_TIMECHART 1
-#define CONFIG_BUILTIN_LIST 1
-#define CONFIG_BUILTIN_HELP 1
-#define CONFIG_BUILTIN_PROBE 1
-#define CONFIG_BUILTIN_MEM 1
-#else
 #include "generated/autoconf.h"
-#endif /* CONFIG_KBUILD */
 
 #endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8dc8077..c97410a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -392,7 +392,7 @@ static int report__browse_hists(struct report *rep)
 	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
 
 	switch (use_browser) {
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 	case 1:
 		ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
 						    rep->min_percent,
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1c807c3..c668b0a 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -535,7 +535,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 	return ret;
 }
 
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 static void perf_top__sort_new_samples(void *arg)
 {
 	struct perf_top *t = arg;
@@ -958,7 +958,7 @@ static int __cmd_top(struct perf_top *top)
 
 	ret = -1;
 
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 	if (use_browser > 0)
 		display_fn = display_thread_tui;
 #endif
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index efc2b21..7928984 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -77,7 +77,7 @@ void setup_browser(bool fallback_to_pager)
 		       PERF_GTK_DSO);
 		sleep(1);
 		/* fall through */
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
@@ -98,7 +98,7 @@ void exit_browser(bool wait_for_ok __maybe_unused)
 	case 2:
 		exit_gtk_browser(wait_for_ok);
 		break;
-#if defined(CONFIG_TUI) || !defined(CONFIG_KBUILD)
+#ifdef CONFIG_TUI
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 06/13] perf kbuild: remove legacy tui/gui-related build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (5 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 05/13] perf kbuild: remove Makefile.perf Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 07/13] perf kbuild: remove legacy demangle-related " Alexis Berlemont
                             ` (6 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_SLANG (replaced by CONFIG_LIBSLANG)
Remove HAVE_SLANG_SUPPORT from CFLAGS (replaced by CONFIG_LIBSLANG)
Remove NO_GTK2 (replaced by CONFIG_LIBGTK2 or CONFIG_GTK2)
Remove HAVE_GTK2_SUPPORT from CFLAGS (replaced by CONFIG_LIBGTK2)
Remove HAVE_GTK_INFO_BAR_SUPPORT from CFLAGS (replaced by
CONFIG_LIBGTK2_INFOBAR)
---
 tools/perf/Kconfig                    | 21 +++++++++++++++++++++
 tools/perf/config/Makefile            | 20 ++++++--------------
 tools/perf/config/Makefile.fix-config | 24 ------------------------
 tools/perf/config/Makefile.fix-legacy |  8 --------
 tools/perf/ui/gtk/browser.c           |  4 +++-
 tools/perf/ui/gtk/gtk.h               |  5 +++--
 tools/perf/ui/gtk/util.c              |  6 ++++--
 tools/perf/ui/setup.c                 |  4 +++-
 tools/perf/ui/ui.h                    |  4 +++-
 tools/perf/util/annotate.h            |  4 +++-
 tools/perf/util/hist.h                |  4 +++-
 11 files changed, 49 insertions(+), 55 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index f9fcf9e..eb59567 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -171,6 +171,7 @@ config STDIO
 
 config TUI
 	bool "Tui (slang based)"
+	depends on LIBSLANG
 	default y
         ---help---
 	  Text-based user interface which provides windowing
@@ -179,6 +180,7 @@ config TUI
 config GTK2
 	bool "Gtk2"
 	default y
+	depends on LIBGTK2
         ---help---
 	  Elaborate display mode based on libgtk2.
 
@@ -186,12 +188,31 @@ endmenu
 
 menu "Libraries / Dependencies"
 
+config LIBSLANG
+	bool "Slang (libslang)"
+	default y
+        ---help---
+	  libslang
+
 config LIBAUDIT
 	bool "Audit (libaudit)"
 	default y
         ---help---
 	  Linux audit framework dependency.
 
+config LIBGTK2
+	bool "Gtk2 (libgtk2)"
+	default y
+        ---help---
+	  libgtk2
+
+config LIBGTK2_INFOBAR
+	bool "Gtk2 infobar (libgtk2)"
+	depends on LIBGTK2
+	default y
+        ---help---
+	  libgtk2-infobar
+
 config LIBPERL
 	bool "Perl"
 	default y
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f67cc75..f23185a 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -410,32 +410,26 @@ ifndef NO_LIBAUDIT
   endif
 endif
 
-ifdef NO_NEWT
-  NO_SLANG=1
-endif
-
-ifndef NO_SLANG
+ifdef CONFIG_LIBSLANG
   ifneq ($(feature-libslang), 1)
-    msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
-    NO_SLANG := 1
+    msg := $(warning slang not found, disables SLANG and TUI supports. Please install slang-devel or libslang-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBSLANG)
   else
     # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
     CFLAGS += -I/usr/include/slang
-    CFLAGS += -DHAVE_SLANG_SUPPORT
     EXTLIBS += -lslang
   endif
 endif
 
-ifndef NO_GTK2
+ifdef CONFIG_LIBGTK2
   FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
   ifneq ($(feature-gtk2), 1)
     msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
-    NO_GTK2 := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2)
   else
     ifeq ($(feature-gtk2-infobar), 1)
-      GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBGTK2_INFOBAR)
     endif
-    CFLAGS += -DHAVE_GTK2_SUPPORT
     GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
     GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
     EXTLIBS += -ldl
@@ -765,8 +759,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_NEWT)
-	$(call store,NO_GTK2)
 	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 7f65fdb..3d84008 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,30 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_NEWT
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
-# NO_NEWT
-ifdef CONFIG_TUI
-ifdef NO_SLANG
-dummy := $(info Disabling CONFIG_TUI)
-dummy := $(shell $(CONFIG) -d CONFIG_TUI)
-endif
-endif
-
-# NO_GTK2
-ifdef CONFIG_GTK2
-ifdef NO_GTK2
-dummy := $(info Disabling CONFIG_GTK2)
-dummy := $(shell $(CONFIG) -d CONFIG_GTK2)
-endif
-endif
-
 # NO_DEMANGLE
 ifdef CONFIG_DEMANGLE
 ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 2ec91f3..ca219e7 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,14 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_TUI
-NO_SLANG := 1
-endif
-
-ifndef CONFIG_GTK2
-NO_GTK2 := 1
-endif
-
 ifndef CONFIG_DEMANGLE
 NO_DEMANGLE := 1
 endif
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c
index c24d912..f4df6a6 100644
--- a/tools/perf/ui/gtk/browser.c
+++ b/tools/perf/ui/gtk/browser.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../evlist.h"
 #include "../cache.h"
 #include "../evsel.h"
@@ -43,7 +45,7 @@ const char *perf_gtk__get_percent_color(double percent)
 	return NULL;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void)
 {
 	GtkWidget *info_bar;
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index 0a9173f..3762980 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -7,12 +7,13 @@
 #include <gtk/gtk.h>
 #pragma GCC diagnostic error "-Wstrict-prototypes"
 
+#include "generated/autoconf.h"
 
 struct perf_gtk_context {
 	GtkWidget *main_window;
 	GtkWidget *notebook;
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	GtkWidget *info_bar;
 	GtkWidget *message_label;
 #endif
@@ -42,7 +43,7 @@ void perf_gtk__resize_window(GtkWidget *window);
 const char *perf_gtk__get_percent_color(double percent);
 GtkWidget *perf_gtk__setup_statusbar(void);
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 GtkWidget *perf_gtk__setup_info_bar(void);
 #else
 static inline GtkWidget *perf_gtk__setup_info_bar(void)
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index 52e7fc4..dde1615 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "../util.h"
 #include "../../util/debug.h"
 #include "gtk.h"
@@ -52,7 +54,7 @@ static int perf_gtk__error(const char *format, va_list args)
 	return 0;
 }
 
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 static int perf_gtk__warning_info_bar(const char *format, va_list args)
 {
 	char *msg;
@@ -104,7 +106,7 @@ static int perf_gtk__warning_statusbar(const char *format, va_list args)
 
 struct perf_error_ops perf_gtk_eops = {
 	.error		= perf_gtk__error,
-#ifdef HAVE_GTK_INFO_BAR_SUPPORT
+#ifdef CONFIG_LIBGTK2_INFOBAR
 	.warning	= perf_gtk__warning_info_bar,
 #else
 	.warning	= perf_gtk__warning_statusbar,
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 7928984..0acaf1b 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -1,6 +1,8 @@
 #include <pthread.h>
 #include <dlfcn.h>
 
+#include "generated/autoconf.h"
+
 #include "../util/cache.h"
 #include "../util/debug.h"
 #include "../util/hist.h"
@@ -8,7 +10,7 @@
 pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
 void *perf_gtk_handle;
 
-#ifdef HAVE_GTK2_SUPPORT
+#ifdef CONFIG_GTK2
 static int setup_gtk_browser(void)
 {
 	int (*perf_ui_init)(void);
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index ab88383..bba3a0e 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -5,6 +5,8 @@
 #include <stdbool.h>
 #include <linux/compiler.h>
 
+#include "generated/autoconf.h"
+
 extern pthread_mutex_t ui__lock;
 extern void *perf_gtk_handle;
 
@@ -13,7 +15,7 @@ extern int use_browser;
 void setup_browser(bool fallback_to_pager);
 void exit_browser(bool wait_for_ok);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int ui__init(void);
 void ui__exit(bool wait_for_ok);
 #else
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 112d6e2..692f46c 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -11,6 +11,8 @@
 #include <linux/rbtree.h>
 #include <pthread.h>
 
+#include "generated/autoconf.h"
+
 struct ins;
 
 struct ins_operands {
@@ -157,7 +159,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel, bool print_lines,
 			 bool full_paths, int min_pcnt, int max_lines);
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 int symbol__tui_annotate(struct symbol *sym, struct map *map,
 			 struct perf_evsel *evsel,
 			 struct hist_browser_timer *hbt);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 742f49a..f4966f6 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -8,6 +8,8 @@
 #include "color.h"
 #include "ui/progress.h"
 
+#include "generated/autoconf.h"
+
 extern struct callchain_param callchain_param;
 
 struct hist_entry;
@@ -299,7 +301,7 @@ struct hist_browser_timer {
 	int refresh;
 };
 
-#ifdef HAVE_SLANG_SUPPORT
+#ifdef CONFIG_LIBSLANG
 #include "../ui/keysyms.h"
 int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
 			     struct hist_browser_timer *hbt);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 07/13] perf kbuild: remove legacy demangle-related build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (6 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 06/13] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 08/13] perf kbuild: remove legacy misc " Alexis Berlemont
                             ` (5 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_DEMANGLE (replaced by CONFIG_DEMANGLE)
Remove HAVE_LIBBFD_SUPPORT (replaced by CONFIG_LIBBFD)
Remove HAVE_CPLUS_DEMANGLE_SUPPORT (replaced by CONFIG_LIBIBERTY_ONLY)
---
 tools/perf/Kconfig                    | 36 +++++++++++++++++++++------
 tools/perf/config/Makefile            | 46 ++++++++++++++++++-----------------
 tools/perf/config/Makefile.fix-legacy |  4 ---
 tools/perf/util/srcline.c             |  8 +++---
 tools/perf/util/symbol.h              | 25 +++++++++++++------
 5 files changed, 75 insertions(+), 44 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index eb59567..026ef67 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -225,6 +225,35 @@ config LIBPYTHON
         ---help---
 	  Libpython dependency needed by the perf script feature.
 
+config TIMERFD
+	bool "Timer via file descriptor"
+	default y
+        ---help---
+	  Timer via file descriptor
+
+config DEMANGLE
+	bool "Demangle symbols"
+	default y
+        ---help---
+	  Enable demangling so as to display human-readable
+	  symbols. This option is convenient with C++ programs.
+
+choice DEMANGLE_DEPS
+       prompt "Demangle dependency(ies)"
+       depends on DEMANGLE
+       default LIBBFD
+
+config LIBBFD
+	bool "BFD + libiberty libraries"
+        ---help---
+	  Binary File Descriptor and libiberty libraries
+
+config LIBIBERTY_ONLY
+	bool "Libiberty only"
+        ---help---
+	  Libiberty
+endchoice
+
 choice
 	prompt "Elf library"
 	default LIBELF
@@ -266,13 +295,6 @@ config NUMA
 	  The library libnuma offers facilities to configure NUMA
 	  policies supported by the linux kernel.
 
-config DEMANGLE
-	bool "Demangle symbols"
-	default y
-        ---help---
-	  Enable demangling so as to display human-readable
-	  symbols. This option is convenient with C++ programs.
-
 config BIONIC
 	bool "Bionic support"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f23185a..9168a21 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -545,33 +545,36 @@ ifeq ($(feature-libbfd), 1)
   endif
 endif
 
-ifdef NO_DEMANGLE
-  CFLAGS += -DNO_DEMANGLE
-else
-  ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
-    EXTLIBS += -liberty
-    CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-  else
-    ifneq ($(feature-libbfd), 1)
-      ifneq ($(feature-liberty), 1)
-        ifneq ($(feature-liberty-z), 1)
-          # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
-          # or any of 'bfd iberty z' trinity
-          ifeq ($(feature-cplus-demangle), 1)
-            EXTLIBS += -liberty
-            CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-          else
-            msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
-            CFLAGS += -DNO_DEMANGLE
-          endif
+ifdef CONFIG_LIBBFD
+  ifneq ($(feature-libbfd), 1)
+    # TODO: there might be an issue here: feature-liberty and
+    # feature-liberty-z cannot be set; they can be set only if
+    # feature-libbfd is set
+    ifneq ($(feature-liberty), 1)
+      ifneq ($(feature-liberty-z), 1)
+        # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
+        # or any of 'bfd iberty z' trinity
+        ifeq ($(feature-cplus-demangle), 1)
+          EXTLIBS += -liberty
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBBFD)
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBIBERTY_ONLY)
+        else
+          msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
         endif
       endif
     endif
   endif
 endif
 
-ifneq ($(filter -lbfd,$(EXTLIBS)),)
-  CFLAGS += -DHAVE_LIBBFD_SUPPORT
+ifdef CONFIG_LIBIBERTY_ONLY
+  $(call feature_check,cplus-demangle)
+  ifeq ($(feature-cplus-demangle), 1)
+    EXTLIBS += -liberty
+  else
+    msg := $(warning No libiberty found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
+  endif
 endif
 
 ifndef NO_BACKTRACE
@@ -759,7 +762,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_BACKTRACE)
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ca219e7..64dbb1a 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_DEMANGLE
-NO_DEMANGLE := 1
-endif
-
 ifndef CONFIG_LIBELF
 NO_LIBELF := 1
 endif
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index f3e4bc5..38df8f4 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -4,11 +4,13 @@
 
 #include <linux/kernel.h>
 
+#include "generated/autoconf.h"
+
 #include "util/dso.h"
 #include "util/util.h"
 #include "util/debug.h"
 
-#ifdef HAVE_LIBBFD_SUPPORT
+#ifdef CONFIG_LIBBFD
 
 /*
  * Implement addr2line using libbfd.
@@ -189,7 +191,7 @@ void dso__free_a2l(struct dso *dso)
 	dso->a2l = NULL;
 }
 
-#else /* HAVE_LIBBFD_SUPPORT */
+#else /* !CONFIG_LIBBFD */
 
 static int addr2line(const char *dso_name, unsigned long addr,
 		     char **file, unsigned int *line_nr,
@@ -242,7 +244,7 @@ void dso__free_a2l(struct dso *dso __maybe_unused)
 {
 }
 
-#endif /* HAVE_LIBBFD_SUPPORT */
+#endif /* CONFIG_LIBBFD */
 
 /*
  * Number of addr2line failures (without success) before disabling it for that
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 615c752..508d317 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,6 +1,8 @@
 #ifndef __PERF_SYMBOL
 #define __PERF_SYMBOL 1
 
+#include "generated/autoconf.h"
+
 #include <linux/types.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -22,26 +24,33 @@
 
 #include "dso.h"
 
-#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
+#ifdef CONFIG_DEMANGLE
+
+#ifdef CONFIG_LIBBFD
+
+#define PACKAGE 'perf'
+#include <bfd.h>
+
+#elif defined(CONFIG_LIBIBERTY_ONLY)
 extern char *cplus_demangle(const char *, int);
 
 static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
 {
 	return cplus_demangle(c, i);
 }
-#else
-#ifdef NO_DEMANGLE
+
+#else /* Unknown dependency */
+#error "Inconsistent demangling configuration"
+#endif
+
+#else /* !CONFIG_DEMANGLE */
 static inline char *bfd_demangle(void __maybe_unused *v,
 				 const char __maybe_unused *c,
 				 int __maybe_unused i)
 {
 	return NULL;
 }
-#else
-#define PACKAGE 'perf'
-#include <bfd.h>
-#endif
-#endif
+#endif /* CONFIG_DEMANGLE */
 
 /*
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 08/13] perf kbuild: remove legacy misc build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (7 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 07/13] perf kbuild: remove legacy demangle-related " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 09/13] perf kbuild: remove legacy libelf-related " Alexis Berlemont
                             ` (4 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_LIBAUDIT (replaced by CONFIG_LIBAUDIT)
Remove HAVE_LIBAUDIT_SUPPORT from CFLAGS (replaced by CONFIG_LIBAUDIT)
Remove HAVE_TIMERFD_SUPPORT (replaced by CONFIG_TIMERFD)
Remove HAVE_ON_EXIT_SUPPORT (replaced by CONFIG_ON_EXIT)
Remove HAVE_BACKTRACE_SUPPORT (replaced by CONFIG_BACKTRACE)
Remove HAVE_LIBNUMA_SUPPORT (replaced by CONFIG_LIBNUMA)
Remove NO_BIONIC (replaced by CONFIG_BIONIC)
---
 tools/perf/Kconfig                    |  4 ++--
 tools/perf/bench/Kbuild               |  2 +-
 tools/perf/builtin-bench.c            |  5 +++--
 tools/perf/builtin-kvm.c              | 13 +++++++------
 tools/perf/builtin-record.c           |  2 ++
 tools/perf/config/Makefile            | 35 +++++++++++++++++------------------
 tools/perf/config/Makefile.fix-config | 32 --------------------------------
 tools/perf/config/Makefile.fix-legacy | 16 ----------------
 tools/perf/util/util.c                |  5 +++--
 9 files changed, 35 insertions(+), 79 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 026ef67..7bee6f4 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -288,8 +288,8 @@ config LIBUNWIND_DIR
 	  Directory holding the libuwind dependency (headers +
 	  libraries).
 
-config NUMA
-	bool "Numa support (bench)"
+config LIBNUMA
+	bool "Libnuma support"
 	default y
         ---help---
 	  The library libnuma offers facilities to configure NUMA
diff --git a/tools/perf/bench/Kbuild b/tools/perf/bench/Kbuild
index e604fe2..863646a 100644
--- a/tools/perf/bench/Kbuild
+++ b/tools/perf/bench/Kbuild
@@ -6,7 +6,7 @@ obj-y += futex-hash.o
 obj-y += futex-requeue.o
 obj-y += futex-wake.o
 
-obj-$(CONFIG_NUMA) += numa.o
+obj-$(CONFIG_LIBNUMA) += numa.o
 
 obj-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
 obj-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 1e6e777..162b9f5 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -14,6 +14,7 @@
  *  numa  ... NUMA scheduling and MM performance
  *  futex ... Futex performance
  */
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "util/util.h"
 #include "util/parse-options.h"
@@ -33,7 +34,7 @@ struct bench {
 	bench_fn_t	fn;
 };
 
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 static struct bench numa_benchmarks[] = {
 	{ "mem",	"Benchmark for NUMA workloads",			bench_numa		},
 	{ "all",	"Test all NUMA benchmarks",			NULL			},
@@ -72,7 +73,7 @@ struct collection {
 static struct collection collections[] = {
 	{ "sched",	"Scheduler and IPC benchmarks",			sched_benchmarks	},
 	{ "mem",	"Memory access benchmarks",			mem_benchmarks		},
-#ifdef HAVE_LIBNUMA_SUPPORT
+#ifdef CONFIG_LIBNUMA
 	{ "numa",	"NUMA scheduling and MM benchmarks",		numa_benchmarks		},
 #endif
 	{"futex",       "Futex stressing benchmarks",                   futex_benchmarks        },
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0d0d9c7..56811c8 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "perf.h"
 
@@ -20,7 +21,7 @@
 #include "util/data.h"
 
 #include <sys/prctl.h>
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
 #endif
 
@@ -339,7 +340,7 @@ static void init_kvm_event_record(struct perf_kvm_stat *kvm)
 		INIT_LIST_HEAD(&kvm->kvm_events_cache[i]);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static void clear_events_cache_stats(struct list_head *kvm_events_cache)
 {
 	struct list_head *head;
@@ -788,7 +789,7 @@ static void print_result(struct perf_kvm_stat *kvm)
 		pr_info("\nLost events: %" PRIu64 "\n\n", kvm->lost_events);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static int process_lost_event(struct perf_tool *tool,
 			      union perf_event *event __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
@@ -879,7 +880,7 @@ static bool verify_vcpu(int vcpu)
 	return true;
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 /* keeping the max events to a modest level to keep
  * the processing of samples per mmap smooth.
  */
@@ -1386,7 +1387,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 	return kvm_events_report_vcpu(kvm);
 }
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 static struct perf_evlist *kvm_live_event_list(void)
 {
 	struct perf_evlist *evlist;
@@ -1601,7 +1602,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)
 	if (!strncmp(argv[1], "rep", 3))
 		return kvm_events_report(&kvm, argc - 1 , argv + 1);
 
-#ifdef HAVE_TIMERFD_SUPPORT
+#ifdef CONFIG_TIMERFD
 	if (!strncmp(argv[1], "live", 4))
 		return kvm_events_live(&kvm, argc - 1 , argv + 1);
 #endif
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 378b85b..42c127d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -5,6 +5,8 @@
  * (or a CPU, or a PID) into the perf.data output file - for
  * later analysis via perf report.
  */
+
+#include "generated/autoconf.h"
 #include "builtin.h"
 
 #include "perf.h"
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 9168a21..6c71c5b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -274,12 +274,14 @@ CFLAGS += -I$(LIB_INCLUDE)
 
 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
-ifndef NO_BIONIC
+ifdef CONFIG_BIONIC
   $(call feature_check,bionic)
   ifeq ($(feature-bionic), 1)
     BIONIC := 1
     EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
     EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
+  else
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BIONIC)
   endif
 endif
 
@@ -400,12 +402,11 @@ ifndef NO_LIBUNWIND
   LDFLAGS += $(LIBUNWIND_LDFLAGS)
 endif
 
-ifndef NO_LIBAUDIT
+ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
-    msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
-    NO_LIBAUDIT := 1
+    msg := $(warning No libaudit.h found, disables LIBAUDIT support and 'trace' tool, please install audit-libs-devel or libaudit-dev);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBAUDIT)
   else
-    CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
     EXTLIBS += -laudit
   endif
 endif
@@ -458,10 +459,12 @@ else
   endif
 endif
 
-ifeq ($(feature-timerfd), 1)
-  CFLAGS += -DHAVE_TIMERFD_SUPPORT
-else
-  msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+ifdef CONFIG_TIMERFD
+  ifneq ($(feature-timerfd), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_TIMERFD)
+  else
+    msg := $(warning No timerfd support. Disables 'perf kvm stat live');
+  endif
 endif
 
 disable-python = $(eval $(disable-python_code))
@@ -577,18 +580,17 @@ ifdef CONFIG_LIBIBERTY_ONLY
   endif
 endif
 
-ifndef NO_BACKTRACE
-  ifeq ($(feature-backtrace), 1)
-    CFLAGS += -DHAVE_BACKTRACE_SUPPORT
+ifdef CONFIG_BACKTRACE
+  ifneq ($(feature-backtrace), 1)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_BACKTRACE)
   endif
 endif
 
-ifndef NO_LIBNUMA
+ifdef CONFIG_LIBNUMA
   ifeq ($(feature-libnuma), 0)
     msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
-    NO_LIBNUMA := 1
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBNUMA)
   else
-    CFLAGS += -DHAVE_LIBNUMA_SUPPORT
     EXTLIBS += -lnuma
   endif
 endif
@@ -764,9 +766,6 @@ all:
 	$(call store,NO_LIBPYTHON)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_BACKTRACE)
-	$(call store,NO_LIBNUMA)
-	$(call store,NO_LIBAUDIT)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 3d84008..2ba684b 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -45,36 +45,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
 endif
 endif
 
-# NO_BACKTRACE
-ifdef CONFIG_BACKTRACE
-ifdef NO_BACKTRACE
-dummy := $(info Disabling CONFIG_BACKTRACE)
-dummy := $(shell $(CONFIG) -d CONFIG_BACKTRACE)
-endif
-endif
-
-# NO_LIBNUMA
-ifdef CONFIG_NUMA
-ifdef NO_LIBNUMA
-dummy := $(info Disabling CONFIG_NUMA)
-dummy := $(shell $(CONFIG) -d CONFIG_NUMA)
-endif
-endif
-
-# NO_LIBAUDIT
-ifdef CONFIG_LIBAUDIT
-ifdef NO_LIBAUDIT
-dummy := $(info Disabling CONFIG_LIBAUDIT)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBAUDIT)
-endif
-endif
-
-# NO_LIBBIONIC
-ifdef CONFIG_BIONIC
-ifdef NO_LIBBIONIC
-dummy := $(info Disabling CONFIG_BIONIC)
-dummy := $(shell $(CONFIG) -d CONFIG_BIONIC)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 64dbb1a..8e32b74 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -16,19 +16,3 @@ endif
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
-
-ifndef CONFIG_BACKTRACE
-NO_BACKTRACE := 1
-endif
-
-ifndef CONFIG_NUMA
-export NO_LIBNUMA := 1
-endif
-
-ifndef CONFIG_LIBAUDIT
-NO_LIBAUDIT := 1
-endif
-
-ifdef CONFIG_BIONIC
-NO_LIBBIONIC := 1
-endif
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 95aefa7..6d3e07c 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,8 +1,9 @@
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include <api/fs/fs.h>
 #include <sys/mman.h>
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 #include <execinfo.h>
 #endif
 #include <stdio.h>
@@ -240,7 +241,7 @@ int hex2u64(const char *ptr, u64 *long_val)
 }
 
 /* Obtain a backtrace and print it to stdout. */
-#ifdef HAVE_BACKTRACE_SUPPORT
+#ifdef CONFIG_BACKTRACE
 void dump_stack(void)
 {
 	void *array[16];
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 09/13] perf kbuild: remove legacy libelf-related build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (8 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 08/13] perf kbuild: remove legacy misc " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 10/13] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
                             ` (3 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_LIBELF (replaced by CONFIG_LIBELF)
Remove HAVE_LIBELF_SUPPORT (replaced by CONFIG_LIBELF)
Remove HAVE_LIBELF_MMAP_SUPPORT (replaced by CONFIG_LIBELF_MMAP)
Remove HAVE_LIBELF_GETPHDRNUM__SUPPORT (replaced by
CONFIG_LIBELF_GETPHDRNUM_)
---
 tools/perf/Kconfig                    | 23 ++++++++++++++++++++++
 tools/perf/builtin-inject.c           |  2 +-
 tools/perf/config/Makefile            | 36 +++++++++++++++--------------------
 tools/perf/config/Makefile.fix-config | 18 ------------------
 tools/perf/config/Makefile.fix-legacy |  4 ----
 tools/perf/perf.c                     |  2 +-
 tools/perf/util/generate-cmdlist.sh   |  4 ++--
 tools/perf/util/map.c                 |  3 ++-
 tools/perf/util/symbol-elf.c          |  3 ++-
 tools/perf/util/symbol.h              |  8 ++++----
 10 files changed, 50 insertions(+), 53 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index 7bee6f4..c5733f0 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -232,6 +232,7 @@ config TIMERFD
 	  Timer via file descriptor
 
 config DEMANGLE
+       depends on LIBELF
 	bool "Demangle symbols"
 	default y
         ---help---
@@ -274,7 +275,29 @@ choice
 	  Builtin elf support.
 endchoice
 
+config LIBELF_MMAP
+        depends on LIBELF
+	bool "Libelf mmap support"
+	default y
+        ---help---
+	  libdelf mmap
+
+config LIBELF_GETPHDRNUM
+        depends on LIBELF
+	default y
+	bool "Libelf getphdrnum support"
+        ---help---
+	  libdelf mmap
+
+config LIBDWARF
+	depends on LIBELF
+	bool "Dwarf (libdwarf)"
+	default y
+        ---help---
+	  libdwarf
+
 config LIBUNWIND
+        depends on LIBELF
 	bool "User space libunwind callchains"
 	default y
         ---help---
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 16c7c11..8c6b0ae 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -229,7 +229,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool,
 				 * account this as unresolved.
 				 */
 			} else {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 				pr_warning("no symbols found in %s, maybe "
 					   "install a debug package?\n",
 					   al.map->dso->long_name);
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 6c71c5b..95db69d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -285,12 +285,7 @@ ifdef CONFIG_BIONIC
   endif
 endif
 
-ifdef NO_LIBELF
-  NO_DWARF := 1
-  NO_DEMANGLE := 1
-  NO_LIBUNWIND := 1
-  NO_LIBDW_DWARF_UNWIND := 1
-else
+ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
       LIBC_SUPPORT := 1
@@ -300,12 +295,8 @@ else
     endif
     ifeq ($(LIBC_SUPPORT),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
-
-      NO_LIBELF := 1
-      NO_DWARF := 1
-      NO_DEMANGLE := 1
-      NO_LIBUNWIND := 1
-      NO_LIBDW_DWARF_UNWIND := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
+      $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
     else
       ifneq ($(filter s% -static%,$(LDFLAGS),),)
         msg := $(error No static glibc found, please install glibc-static);
@@ -314,6 +305,7 @@ else
       endif
     endif
   else
+    LIBELF = 1
     ifndef NO_LIBDW_DWARF_UNWIND
       ifneq ($(feature-libdw-dwarf-unwind),1)
         NO_LIBDW_DWARF_UNWIND := 1
@@ -325,17 +317,20 @@ else
       NO_DWARF := 1
     endif # Dwarf support
   endif # libelf support
-endif # NO_LIBELF
+endif # CONFIG_LIBELF
 
-ifndef NO_LIBELF
-  CFLAGS += -DHAVE_LIBELF_SUPPORT
+ifeq ($(LIBELF), 1)
 
-  ifeq ($(feature-libelf-mmap), 1)
-    CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-mmap), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
-  ifeq ($(feature-libelf-getphdrnum), 1)
-    CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
+  ifdef CONFIG_LIBELF_MMAP
+    ifneq ($(feature-libelf-getphdrnum), 1)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+    endif
   endif
 
   # include ARCH specific config
@@ -351,7 +346,7 @@ ifndef NO_LIBELF
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
   endif # NO_DWARF
-endif # NO_LIBELF
+endif # LIBELF
 
 ifndef NO_LIBUNWIND
   ifneq ($(feature-libunwind), 1)
@@ -764,7 +759,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 2ba684b..99948b7 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,24 +19,6 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_DEMANGLE
-ifdef CONFIG_DEMANGLE
-ifdef NO_DEMANGLE
-dummy := $(info Disabling CONFIG_DEMANGLE)
-dummy := $(shell $(CONFIG) -d CONFIG_DEMANGLE)
-endif
-endif
-
-# NO_LIBELF
-ifdef CONFIG_LIBELF
-ifdef NO_LIBELF
-dummy := $(info Disabling CONFIG_LIBELF)
-dummy := $(info Enabling  CONFIG_LIBELF_MINIMAL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBELF)
-dummy := $(shell $(CONFIG) -e CONFIG_LIBELF_MINIMAL)
-endif
-endif
-
 # NO_LIBUNWIND
 ifdef CONFIG_LIBUNWIND
 ifdef NO_LIBUNWIND
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 8e32b74..8568d37 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_LIBELF
-NO_LIBELF := 1
-endif
-
 ifndef CONFIG_LIBUNWIND
 NO_LIBUNWIND := 1
 endif
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index b094379..56cd4a2 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -80,7 +80,7 @@ static struct cmd_struct commands[] = {
 #ifdef CONFIG_BUILTIN_SCHED
 	{ "sched",	cmd_sched,	0 },
 #endif
-#if defined HAVE_LIBELF_SUPPORT && defined CONFIG_BUILTIN_PROBE
+#if defined CONFIG_LIBELF && defined CONFIG_BUILTIN_PROBE
 	{ "probe",	cmd_probe,	0 },
 #endif
 #ifdef CONFIG_BUILTIN_KMEM
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 5d84ffc..a8dbdc2 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -30,7 +30,7 @@ do
      echo "#endif"
 done
 
-echo "#ifdef HAVE_LIBELF_SUPPORT"
+echo "#ifdef CONFIG_LIBELF"
 sed -n -e 's/^perf-\([^ 	]*\)[ 	].* full.*/\1/p' $1/command-list.txt |
 sort |
 while read cmd
@@ -45,5 +45,5 @@ do
      }' "$1/Documentation/perf-$cmd.txt"
      echo "#endif"
 done
-echo "#endif /* HAVE_LIBELF_SUPPORT */"
+echo "#endif /* CONFIG_LIBELF */"
 echo "};"
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 25c571f..af3836f 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -1,3 +1,4 @@
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include <errno.h>
 #include <inttypes.h>
@@ -269,7 +270,7 @@ int map__load(struct map *map, symbol_filter_t filter)
 		pr_warning(", continuing without symbols\n");
 		return -1;
 	} else if (nr == 0) {
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 		const size_t len = strlen(name);
 		const size_t real_len = len - sizeof(DSO__DELETED);
 
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 6864661..1256595 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -5,12 +5,13 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "generated/autoconf.h"
 #include "symbol.h"
 #include "vdso.h"
 #include <symbol/kallsyms.h>
 #include "debug.h"
 
-#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
+#ifndef CONFIG_LIBELF_GETPHDRNUM
 static int elf_getphdrnum(Elf *elf, size_t *dst)
 {
 	GElf_Ehdr gehdr;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 508d317..69261fd 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -16,7 +16,7 @@
 #include "build-id.h"
 #include "event.h"
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 #include <libelf.h>
 #include <gelf.h>
 #endif
@@ -56,13 +56,13 @@ static inline char *bfd_demangle(void __maybe_unused *v,
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
  * for newer versions we can use mmap to reduce memory usage:
  */
-#ifdef HAVE_LIBELF_MMAP_SUPPORT
+#ifdef CONFIG_LIBELF_MMAP
 # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
 #else
 # define PERF_ELF_C_READ_MMAP ELF_C_READ
 #endif
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
 				GElf_Shdr *shp, const char *name, size_t *idx);
 #endif
@@ -208,7 +208,7 @@ struct symsrc {
 	int fd;
 	enum dso_binary_type type;
 
-#ifdef HAVE_LIBELF_SUPPORT
+#ifdef CONFIG_LIBELF
 	Elf *elf;
 	GElf_Ehdr ehdr;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 10/13] perf kbuild: remove legacy libdwarf-related build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (9 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 09/13] perf kbuild: remove legacy libelf-related " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 11/13] perf kbuild: remove legacy script-related " Alexis Berlemont
                             ` (2 subsequent siblings)
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_DWARF (replaced by CONFIG_LIBDWARF)
Remove HAVE_DWARF_SUPPORT (replaced by CONFIG_LIBDWARF)
---
 tools/perf/Kconfig                    |  44 +++++++--
 tools/perf/arch/arm/Makefile          |   4 +-
 tools/perf/arch/powerpc/Makefile      |   2 +-
 tools/perf/arch/s390/Makefile         |   2 +-
 tools/perf/arch/sh/Makefile           |   2 +-
 tools/perf/arch/sparc/Makefile        |   2 +-
 tools/perf/arch/x86/Kbuild            |   1 +
 tools/perf/arch/x86/Makefile          |   8 +-
 tools/perf/arch/x86/tests/Kbuild      |   2 +
 tools/perf/arch/x86/util/Kbuild       |   3 +-
 tools/perf/builtin-probe.c            |  15 ++--
 tools/perf/builtin-record.c           |  10 +--
 tools/perf/config/Makefile            | 165 +++++++++++++++++++---------------
 tools/perf/config/Makefile.fix-config |   8 --
 tools/perf/config/Makefile.fix-legacy |   4 -
 tools/perf/tests/builtin-test.c       |   3 +-
 tools/perf/tests/tests.h              |   4 +-
 tools/perf/util/Kbuild                |   8 +-
 tools/perf/util/include/dwarf-regs.h  |   4 +-
 tools/perf/util/probe-event.c         |   6 +-
 tools/perf/util/probe-finder.h        |   5 +-
 tools/perf/util/unwind-libunwind.c    |   5 +-
 tools/perf/util/unwind.h              |   7 +-
 23 files changed, 183 insertions(+), 131 deletions(-)
 create mode 100644 tools/perf/arch/x86/tests/Kbuild

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index c5733f0..a7e91db 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -263,7 +263,6 @@ choice
 	  these tasks, perf can rely on either the libelf library or a
 	  minimal builtin support.
 
-
 	config LIBELF
 	bool "elf"
 	---help---
@@ -294,15 +293,50 @@ config LIBDWARF
 	bool "Dwarf (libdwarf)"
 	default y
         ---help---
-	  libdwarf
+	  A library for parsing DWARF debug information.
+
+config LIBDWARF_DIR
+	string "libdwarf directory"
+	depends on LIBDWARF
+        ---help---
+	  Directory holding the libdwarf dependency (headers +
+	  libraries)
+
+config UNWIND
+        depends on LIBELF
+	bool "User space unwind callchains"
+	default y
+        ---help---
+	  Enable call-chain unwinding of user-space application.
+
+choice UNWIND_DEPS
+       prompt "Unwind dependency"
+       depends on UNWIND
+       default LIBUNWIND
 
 config LIBUNWIND
         depends on LIBELF
-	bool "User space libunwind callchains"
+	bool "Libunwind"
+        ---help---
+	  Rely on libunwind post unwind support to determine the
+	  call-chain of a user-space program. The library libunwind
+	  supports all the architectures.
+
+config LIBDWARF_UNWIND
+        depends on LIBDWARF
+	bool "Libdwarf unwind"
+        ---help---
+	  Rely on lidw DWARF post unwind support to determine the
+	  call-chain of a user-space program.
+
+endchoice
+
+config LIBUNWIND_DEBUG_FRAME
+        depends on LIBUNWIND
+	bool "libunwind debug frame"
 	default y
         ---help---
-	  The library libunwind provides a portable C API to determine
-	  the call-chain of a program.
+	  libunwind debug frame
 
 config LIBUNWIND_DIR
 	string "libunwind directory"
diff --git a/tools/perf/arch/arm/Makefile b/tools/perf/arch/arm/Makefile
index 09d6215..09ae44f 100644
--- a/tools/perf/arch/arm/Makefile
+++ b/tools/perf/arch/arm/Makefile
@@ -1,8 +1,8 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
 ifndef NO_LIBDW_DWARF_UNWIND
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index 744e629..3c57a2e 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sh/Makefile b/tools/perf/arch/sh/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sh/Makefile
+++ b/tools/perf/arch/sh/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/sparc/Makefile b/tools/perf/arch/sparc/Makefile
index 15130b5..74e617d 100644
--- a/tools/perf/arch/sparc/Makefile
+++ b/tools/perf/arch/sparc/Makefile
@@ -1,4 +1,4 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/arch/x86/Kbuild b/tools/perf/arch/x86/Kbuild
index 52fd6fa..3b9a068 100644
--- a/tools/perf/arch/x86/Kbuild
+++ b/tools/perf/arch/x86/Kbuild
@@ -1 +1,2 @@
 obj-y += util/
+obj-y += tests/
\ No newline at end of file
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 1641542..d37e641 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,14 +1,12 @@
-ifndef NO_DWARF
+ifeq ($(LIBDWARF), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifeq ($(LIBUNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o
 endif
-ifndef NO_LIBDW_DWARF_UNWIND
+ifeq ($(LIBDWARF_UNWIND), 1)
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o
-endif
-ifndef NO_DWARF_UNWIND
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o
 endif
diff --git a/tools/perf/arch/x86/tests/Kbuild b/tools/perf/arch/x86/tests/Kbuild
new file mode 100644
index 0000000..4717953
--- /dev/null
+++ b/tools/perf/arch/x86/tests/Kbuild
@@ -0,0 +1,2 @@
+obj-$(CONFIG_UNWIND) += regs_load.o
+obj-$(CONFIG_UNWIND) += dwarf-unwind.o
diff --git a/tools/perf/arch/x86/util/Kbuild b/tools/perf/arch/x86/util/Kbuild
index e033b94..0eed9c0 100644
--- a/tools/perf/arch/x86/util/Kbuild
+++ b/tools/perf/arch/x86/util/Kbuild
@@ -1,4 +1,5 @@
 obj-y += dwarf-regs.o
 obj-y += header.o
 obj-y += tsc.o
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index c63fa29..ddd4ef4 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "builtin.h"
 #include "util/util.h"
@@ -180,7 +181,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	if  (str && !params.target) {
 		if (!strcmp(opt->long_name, "exec"))
 			params.uprobes = true;
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		else if (!strcmp(opt->long_name, "module"))
 			params.uprobes = false;
 #endif
@@ -206,7 +207,7 @@ static int opt_set_target(const struct option *opt, const char *str,
 	return ret;
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 static int opt_show_lines(const struct option *opt __maybe_unused,
 			  const char *str, int unset __maybe_unused)
 {
@@ -303,7 +304,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
 		"perf probe [<options>] --del '[GROUP:]EVENT' ...",
 		"perf probe --list",
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"perf probe [<options>] --line 'LINEDESC'",
 		"perf probe [<options>] --vars 'PROBEPOINT'",
 #endif
@@ -317,7 +318,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
 		opt_del_probe_event),
 	OPT_CALLBACK('a', "add", NULL,
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT"
 		" [[NAME=]ARG ...]",
 #else
@@ -329,7 +330,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		"\t\tFUNC:\tFunction name\n"
 		"\t\tOFF:\tOffset from function entry (in byte)\n"
 		"\t\t%return:\tPut the probe at function return\n"
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 		"\t\tSRC:\tSource code path\n"
 		"\t\tRL:\tRelative line number from function entry.\n"
 		"\t\tAL:\tAbsolute line number in file.\n"
@@ -342,7 +343,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		opt_add_probe_event),
 	OPT_BOOLEAN('f', "force", &params.force_add, "forcibly add events"
 		    " with existing name"),
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	OPT_CALLBACK('L', "line", NULL,
 		     "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]",
 		     "Show source code lines.", opt_show_lines),
@@ -455,7 +456,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		return ret;
 	}
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 	if (params.show_lines) {
 		if (params.mod_events) {
 			pr_err("  Error: Don't use --line with"
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 42c127d..aafb786 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -617,7 +617,7 @@ error:
 	return ret;
 }
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 static int get_stack_size(char *str, unsigned long *_size)
 {
 	char *endptr;
@@ -643,7 +643,7 @@ static int get_stack_size(char *str, unsigned long *_size)
 	       max_size, str);
 	return -1;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_UNWIND */
 
 int record_parse_callchain(const char *arg, struct record_opts *opts)
 {
@@ -672,7 +672,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				       "needed for -g fp\n");
 			break;
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 		/* Dwarf style */
 		} else if (!strncmp(name, "dwarf", sizeof("dwarf"))) {
 			const unsigned long default_stack_dump_size = 8192;
@@ -688,7 +688,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
 				ret = get_stack_size(tok, &size);
 				opts->stack_dump_size = size;
 			}
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG_UNWIND */
 		} else {
 			pr_err("callchain: Unknown --call-graph option "
 			       "value: %s\n", arg);
@@ -791,7 +791,7 @@ static struct record record = {
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
 #else
 const char record_callchain_help[] = CALLCHAIN_HELP "fp";
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 95db69d..f4b133e 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -41,23 +41,16 @@ ifeq ($(ARCH),arm64)
   LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
 endif
 
-# So far there's only x86 and arm libdw unwind support merged in perf.
-# Disable it on all other architectures in case libdw unwind
-# support is detected in system. Add supported architectures
-# to the check.
-ifneq ($(ARCH),$(filter $(ARCH),x86 arm))
-  NO_LIBDW_DWARF_UNWIND := 1
-endif
-
 ifeq ($(LIBUNWIND_LIBS),)
-  NO_LIBUNWIND := 1
+  $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
+  LIBUNWIND = 1
   #
   # For linking with debug library, run like:
   #
   #   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
   #
-  ifdef LIBUNWIND_DIR
+  ifdef CONFIG_LIBUNWIND_DIR
     LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
     LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
   endif
@@ -74,12 +67,10 @@ ifeq ($(NO_PERF_REGS),0)
   CFLAGS += -DHAVE_PERF_REGS_SUPPORT
 endif
 
-ifndef NO_LIBELF
-  # for linking with debug library, run like:
-  # make DEBUG=1 LIBDW_DIR=/opt/libdw/
-  ifdef LIBDW_DIR
-    LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
-    LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
+ifdef CONFIG_LIBELF
+  ifdef CONFIG_LIBDWARF_DIR
+    LIBDW_CFLAGS  := -I$(CONFIG_LIBDWARF_DIR)/include
+    LIBDW_LDFLAGS := -L$(CONFIG_LIBDWARF_DIR)/lib
   endif
   FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
@@ -306,16 +297,30 @@ ifdef CONFIG_LIBELF
     endif
   else
     LIBELF = 1
-    ifndef NO_LIBDW_DWARF_UNWIND
-      ifneq ($(feature-libdw-dwarf-unwind),1)
-        NO_LIBDW_DWARF_UNWIND := 1
-        msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
-      endif
-    endif
-    ifneq ($(feature-dwarf), 1)
-      msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
-      NO_DWARF := 1
-    endif # Dwarf support
+    ifdef CONFIG_LIBDWARF
+      ifneq ($(feature-dwarf), 1)
+        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
+      else
+        LIBDWARF = 1
+      endif # Dwarf support
+      ifdef CONFIG_LIBDWARF_UNWIND
+        # So far there's only x86 and arm libdw unwind support merged
+        # in perf. Disable it on all other architectures in case libdw
+        # unwind support is detected in system. Add supported
+        # architectures to the check.
+        ifeq ($(ARCH),$(filter $(ARCH),x86 arm))
+          ifneq ($(feature-libdw-dwarf-unwind),1)
+            msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
+            $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+          else
+            LIBDWARF_UNWIND = 1
+          endif # Dwarf unwind support
+        else
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
+        endif # Arch x86
+      endif # CONFIG_LIBDWARF_UNWIND
+    endif  # CONFIG_LIBDWARF
   endif # libelf support
 endif # CONFIG_LIBELF
 
@@ -336,66 +341,80 @@ ifeq ($(LIBELF), 1)
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifndef NO_DWARF
+  ifeq ($(LIBDWARF), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
-      NO_DWARF := 1
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
     else
-      CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
+      CFLAGS += $(LIBDW_CFLAGS)
       LDFLAGS += $(LIBDW_LDFLAGS)
       EXTLIBS += -lelf -ldw
     endif # PERF_HAVE_DWARF_REGS
-  endif # NO_DWARF
+  endif # LIBDWARF
 endif # LIBELF
 
-ifndef NO_LIBUNWIND
-  ifneq ($(feature-libunwind), 1)
-    msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
-    NO_LIBUNWIND := 1
+ifdef CONFIG_UNWIND
+  # CONFIG_LIBUNWIND is the default choice; so, if it is not
+  # available, let's try another one
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifneq ($(feature-libunwind), 1)
+        LIBUNWIND = 0
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
+        ifeq ($(LIBDWARF_UNWIND), 1)
+          msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
+        else
+          msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+        endif # LIBDWARF_UNWIND
+      else # feature-libunwind OK
+        EXTLIBS += $(LIBUNWIND_LIBS)
+        CFLAGS += $(LIBUNWIND_CFLAGS)
+        LDFLAGS += $(LIBUNWIND_LDFLAGS)
+      endif # feature-libunwind
+    endif # LIBUNWIND
+  endif # CONFIG_LIBUNWIND
+
+  # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
+  # choice); so, we disable CONFIG_UNWIND if it is not available
+  ifdef CONFIG_LIBDWARF_UNWIND
+    ifneq ($(LIBDWARF_UNWIND), 1)
+      msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
+    endif
+  endif # CONFIG_LIBDWARF_UNWIND
+
+  # if libunwind is OK, let's check the option DEBUG_FRAME
+  ifdef CONFIG_LIBUNWIND
+    ifeq ($(LIBUNWIND), 1)
+      ifeq ($(ARCH),$(filter $(ARCH),arm arm64))
+        $(call feature_check,libunwind-debug-frame)
+        ifneq ($(feature-libunwind-debug-frame), 1)
+          msg := $(warning No debug_frame support found in libunwind);
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+        endif
+      else
+        # non-ARM has no dwarf_find_debug_frame() function:
+        $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND_DEBUG_FRAME)
+      endif
+    endif
   endif
-endif
 
-dwarf-post-unwind := 1
-dwarf-post-unwind-text := BUG
+dwarf-post-unwind = 0
+dwarf-post-unwind-text = BUG
 
-# setup DWARF post unwinder
-ifdef NO_LIBUNWIND
-  ifdef NO_LIBDW_DWARF_UNWIND
-    msg := $(warning Disabling post unwind, no support found.);
-    dwarf-post-unwind := 0
-  else
-    dwarf-post-unwind-text := libdw
-  endif
-else
+ifeq ($(LIBUNWIND), 1)
+  dwarf-post-unwind := 1
   dwarf-post-unwind-text := libunwind
-  # Enable libunwind support by default.
-  ifndef NO_LIBDW_DWARF_UNWIND
-    NO_LIBDW_DWARF_UNWIND := 1
-  endif
-endif
-
-ifeq ($(dwarf-post-unwind),1)
-  CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
 else
-  NO_DWARF_UNWIND := 1
-endif
-
-ifndef NO_LIBUNWIND
-  ifeq ($(ARCH),$(filter $(ARCH),arm arm64))
-    $(call feature_check,libunwind-debug-frame)
-    ifneq ($(feature-libunwind-debug-frame), 1)
-      msg := $(warning No debug_frame support found in libunwind);
-      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
-    endif
-  else
-    # non-ARM has no dwarf_find_debug_frame() function:
-    CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
+  ifeq ($(LIBDWARF_UNWIND), 1)
+    dwarf-post-unwind := 1
+    dwarf-post-unwind-text := libdw
   endif
-  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
-  EXTLIBS += $(LIBUNWIND_LIBS)
-  CFLAGS  += $(LIBUNWIND_CFLAGS)
-  LDFLAGS += $(LIBUNWIND_LDFLAGS)
-endif
+endif # LIBUNWIND
+
+endif # CONFIG_UNWIND
 
 ifdef CONFIG_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
@@ -759,8 +778,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBBIONIC)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 99948b7..e63539f 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -19,12 +19,4 @@ dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
 endif
 endif
 
-# NO_LIBUNWIND
-ifdef CONFIG_LIBUNWIND
-ifdef NO_LIBUNWIND
-dummy := $(info Disabling CONFIG_LIBUNWIND)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBUNWIND)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 8568d37..20a4062 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -8,7 +8,3 @@ endif
 ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
-
-ifndef CONFIG_LIBUNWIND
-NO_LIBUNWIND := 1
-endif
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 6f8b01b..608c9ab 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -5,6 +5,7 @@
  */
 #include <unistd.h>
 #include <string.h>
+#include "generated/autoconf.h"
 #include "builtin.h"
 #include "intlist.h"
 #include "tests.h"
@@ -126,7 +127,7 @@ static struct test {
 		.func = test__parse_no_sample_id_all,
 	},
 #if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 	{
 		.desc = "Test dwarf unwind",
 		.func = test__dwarf_unwind,
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index ed64790..bcc860d 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -1,6 +1,8 @@
 #ifndef TESTS_H
 #define TESTS_H
 
+#include "generated/autoconf.h"
+
 #define TEST_ASSERT_VAL(text, cond)					 \
 do {									 \
 	if (!(cond)) {							 \
@@ -50,7 +52,7 @@ int test__hists_output(void);
 int test__hists_cumulate(void);
 
 #if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_LIBDWARF_UNWIND
 struct thread;
 struct perf_sample;
 int test__arch_unwind_sample(struct perf_sample *sample,
diff --git a/tools/perf/util/Kbuild b/tools/perf/util/Kbuild
index 4ddd43d..6e02080 100644
--- a/tools/perf/util/Kbuild
+++ b/tools/perf/util/Kbuild
@@ -51,12 +51,14 @@ obj-y += symbol.o
 obj-y += perf_regs.o
 
 
-obj-$(CONFIG_LIBUNWIND) += unwind.o
+obj-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+obj-$(CONFIG_LIBDWARF_UNWIND) += unwind-libdw.o
 
 obj-$(CONFIG_LIBELF) += symbol-elf.o
-obj-$(CONFIG_LIBELF) += dwarf-aux.o
 obj-$(CONFIG_LIBELF) += probe-event.o
-obj-$(CONFIG_LIBELF) += probe-finder.o
+
+obj-$(CONFIG_LIBDWARF) += dwarf-aux.o
+obj-$(CONFIG_LIBDWARF) += probe-finder.o
 
 obj-$(CONFIG_LIBELF_MINIMAL) += symbol-minimal.o
 
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h
index 8f14965..93cd69c 100644
--- a/tools/perf/util/include/dwarf-regs.h
+++ b/tools/perf/util/include/dwarf-regs.h
@@ -1,7 +1,9 @@
 #ifndef _PERF_DWARF_REGS_H_
 #define _PERF_DWARF_REGS_H_
 
-#ifdef HAVE_DWARF_SUPPORT
+#include "generated/autoconf.h"
+
+#ifdef CONFIG_LIBDWARF
 const char *get_arch_regstr(unsigned int n);
 #endif
 
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9a0a183..b0120dd 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -32,6 +32,7 @@
 #include <limits.h>
 #include <elf.h>
 
+#include "generated/autoconf.h"
 #include "util.h"
 #include "event.h"
 #include "strlist.h"
@@ -255,8 +256,7 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
 		clear_probe_trace_event(tevs + i);
 }
 
-#ifdef HAVE_DWARF_SUPPORT
-
+#ifdef CONFIG_LIBDWARF
 /* Open new debuginfo of given module */
 static struct debuginfo *open_debuginfo(const char *module)
 {
@@ -791,7 +791,7 @@ out:
 	return ret;
 }
 
-#else	/* !HAVE_DWARF_SUPPORT */
+#else	/* !CONFIG_LIBDWARF */
 
 static int
 find_perf_probe_point_from_dwarf(struct probe_trace_point *tp __maybe_unused,
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 92590b2..13cb054 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -2,6 +2,7 @@
 #define _PROBE_FINDER_H
 
 #include <stdbool.h>
+#include "generated/autoconf.h"
 #include "util.h"
 #include "intlist.h"
 #include "probe-event.h"
@@ -16,7 +17,7 @@ static inline int is_c_varname(const char *name)
 	return isalpha(name[0]) || name[0] == '_';
 }
 
-#ifdef HAVE_DWARF_SUPPORT
+#ifdef CONFIG_LIBDWARF
 
 #include "dwarf-aux.h"
 
@@ -107,6 +108,6 @@ struct line_finder {
 	int			found;
 };
 
-#endif /* HAVE_DWARF_SUPPORT */
+#endif /* CONFIG_LIBDWARF */
 
 #endif /*_PROBE_FINDER_H */
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 25578b9..8325e158 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
+#include "generated/autoconf.h"
 #include "thread.h"
 #include "session.h"
 #include "perf_regs.h"
@@ -259,7 +260,7 @@ static int read_unwind_spec_eh_frame(struct dso *dso, struct machine *machine,
 	return ret;
 }
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 static int read_unwind_spec_debug_frame(struct dso *dso,
 					struct machine *machine, u64 *offset)
 {
@@ -317,7 +318,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
 						 need_unwind_info, arg);
 	}
 
-#ifndef NO_LIBUNWIND_DEBUG_FRAME
+#ifdef CONFIG_LIBUNWIND_DEBUG_FRAME
 	/* Check the .debug_frame section for unwinding info */
 	if (!read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
 		memset(&di, 0, sizeof(di));
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index f030612..c6b96e3 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -2,6 +2,7 @@
 #define __UNWIND_H
 
 #include <linux/types.h>
+#include "generated/autoconf.h"
 #include "event.h"
 #include "symbol.h"
 
@@ -13,13 +14,13 @@ struct unwind_entry {
 
 typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
+#ifdef CONFIG_UNWIND
 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 			struct machine *machine,
 			struct thread *thread,
 			struct perf_sample *data, int max_stack);
 /* libunwind specific */
-#ifdef HAVE_LIBUNWIND_SUPPORT
+#ifdef CONFIG_LIBUNWIND
 int libunwind__arch_reg_id(int regnum);
 #endif
 #else
@@ -33,5 +34,5 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
 {
 	return 0;
 }
-#endif /* HAVE_DWARF_UNWIND_SUPPORT */
+#endif /* CONFIG__UNWIND */
 #endif /* __UNWIND_H */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 11/13] perf kbuild: remove legacy script-related build variables
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (10 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 10/13] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:47           ` [PATCH 12/13] perf kbuild: final cosmetic changes Alexis Berlemont
  2014-06-24 22:48           ` [PATCH 13/13] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Remove NO_LIBPERL (replaced by CONFIG_LIBPERL)
Remove NO_LIBPYTHON (replaced by CONFIG_LIBPYTHON)
---
 tools/perf/builtin-script.c             |  6 ++--
 tools/perf/config/Makefile              | 51 +++++++++++----------------------
 tools/perf/config/Makefile.fix-config   | 16 -----------
 tools/perf/config/Makefile.fix-legacy   |  8 ------
 tools/perf/util/trace-event-scripting.c | 13 +++++----
 5 files changed, 27 insertions(+), 67 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9e9c91f..3e59b24 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1,3 +1,5 @@
+#include "generated/autoconf.h"
+
 #include "builtin.h"
 
 #include "perf.h"
@@ -1362,11 +1364,11 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
 			 lang_dirent.d_name);
-#ifdef NO_LIBPERL
+#ifndef CONFIG_LIBPERL
 		if (strstr(lang_path, "perl"))
 			continue;
 #endif
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 		if (strstr(lang_path, "python"))
 			continue;
 #endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f4b133e..0f8fa99 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -454,9 +454,7 @@ endif
 grep-libs  = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
-ifdef NO_LIBPERL
-  CFLAGS += -DNO_LIBPERL
-else
+ifdef CONFIG_LIBPERL
   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
@@ -464,9 +462,8 @@ else
   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
 
   ifneq ($(feature-libperl), 1)
-    CFLAGS += -DNO_LIBPERL
-    NO_LIBPERL := 1
     msg := $(warning Missing perl devel files. Disabling perl scripting support, consider installing perl-ExtUtils-Embed);
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPERL)
   else
     LDFLAGS += $(PERL_EMBED_LDFLAGS)
     EXTLIBS += $(PERL_EMBED_LIBADD)
@@ -481,27 +478,24 @@ ifdef CONFIG_TIMERFD
   endif
 endif
 
-disable-python = $(eval $(disable-python_code))
-define disable-python_code
-  CFLAGS += -DNO_LIBPYTHON
-  $(if $(1),$(warning No $(1) was found))
-  $(warning Python support will not be built)
-  NO_LIBPYTHON := 1
-endef
+ifdef CONFIG_LIBPYTHON
 
-override PYTHON := \
-  $(call get-executable-or-default,PYTHON,python)
+  disable-python = $(eval $(disable-python_code))
+  define disable-python_code
+    $(if $(1),$(warning No $(1) was found))
+    $(warning Python support will not be built)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPYTHON)
+  endef
 
-ifndef PYTHON
-  $(call disable-python,python interpreter)
-else
+  override PYTHON := \
+    $(call get-executable-or-default,PYTHON,python)
 
-  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
-
-  ifdef NO_LIBPYTHON
-    $(call disable-python)
+  ifndef PYTHON
+    $(call disable-python,python interpreter)
   else
 
+    PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
     override PYTHON_CONFIG := \
       $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
 
@@ -522,18 +516,7 @@ else
       else
 
         ifneq ($(feature-libpython-version), 1)
-          $(warning Python 3 is not yet supported; please set)
-          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
-          $(warning If you also have Python 2 installed, then)
-          $(warning try something like:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make PYTHON=python2)
-          $(warning $(and ,))
-          $(warning Otherwise, disable Python support entirely:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make NO_LIBPYTHON=1)
-          $(warning $(and ,))
-          $(error   $(and ,))
+          $(call disable-python,python2 interpreter)
         else
           LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
           EXTLIBS += $(PYTHON_EMBED_LIBADD)
@@ -776,8 +759,6 @@ all:
 	$(call store,PERL_EMBED_CCOPTS)
 	$(call store,CONFIG_X86_64)
 	$(call store,NO_LIBUNWIND)
-	$(call store,NO_LIBPERL)
-	$(call store,NO_LIBPYTHON)
 	$(call store,ETC_PERFCONFIG_SQ)
 	$(call store,DESTDIR_SQ)
 	$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index e63539f..3f0e33e 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,20 +3,4 @@ include $(KCONFIG_CONFIG)
 
 CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
 
-# NO_LIBPERL
-ifdef CONFIG_LIBPERL
-ifdef NO_LIBPERL
-dummy := $(info Disabling CONFIG_LIBPERL)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPERL)
-endif
-endif
-
-# NO_LIBPYTHON
-ifdef CONFIG_LIBPYTHON
-ifdef NO_LIBPYTHON
-dummy := $(info Disabling CONFIG_LIBPYTHON)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
-endif
-endif
-
 all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 20a4062..431c9bf 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,10 +1,2 @@
 
 include $(KCONFIG_CONFIG)
-
-ifndef CONFIG_LIBPERL
-NO_LIBPERL := 1
-endif
-
-ifndef CONFIG_LIBPYTHON
-NO_LIBPYTHON := 1
-endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 57aaccc..4a70ef7 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <errno.h>
 
+#include "generated/autoconf.h"
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
@@ -93,7 +94,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
 void setup_python_scripting(void)
 {
 	register_python_scripting(&python_scripting_unsupported_ops);
@@ -156,16 +157,16 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
 	scripting_context = malloc(sizeof(struct scripting_context));
 }
 
-#ifdef NO_LIBPERL
+#ifdef CONFIG_LIBPERL
+extern struct scripting_ops perl_scripting_ops;
+
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_unsupported_ops);
+	register_perl_scripting(&perl_scripting_ops);
 }
 #else
-extern struct scripting_ops perl_scripting_ops;
-
 void setup_perl_scripting(void)
 {
-	register_perl_scripting(&perl_scripting_ops);
+	register_perl_scripting(&perl_scripting_unsupported_ops);
 }
 #endif
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 12/13] perf kbuild: final cosmetic changes
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (11 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 11/13] perf kbuild: remove legacy script-related " Alexis Berlemont
@ 2014-06-24 22:47           ` Alexis Berlemont
  2014-06-24 22:48           ` [PATCH 13/13] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

* Correctly rename internal makefile variables
* Remove makefiles in tools/perf/config which became empty and useless
* Remove builtin-cmds.h
---
 tools/perf/Makefile.kbuild            |  1 -
 tools/perf/arch/x86/Makefile          |  2 +-
 tools/perf/builtin-cmds.h             |  6 -----
 tools/perf/builtin-help.c             |  2 +-
 tools/perf/builtin-lock.c             |  2 +-
 tools/perf/builtin-sched.c            |  2 +-
 tools/perf/config/Makefile            | 46 +++++++++++++++++------------------
 tools/perf/config/Makefile.fix-config |  6 -----
 tools/perf/config/Makefile.fix-legacy |  2 --
 tools/perf/perf.c                     |  2 +-
 10 files changed, 28 insertions(+), 43 deletions(-)
 delete mode 100644 tools/perf/builtin-cmds.h
 delete mode 100644 tools/perf/config/Makefile.fix-config
 delete mode 100644 tools/perf/config/Makefile.fix-legacy

diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 7b7641c..127c090 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -155,7 +155,6 @@ $(CONFIG_DETECTED): $(KCONFIG_CONFIG)
 # no need to include auto.conf.cmd, because .config
 # is the only dependency here
 $(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CONFIG_DETECTED)
-	$(Q)$(MAKE) -f $(src-perf)/config/Makefile.fix-config
 	$(Q)mkdir -p $(obj-perf)/include/config
 	$(Q)mkdir -p $(obj-perf)/include/generated
 	$(Q)$(MAKE) -s $(build)=scripts/kconfig silentoldconfig
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index d37e641..f95187e 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,4 +1,4 @@
-ifeq ($(LIBDWARF), 1)
+ifeq ($(config-libdwarf), 1)
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
diff --git a/tools/perf/builtin-cmds.h b/tools/perf/builtin-cmds.h
deleted file mode 100644
index 863727f..0000000
--- a/tools/perf/builtin-cmds.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef BUILTIN_CMDS_H
-#define BUILTIN_CMDS_H
-
-#include "generated/autoconf.h"
-
-#endif /* BUILTIN_CMDS_H */
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index b6c78a6..29bce52 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -3,11 +3,11 @@
  *
  * Builtin help command
  */
+#include "generated/autoconf.h"
 #include "perf.h"
 #include "util/cache.h"
 #include "builtin.h"
 #include "util/exec_cmd.h"
-#include "builtin-cmds.h"
 #include "common-cmds.h"
 #include "util/parse-options.h"
 #include "util/run-command.h"
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index f5404dc..faba219 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1,5 +1,5 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
-#include "builtin-cmds.h"
 #include "perf.h"
 
 #include "util/evlist.h"
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 80515e0..9a74b7ab3 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1,5 +1,5 @@
+#include "generated/autoconf.h"
 #include "builtin.h"
-#include "builtin-cmds.h"
 #include "perf.h"
 
 #include "util/util.h"
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 0f8fa99..8c0439d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -41,10 +41,14 @@ ifeq ($(ARCH),arm64)
   LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
 endif
 
+ifdef KCONFIG_CONFIG
+include $(KCONFIG_CONFIG)
+endif
+
 ifeq ($(LIBUNWIND_LIBS),)
   $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
 else
-  LIBUNWIND = 1
+  config-libunwind = 1
   #
   # For linking with debug library, run like:
   #
@@ -76,10 +80,6 @@ ifdef CONFIG_LIBELF
   FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
 endif
 
-ifdef KCONFIG_CONFIG
-include $(src-perf)/config/Makefile.fix-legacy
-endif
-
 # include ARCH specific config
 -include $(src-perf)/arch/$(ARCH)/Makefile
 
@@ -279,12 +279,12 @@ endif
 ifdef CONFIG_LIBELF
   ifeq ($(feature-libelf), 0)
     ifeq ($(feature-glibc), 1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
     ifeq ($(BIONIC),1)
-      LIBC_SUPPORT := 1
+      config-libc := 1
     endif
-    ifeq ($(LIBC_SUPPORT),1)
+    ifeq ($(config-libc),1)
       msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF)
       $(shell $(KCONFIG_SCRIPT) -E CONFIG_LIBELF_MINIMAL)
@@ -296,13 +296,13 @@ ifdef CONFIG_LIBELF
       endif
     endif
   else
-    LIBELF = 1
+    config-libelf = 1
     ifdef CONFIG_LIBDWARF
       ifneq ($(feature-dwarf), 1)
         msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
       else
-        LIBDWARF = 1
+        config-libdwarf = 1
       endif # Dwarf support
       ifdef CONFIG_LIBDWARF_UNWIND
         # So far there's only x86 and arm libdw unwind support merged
@@ -314,7 +314,7 @@ ifdef CONFIG_LIBELF
             msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set CONFIG_LIBDWARF_DIR);
             $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
           else
-            LIBDWARF_UNWIND = 1
+            config-libdwarf-unwind = 1
           endif # Dwarf unwind support
         else
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF_UNWIND)
@@ -324,7 +324,7 @@ ifdef CONFIG_LIBELF
   endif # libelf support
 endif # CONFIG_LIBELF
 
-ifeq ($(LIBELF), 1)
+ifeq ($(config-libelf), 1)
 
   ifdef CONFIG_LIBELF_MMAP
     ifneq ($(feature-libelf-mmap), 1)
@@ -332,16 +332,16 @@ ifeq ($(LIBELF), 1)
     endif
   endif
 
-  ifdef CONFIG_LIBELF_MMAP
+  ifdef CONFIG_LIBELF_GETPHDRNUM
     ifneq ($(feature-libelf-getphdrnum), 1)
-      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_MMAP)
+      $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBELF_GETPHDRNUM)
     endif
   endif
 
   # include ARCH specific config
   -include $(src-perf)/arch/$(ARCH)/Makefile
 
-  ifeq ($(LIBDWARF), 1)
+  ifeq ($(config-libdwarf), 1)
     ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
       msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBDWARF)
@@ -357,17 +357,17 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBUNWIND is the default choice; so, if it is not
   # available, let's try another one
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifneq ($(feature-libunwind), 1)
-        LIBUNWIND = 0
+        config-libunwind = 0
         $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBUNWIND)
-        ifeq ($(LIBDWARF_UNWIND), 1)
+        ifeq ($(config-libdwarf-unwind), 1)
           msg := $(warning No libunwind found, post unwind will rely on libdwarf-unwind. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBDWARF_UNWIND)
         else
           msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
           $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
-        endif # LIBDWARF_UNWIND
+        endif # config-libdwarf-unwind
       else # feature-libunwind OK
         EXTLIBS += $(LIBUNWIND_LIBS)
         CFLAGS += $(LIBUNWIND_CFLAGS)
@@ -379,7 +379,7 @@ ifdef CONFIG_UNWIND
   # CONFIG_LIBDWARF_UNWIND is not the default choice (so the user's
   # choice); so, we disable CONFIG_UNWIND if it is not available
   ifdef CONFIG_LIBDWARF_UNWIND
-    ifneq ($(LIBDWARF_UNWIND), 1)
+    ifneq ($(config-libdwarf-unwind), 1)
       msg := $(warning Disabling post unwing because (libdwarf-unwind is not available));
       $(shell $(KCONFIG_SCRIPT) -d CONFIG_UNWIND)
     endif
@@ -387,7 +387,7 @@ ifdef CONFIG_UNWIND
 
   # if libunwind is OK, let's check the option DEBUG_FRAME
   ifdef CONFIG_LIBUNWIND
-    ifeq ($(LIBUNWIND), 1)
+    ifeq ($(config-libunwind), 1)
       ifeq ($(ARCH),$(filter $(ARCH),arm arm64))
         $(call feature_check,libunwind-debug-frame)
         ifneq ($(feature-libunwind-debug-frame), 1)
@@ -404,11 +404,11 @@ ifdef CONFIG_UNWIND
 dwarf-post-unwind = 0
 dwarf-post-unwind-text = BUG
 
-ifeq ($(LIBUNWIND), 1)
+ifeq ($(config-libunwind), 1)
   dwarf-post-unwind := 1
   dwarf-post-unwind-text := libunwind
 else
-  ifeq ($(LIBDWARF_UNWIND), 1)
+  ifeq ($(config-libdwarf-unwind), 1)
     dwarf-post-unwind := 1
     dwarf-post-unwind-text := libdw
   endif
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
deleted file mode 100644
index 3f0e33e..0000000
--- a/tools/perf/config/Makefile.fix-config
+++ /dev/null
@@ -1,6 +0,0 @@
-include $(CONFIG_DETECTED)
-include $(KCONFIG_CONFIG)
-
-CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)
-
-all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
deleted file mode 100644
index 431c9bf..0000000
--- a/tools/perf/config/Makefile.fix-legacy
+++ /dev/null
@@ -1,2 +0,0 @@
-
-include $(KCONFIG_CONFIG)
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 56cd4a2..e97d6fc 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -6,8 +6,8 @@
  * This is the main hub from which the sub-commands (perf stat,
  * perf top, perf record, perf report, etc.) are started.
  */
+#include "generated/autoconf.h"
 #include "builtin.h"
-#include "builtin-cmds.h"
 
 #include "util/exec_cmd.h"
 #include "util/cache.h"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

* [PATCH 13/13] perf kbuild: add generated Kconfig build-test cases
  2014-06-04 11:12         ` Alexis Berlemont
                             ` (12 preceding siblings ...)
  2014-06-24 22:47           ` [PATCH 12/13] perf kbuild: final cosmetic changes Alexis Berlemont
@ 2014-06-24 22:48           ` Alexis Berlemont
  13 siblings, 0 replies; 98+ messages in thread
From: Alexis Berlemont @ 2014-06-24 22:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexis Berlemont, jolsa, dsahern, mingo, sam, mmarek, namhyung

Thanks to the python module kconfiglib, we were able to generate build
configurations. The set is, of course, not exhaustive but for each
option, all the possible states are tested.
---
 tools/perf/MANIFEST                                |  1 +
 tools/perf/Makefile.kbuild                         |  2 +-
 tools/perf/tests/configs/MINIMAL_config            | 60 +++++++++++++++++++
 tools/perf/tests/configs/NO_BACKTRACE_config       | 69 +++++++++++++++++++++
 .../perf/tests/configs/NO_BUILTIN_ANNOTATE_config  | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_BENCH_config   | 69 +++++++++++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_CACHE_config  | 69 +++++++++++++++++++++
 .../tests/configs/NO_BUILTIN_BUILDID_LIST_config   | 68 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_DIFF_config    | 68 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config  | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_HELP_config    | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_INJECT_config  | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KMEM_config    | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_KVM_config     | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LIST_config    | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_LOCK_config    | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_MEM_config     | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_PROBE_config   | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_RECORD_config  | 60 +++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_REPORT_config  | 65 ++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCHED_config   | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config  | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_STAT_config    | 68 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TEST_config    | 69 +++++++++++++++++++++
 .../perf/tests/configs/NO_BUILTIN_TIMECHART_config | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TOP_config     | 68 +++++++++++++++++++++
 tools/perf/tests/configs/NO_BUILTIN_TRACE_config   | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_DEMANGLE_config        | 67 +++++++++++++++++++++
 tools/perf/tests/configs/NO_GTK2_config            | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBAUDIT_config        | 68 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBDWARF_config        | 67 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBELF_MMAP_config     | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBGTK2_config         | 67 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBNUMA_config         | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBPERL_config         | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBPYTHON_config       | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_LIBSLANG_config        | 68 +++++++++++++++++++++
 .../tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config  | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_STDIO_config           | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_TIMERFD_config         | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_TUI_config             | 69 +++++++++++++++++++++
 tools/perf/tests/configs/NO_UNWIND_config          | 65 ++++++++++++++++++++
 tools/perf/tests/configs/REF_config                | 69 +++++++++++++++++++++
 tools/perf/tests/generate_configs.py               | 33 ++++++++++
 tools/perf/tests/make                              | 70 +++++++---------------
 46 files changed, 2915 insertions(+), 51 deletions(-)
 create mode 100644 tools/perf/tests/configs/MINIMAL_config
 create mode 100644 tools/perf/tests/configs/NO_BACKTRACE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BENCH_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_DIFF_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_HELP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_INJECT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KMEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_KVM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LIST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_LOCK_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_MEM_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_PROBE_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_RECORD_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_REPORT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCHED_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_STAT_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TEST_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TOP_config
 create mode 100644 tools/perf/tests/configs/NO_BUILTIN_TRACE_config
 create mode 100644 tools/perf/tests/configs/NO_DEMANGLE_config
 create mode 100644 tools/perf/tests/configs/NO_GTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBAUDIT_config
 create mode 100644 tools/perf/tests/configs/NO_LIBDWARF_config
 create mode 100644 tools/perf/tests/configs/NO_LIBELF_MMAP_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
 create mode 100644 tools/perf/tests/configs/NO_LIBGTK2_config
 create mode 100644 tools/perf/tests/configs/NO_LIBNUMA_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPERL_config
 create mode 100644 tools/perf/tests/configs/NO_LIBPYTHON_config
 create mode 100644 tools/perf/tests/configs/NO_LIBSLANG_config
 create mode 100644 tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
 create mode 100644 tools/perf/tests/configs/NO_STDIO_config
 create mode 100644 tools/perf/tests/configs/NO_TIMERFD_config
 create mode 100644 tools/perf/tests/configs/NO_TUI_config
 create mode 100644 tools/perf/tests/configs/NO_UNWIND_config
 create mode 100644 tools/perf/tests/configs/REF_config
 create mode 100644 tools/perf/tests/generate_configs.py

diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index 45da209..c7e82c0 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -1,3 +1,4 @@
+scripts
 tools/perf
 tools/scripts
 tools/lib/traceevent
diff --git a/tools/perf/Makefile.kbuild b/tools/perf/Makefile.kbuild
index 127c090..e5cda88 100644
--- a/tools/perf/Makefile.kbuild
+++ b/tools/perf/Makefile.kbuild
@@ -258,7 +258,7 @@ $(obj-perf)/common-cmds.h: $(src-perf)/util/generate-cmdlist.sh $(src-perf)/comm
 PHONY += all scripts_basic
 
 $(obj-perf)/built-in.o: $(obj-perf)/common-cmds.h FORCE
-	$(Q)$(MAKE) $(build)=tools/perf
+	$(Q)$(MAKE) LDFLAGS="" $(build)=tools/perf
 
 LIBS = -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
diff --git a/tools/perf/tests/configs/MINIMAL_config b/tools/perf/tests/configs/MINIMAL_config
new file mode 100644
index 0000000..6e04dc6
--- /dev/null
+++ b/tools/perf/tests/configs/MINIMAL_config
@@ -0,0 +1,60 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# The perf configuration
+#
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+# CONFIG_LIBAUDIT is not set
+# CONFIG_LIBGTK2 is not set
+# CONFIG_LIBPERL is not set
+# CONFIG_LIBPYTHON is not set
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+# CONFIG_LIBBFD is not set
+# CONFIG_LIBIBERTY_ONLY is not set
+# CONFIG_LIBELF is not set
+CONFIG_LIBELF_MINIMAL=y
+# CONFIG_LIBUNWIND is not set
+# CONFIG_LIBDWARF_UNWIND is not set
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BACKTRACE_config b/tools/perf/tests/configs/NO_BACKTRACE_config
new file mode 100644
index 0000000..ea186e2
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BACKTRACE_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+# CONFIG_BACKTRACE is not set
diff --git a/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
new file mode 100644
index 0000000..5f87818
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_ANNOTATE_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+# CONFIG_BUILTIN_ANNOTATE is not set
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BENCH_config b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
new file mode 100644
index 0000000..1597197
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BENCH_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+# CONFIG_BUILTIN_BENCH is not set
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
new file mode 100644
index 0000000..6d3c29f
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_CACHE_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+# CONFIG_BUILTIN_BUILDID_CACHE is not set
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
new file mode 100644
index 0000000..a4d048a
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_BUILDID_LIST_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+# CONFIG_BUILTIN_BUILDID_LIST is not set
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_DIFF_config b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
new file mode 100644
index 0000000..c780d43
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_DIFF_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+# CONFIG_BUILTIN_DIFF is not set
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
new file mode 100644
index 0000000..95f11fb
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_EVLIST_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+# CONFIG_BUILTIN_EVLIST is not set
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_HELP_config b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
new file mode 100644
index 0000000..76753a9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_HELP_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+# CONFIG_BUILTIN_HELP is not set
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_INJECT_config b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
new file mode 100644
index 0000000..2052081
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_INJECT_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+# CONFIG_BUILTIN_INJECT is not set
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KMEM_config b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
new file mode 100644
index 0000000..bda50b7
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KMEM_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+# CONFIG_BUILTIN_KMEM is not set
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_KVM_config b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
new file mode 100644
index 0000000..4dee035
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_KVM_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+# CONFIG_BUILTIN_KVM is not set
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LIST_config b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
new file mode 100644
index 0000000..e58f913
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LIST_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+# CONFIG_BUILTIN_LIST is not set
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_LOCK_config b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
new file mode 100644
index 0000000..f8f362d
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_LOCK_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+# CONFIG_BUILTIN_LOCK is not set
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_MEM_config b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
new file mode 100644
index 0000000..d1288e94
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_MEM_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+# CONFIG_BUILTIN_MEM is not set
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_PROBE_config b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
new file mode 100644
index 0000000..7d51c98
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_PROBE_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+# CONFIG_BUILTIN_PROBE is not set
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_RECORD_config b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
new file mode 100644
index 0000000..8e15038
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_RECORD_config
@@ -0,0 +1,60 @@
+
+#
+# Built-in commands
+#
+# CONFIG_BUILTIN_RECORD is not set
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_REPORT_config b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
new file mode 100644
index 0000000..369e951
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_REPORT_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+# CONFIG_BUILTIN_REPORT is not set
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCHED_config b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
new file mode 100644
index 0000000..deda613
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCHED_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+# CONFIG_BUILTIN_SCHED is not set
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
new file mode 100644
index 0000000..fb8cd00
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_SCRIPT_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+# CONFIG_BUILTIN_SCRIPT is not set
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_STAT_config b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
new file mode 100644
index 0000000..b0d35f7
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_STAT_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+# CONFIG_BUILTIN_STAT is not set
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TEST_config b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
new file mode 100644
index 0000000..7270364
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TEST_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+# CONFIG_BUILTIN_TEST is not set
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
new file mode 100644
index 0000000..41d21f9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TIMECHART_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+# CONFIG_BUILTIN_TIMECHART is not set
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TOP_config b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
new file mode 100644
index 0000000..fa231f7
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TOP_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+# CONFIG_BUILTIN_TOP is not set
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_BUILTIN_TRACE_config b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
new file mode 100644
index 0000000..8ca377b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_BUILTIN_TRACE_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+# CONFIG_BUILTIN_TRACE is not set
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_DEMANGLE_config b/tools/perf/tests/configs/NO_DEMANGLE_config
new file mode 100644
index 0000000..e2a79e3
--- /dev/null
+++ b/tools/perf/tests/configs/NO_DEMANGLE_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+# CONFIG_DEMANGLE is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_GTK2_config b/tools/perf/tests/configs/NO_GTK2_config
new file mode 100644
index 0000000..a806529
--- /dev/null
+++ b/tools/perf/tests/configs/NO_GTK2_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+# CONFIG_GTK2 is not set
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBAUDIT_config b/tools/perf/tests/configs/NO_LIBAUDIT_config
new file mode 100644
index 0000000..57f2b8b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBAUDIT_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+# CONFIG_LIBAUDIT is not set
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBDWARF_config b/tools/perf/tests/configs/NO_LIBDWARF_config
new file mode 100644
index 0000000..fed5c65
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBDWARF_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+# CONFIG_LIBDWARF is not set
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBELF_MMAP_config b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
new file mode 100644
index 0000000..b774b34
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBELF_MMAP_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+# CONFIG_LIBELF_MMAP is not set
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
new file mode 100644
index 0000000..272087c
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_INFOBAR_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+# CONFIG_LIBGTK2_INFOBAR is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBGTK2_config b/tools/perf/tests/configs/NO_LIBGTK2_config
new file mode 100644
index 0000000..d4324ac
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBGTK2_config
@@ -0,0 +1,67 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+# CONFIG_LIBGTK2 is not set
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBNUMA_config b/tools/perf/tests/configs/NO_LIBNUMA_config
new file mode 100644
index 0000000..a3492dc
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBNUMA_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+# CONFIG_LIBNUMA is not set
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPERL_config b/tools/perf/tests/configs/NO_LIBPERL_config
new file mode 100644
index 0000000..e430e7e
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPERL_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+# CONFIG_LIBPERL is not set
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBPYTHON_config b/tools/perf/tests/configs/NO_LIBPYTHON_config
new file mode 100644
index 0000000..9bddfcf
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBPYTHON_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+# CONFIG_LIBPYTHON is not set
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBSLANG_config b/tools/perf/tests/configs/NO_LIBSLANG_config
new file mode 100644
index 0000000..deebd36
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBSLANG_config
@@ -0,0 +1,68 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+# CONFIG_LIBSLANG is not set
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
new file mode 100644
index 0000000..03bc63b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_LIBUNWIND_DEBUG_FRAME_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+# CONFIG_LIBUNWIND_DEBUG_FRAME is not set
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_STDIO_config b/tools/perf/tests/configs/NO_STDIO_config
new file mode 100644
index 0000000..48889d9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_STDIO_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+# CONFIG_STDIO is not set
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TIMERFD_config b/tools/perf/tests/configs/NO_TIMERFD_config
new file mode 100644
index 0000000..dace6d9
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TIMERFD_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+# CONFIG_TIMERFD is not set
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_TUI_config b/tools/perf/tests/configs/NO_TUI_config
new file mode 100644
index 0000000..55cd95b
--- /dev/null
+++ b/tools/perf/tests/configs/NO_TUI_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+# CONFIG_TUI is not set
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/NO_UNWIND_config b/tools/perf/tests/configs/NO_UNWIND_config
new file mode 100644
index 0000000..6a3fbc5
--- /dev/null
+++ b/tools/perf/tests/configs/NO_UNWIND_config
@@ -0,0 +1,65 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+# CONFIG_UNWIND is not set
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/configs/REF_config b/tools/perf/tests/configs/REF_config
new file mode 100644
index 0000000..30d1c3d
--- /dev/null
+++ b/tools/perf/tests/configs/REF_config
@@ -0,0 +1,69 @@
+
+#
+# Built-in commands
+#
+CONFIG_BUILTIN_RECORD=y
+CONFIG_BUILTIN_REPORT=y
+CONFIG_BUILTIN_STAT=y
+CONFIG_BUILTIN_TOP=y
+CONFIG_BUILTIN_TRACE=y
+CONFIG_BUILTIN_ANNOTATE=y
+CONFIG_BUILTIN_BENCH=y
+CONFIG_BUILTIN_BUILDID_CACHE=y
+CONFIG_BUILTIN_BUILDID_LIST=y
+CONFIG_BUILTIN_DIFF=y
+CONFIG_BUILTIN_EVLIST=y
+CONFIG_BUILTIN_HELP=y
+CONFIG_BUILTIN_INJECT=y
+CONFIG_BUILTIN_KMEM=y
+CONFIG_BUILTIN_KVM=y
+CONFIG_BUILTIN_LIST=y
+CONFIG_BUILTIN_LOCK=y
+CONFIG_BUILTIN_PROBE=y
+CONFIG_BUILTIN_SCHED=y
+CONFIG_BUILTIN_SCRIPT=y
+CONFIG_BUILTIN_TIMECHART=y
+CONFIG_BUILTIN_MEM=y
+CONFIG_BUILTIN_TEST=y
+
+#
+# GUI
+#
+CONFIG_STDIO=y
+CONFIG_TUI=y
+CONFIG_GTK2=y
+
+#
+# Libraries / Dependencies
+#
+CONFIG_LIBSLANG=y
+CONFIG_LIBAUDIT=y
+CONFIG_LIBGTK2=y
+CONFIG_LIBGTK2_INFOBAR=y
+CONFIG_LIBPERL=y
+CONFIG_LIBPYTHON=y
+CONFIG_TIMERFD=y
+CONFIG_ON_EXIT=y
+CONFIG_DEMANGLE=y
+CONFIG_LIBBFD=y
+# CONFIG_LIBIBERTY_ONLY is not set
+CONFIG_LIBELF=y
+# CONFIG_LIBELF_MINIMAL is not set
+CONFIG_LIBELF_MMAP=y
+CONFIG_LIBELF_GETPHDRNUM=y
+CONFIG_LIBDWARF=y
+CONFIG_LIBDWARF_DIR=""
+CONFIG_UNWIND=y
+CONFIG_LIBUNWIND=y
+# CONFIG_LIBDWARF_UNWIND is not set
+CONFIG_LIBUNWIND_DEBUG_FRAME=y
+CONFIG_LIBUNWIND_DIR=""
+CONFIG_LIBNUMA=y
+# CONFIG_BIONIC is not set
+
+#
+# Build
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PARSER is not set
+CONFIG_BACKTRACE=y
diff --git a/tools/perf/tests/generate_configs.py b/tools/perf/tests/generate_configs.py
new file mode 100644
index 0000000..c55a1c9
--- /dev/null
+++ b/tools/perf/tests/generate_configs.py
@@ -0,0 +1,33 @@
+import sys
+import itertools
+import kconfiglib
+
+# Load Kconfig pattern
+ref_config = kconfiglib.Config(sys.argv[1])
+
+# Generate defconfig (by default, all options are set to y)
+ref_config.write_config('REF_config')
+
+# Get all the symbols
+symbols = dict([(s.get_name(), s) for s in ref_config.get_symbols()])
+
+# Remove odd symbols
+symbols.pop('y', None)
+symbols.pop('m', None)
+symbols.pop('n', None)
+
+# Remove choice-related symbols
+choices = ref_config.get_choices()
+items = [c.get_items() for c in choices]
+names = [i.get_name() for i in itertools.chain.from_iterable(items)]
+for name in names:
+    symbols.pop(name, None)
+
+for name in symbols:
+    symbol = symbols[name]
+    if symbol.get_value() != 'y':
+        continue
+    symbol.set_user_value('n')
+    filename = 'NO_' + name + '_config'
+    ref_config.write_config(filename)
+    symbol.set_user_value('y')
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 69a71ff..6940d91 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -11,34 +11,17 @@ else
 lib = lib
 endif
 
+list = $(shell ls $1 2>/dev/null)
 has = $(shell which $1 2>/dev/null)
 
 # standard single make variable specified
+make_pure           :=
 make_clean_all      := clean all
 make_python_perf_so := python/perf.so
-make_debug          := DEBUG=1
-make_no_libperl     := NO_LIBPERL=1
-make_no_libpython   := NO_LIBPYTHON=1
-make_no_scripts     := NO_LIBPYTHON=1 NO_LIBPERL=1
-make_no_newt        := NO_NEWT=1
-make_no_slang       := NO_SLANG=1
-make_no_gtk2        := NO_GTK2=1
-make_no_ui          := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
-make_no_demangle    := NO_DEMANGLE=1
-make_no_libelf      := NO_LIBELF=1
-make_no_libunwind   := NO_LIBUNWIND=1
-make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1
-make_no_backtrace   := NO_BACKTRACE=1
-make_no_libnuma     := NO_LIBNUMA=1
-make_no_libaudit    := NO_LIBAUDIT=1
-make_no_libbionic   := NO_LIBBIONIC=1
 make_tags           := tags
 make_cscope         := cscope
 make_help           := help
 make_doc            := doc
-make_perf_o           := perf.o
-make_util_map_o       := util/map.o
-make_util_pmu_bison_o := util/pmu-bison.o
 make_install        := install
 make_install_bin    := install-bin
 make_install_doc    := install-doc
@@ -48,37 +31,11 @@ make_install_info   := install-info
 make_install_pdf    := install-pdf
 make_static         := LDFLAGS=-static
 
-# all the NO_* variable combined
-make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
-make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
-make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
-make_minimal        += NO_LIBDW_DWARF_UNWIND=1
-
 # $(run) contains all available tests
 run := make_pure
 run += make_clean_all
-run += make_python_perf_so
-run += make_debug
-run += make_no_libperl
-run += make_no_libpython
-run += make_no_scripts
-run += make_no_newt
-run += make_no_slang
-run += make_no_gtk2
-run += make_no_ui
-run += make_no_demangle
-run += make_no_libelf
-run += make_no_libunwind
-run += make_no_libdw_dwarf_unwind
-run += make_no_backtrace
-run += make_no_libnuma
-run += make_no_libaudit
-run += make_no_libbionic
 run += make_help
 run += make_doc
-run += make_perf_o
-run += make_util_map_o
-run += make_util_pmu_bison_o
 run += make_install
 run += make_install_bin
 # FIXME 'install-*' commented out till they're fixed
@@ -87,8 +44,7 @@ run += make_install_bin
 # run += make_install_html
 # run += make_install_info
 # run += make_install_pdf
-run += make_minimal
-run += make_static
+# run += make_static
 
 ifneq ($(call has,ctags),)
 run += make_tags
@@ -104,6 +60,10 @@ run_O := $(addsuffix _O,$(run))
 # disable some tests for O=...
 run_O := $(filter-out make_python_perf_so_O,$(run_O))
 
+# $(run_CONFIGS) is a set of automatically-generated Kconfig
+# configurations
+run_CONFIGS := $(call list,$(PERF)/tests/configs/)
+
 # define test for each compile as 'test_NAME' variable
 # with the test itself as a value
 test_make_tags   = test -f tags
@@ -183,7 +143,7 @@ test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
 test_default = test -x $(PERF)/perf
 test = $(if $(test_$1),$(test_$1),$(test_default))
 
-test_default_O = test -x $$TMP_O/perf
+test_default_O = test -x $$TMP_O/tools/perf/perf
 test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
 
 all:
@@ -218,13 +178,23 @@ $(run_O):
 	$(call test_O,$@) && \
 	rm -rf $@ $$TMP_O $$TMP_DEST || (cat $@ ; false)
 
+$(run_CONFIGS):
+	$(call clean)
+	@TMP_DEST=$$(mktemp -d); \
+	cmd="cd $(PERF) && cp tests/configs/$@ .config && make -f $(MK) JOBS=1 DESTDIR=$$TMP_DEST $($@)"; \
+	echo "- $@: $$cmd" && echo $$cmd > $@ && \
+	( eval $$cmd ) >> $@ 2>&1; \
+	echo "  test: $(call test,$@)" >> $@ 2>&1; \
+	$(call test,$@) && \
+	rm -f $@ \
+	rm -rf $$TMP_DEST
+
 tarpkg:
 	@cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1
-	
 
-all: $(run) $(run_O) tarpkg
+all: $(run) $(run_O) $(run_CONFIGS) tarpkg
 	@echo OK
 
 out: $(run_O)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 98+ messages in thread

end of thread, other threads:[~2014-06-24 22:53 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 22:02 [PATCH 00/34] perf and kconfig / kbuild Alexis Berlemont
2014-05-13 22:02 ` [PATCH 01/34] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Alexis Berlemont
2014-05-14  5:00   ` Sam Ravnborg
2014-05-13 22:02 ` [PATCH 02/34] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Alexis Berlemont
2014-05-14  5:02   ` Sam Ravnborg
2014-05-14 10:17   ` Michal Marek
2014-05-13 22:02 ` [PATCH 03/34] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-05-13 22:02 ` [PATCH 04/34] perf tools: Kbuild " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 05/34] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-05-13 22:03 ` [PATCH 06/34] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
2014-05-13 22:03 ` [PATCH 07/34] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
2014-05-13 22:03 ` [PATCH 08/34] perf kbuild: remove useless #ifdef directives Alexis Berlemont
2014-05-13 22:03 ` [PATCH 09/34] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
2014-05-13 22:03 ` [PATCH 10/34] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
2014-05-13 22:03 ` [PATCH 11/34] perf kbuild: update kbuild files according to last changes Alexis Berlemont
2014-05-13 22:03 ` [PATCH 12/34] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
2014-05-13 22:03 ` [PATCH 13/34] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 14/34] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 15/34] perf kbuild: remove legacy libperl-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 16/34] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
2014-05-13 22:03 ` [PATCH 17/34] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
2014-05-13 22:03 ` [PATCH 18/34] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
2014-05-13 22:03 ` [PATCH 19/34] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 20/34] perf kbuild: remove legacy numa-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 21/34] perf kbuild: remove legacy bionic-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 22/34] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
2014-05-13 22:03 ` [PATCH 23/34] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
2014-05-13 22:03 ` [PATCH 24/34] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
2014-05-13 22:03 ` [PATCH 25/34] perf kbuild: remove legacy libunwind-related " Alexis Berlemont
2014-05-13 22:03 ` [PATCH 26/34] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
2014-05-13 22:03 ` [PATCH 27/34] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-05-13 22:03 ` [PATCH 28/34] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
2014-05-13 22:03 ` [PATCH 29/34] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
2014-05-13 22:03 ` [PATCH 30/34] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
2014-05-13 22:03 ` [PATCH 31/34] perf kbuild: update build test configurations Alexis Berlemont
2014-05-13 22:03 ` [PATCH 32/34] perf kbuild: relocate the configs generating script Alexis Berlemont
2014-05-13 22:03 ` [PATCH 33/34] perf kbuild: minor changes Alexis Berlemont
2014-05-13 22:03 ` [PATCH 34/34] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-05-14  2:15 ` [PATCH 00/34] perf and kconfig / kbuild David Ahern
2014-05-17 15:39   ` Alexis Berlemont
2014-06-03 22:05     ` [PATCH 00/32] perf and kconfig kbuild (2nd try) Alexis Berlemont
2014-06-04  1:59       ` David Ahern
2014-06-04 11:12         ` Alexis Berlemont
2014-06-24 22:47           ` [PATCH 00/13] perf and kbuild (3rd try) Alexis Berlemont
2014-06-24 22:47           ` [PATCH 01/13] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-06-24 22:47           ` [PATCH 02/13] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-06-24 22:47           ` [PATCH 03/13] perf tools: Kbuild " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 04/13] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-06-24 22:47           ` [PATCH 05/13] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-06-24 22:47           ` [PATCH 06/13] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
2014-06-24 22:47           ` [PATCH 07/13] perf kbuild: remove legacy demangle-related " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 08/13] perf kbuild: remove legacy misc " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 09/13] perf kbuild: remove legacy libelf-related " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 10/13] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 11/13] perf kbuild: remove legacy script-related " Alexis Berlemont
2014-06-24 22:47           ` [PATCH 12/13] perf kbuild: final cosmetic changes Alexis Berlemont
2014-06-24 22:48           ` [PATCH 13/13] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-06-03 22:05     ` [PATCH 01/32] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-06-03 22:05     ` [PATCH 02/32] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-06-04  6:58       ` Paul Bolle
2014-06-04 14:15         ` David Ahern
2014-06-03 22:05     ` [PATCH 03/32] perf tools: Kbuild " Alexis Berlemont
2014-06-04  1:49       ` David Ahern
2014-06-04  6:49         ` Paul Bolle
2014-06-03 22:05     ` [PATCH 04/32] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-06-03 22:05     ` [PATCH 05/32] perf kbuild: fix recursive invocation of config/features-checks Alexis Berlemont
2014-06-04  1:50       ` David Ahern
2014-06-03 22:05     ` [PATCH 06/32] perf kbuild: store in config-detected missing variables (libdir, ...) Alexis Berlemont
2014-06-04  1:52       ` David Ahern
2014-06-03 22:06     ` [PATCH 07/32] perf kbuild: remove useless #ifdef directives Alexis Berlemont
2014-06-04  1:53       ` David Ahern
2014-06-04 21:20         ` Alexis Berlemont
2014-06-03 22:06     ` [PATCH 08/32] perf kbuild: fix a link issue if BUILTIN_TRACE is disabled Alexis Berlemont
2014-06-03 22:06     ` [PATCH 09/32] perf kbuild: add missing files and missing flags in Kbuild files Alexis Berlemont
2014-06-03 22:06     ` [PATCH 10/32] perf kbuild: update kbuild files according to last changes Alexis Berlemont
2014-06-03 22:06     ` [PATCH 11/32] perf kbuild: remove legacy slang-related build variables Alexis Berlemont
2014-06-03 22:06     ` [PATCH 12/32] perf kbuild: remove legacy libaudit-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 13/32] perf kbuild: remove legacy libgtk2-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 14/32] perf kbuild: remove legacy libperl-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 15/32] perf kbuild: remove legacy timerfd-related build variable Alexis Berlemont
2014-06-03 22:06     ` [PATCH 16/32] perf kbuild: remove legacy demangle-related build variables Alexis Berlemont
2014-06-03 22:06     ` [PATCH 17/32] perf kbuild: remove legacy on_exit-related build variable Alexis Berlemont
2014-06-03 22:06     ` [PATCH 18/32] perf kbuild: remove legacy backtrace-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 19/32] perf kbuild: remove legacy numa-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 20/32] perf kbuild: remove legacy bionic-related " Alexis Berlemont
2014-06-03 22:06     ` [PATCH 21/32] perf kbuild: remove legacy libelf-related build variables (1st part) Alexis Berlemont
2014-06-03 22:06     ` [PATCH 22/32] perf kbuild: remove legacy libelf-related build variables (2nd part) Alexis Berlemont
2014-06-03 22:06     ` [PATCH 23/32] perf kbuild: remove legacy libdwarf-related build variables Alexis Berlemont
2014-06-03 22:06     ` [PATCH 24/32] perf kbuild: remove legacy libpython-related build variable Alexis Berlemont
2014-06-03 22:06     ` [PATCH 25/32] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-06-03 22:06     ` [PATCH 26/32] perf kbuild: fix installation of traceevent plugins Alexis Berlemont
2014-06-03 22:06     ` [PATCH 27/32] perf kbuild: fix tarpkg target in tests/make Alexis Berlemont
2014-06-03 22:06     ` [PATCH 28/32] perf kbuild: update Kbuild files with new and removed sources Alexis Berlemont
2014-06-03 22:06     ` [PATCH 29/32] perf kbuild: update build test configurations Alexis Berlemont
2014-06-03 22:06     ` [PATCH 30/32] perf kbuild: relocate the configs generating script Alexis Berlemont
2014-06-03 22:06     ` [PATCH 31/32] perf kbuild: minor changes Alexis Berlemont
2014-06-03 22:06     ` [PATCH 32/32] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-05-15  8:05 ` [PATCH 00/34] perf and kconfig / kbuild Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.