All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Borislav Petkov <bp@alien8.de>, Michal Marek <mmarek@suse.cz>,
	linux-kbuild@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH 26/27] perf tools: Kbuild source related fixies
Date: Mon,  1 Apr 2013 21:18:49 +0200	[thread overview]
Message-ID: <1364843930-17974-27-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1364843930-17974-1-git-send-email-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        |  2 ++
 tools/perf/builtin-report.c      |  9 ++++++++-
 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 +++++++++-
 7 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 4258300..bb1f729 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -972,9 +972,11 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused)
 				usage_with_options(report_usage, report_options);
 		}
 		__cmd_report();
+#ifdef CONFIG_BULTIN_SCRIPT
 	} else if (!strcmp(argv[0], "script")) {
 		/* Aliased to 'perf script' */
 		return 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 bd0ca81..87690f5 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -573,6 +573,7 @@ static int __cmd_report(struct perf_report *rep)
 
 	if (use_browser > 0) {
 		if (use_browser == 1) {
+#ifdef CONFIG_TUI
 			ret = perf_evlist__tui_browse_hists(session->evlist,
 							help,
 							NULL,
@@ -583,10 +584,16 @@ static int __cmd_report(struct perf_report *rep)
 			 */
 			if (ret != K_SWITCH_INPUT_DATA)
 				ret = 0;
-
+#else
+				ret = -1;
+#endif
 		} else if (use_browser == 2) {
+#ifdef CONFIG_GUI
 			perf_evlist__gtk_browse_hists(session->evlist, help,
 						      NULL);
+#else
+			ret = -1;
+#endif
 		}
 	} else
 		perf_evlist__tty_browse_hists(session->evlist, rep, help);
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 2da2a6c..4c4046a 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1747,11 +1747,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 ccc6c52..f277b98 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 LIBAUDIT_SUPPORT && defined CONFIG_BUILTIN_TRACE
 	{ "trace",	cmd_trace,	0 },
 #endif
@@ -535,13 +537,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 32bd102..978659e 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -162,8 +162,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 12f009e..effdf38 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 ae6a789..6775665 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -17,13 +17,17 @@ void setup_browser(bool fallback_to_pager)
 
 	switch (use_browser) {
 	case 2:
+#ifdef CONFIG_GUI
 		if (perf_gtk__init() == 0)
 			break;
+#endif
 		/* fall through */
+#ifdef CONFIG_TUI
 	case 1:
 		use_browser = 1;
 		if (ui__init() == 0)
 			break;
+#endif
 		/* fall through */
 	default:
 		use_browser = 0;
@@ -36,16 +40,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:
+#ifdef CONFIG_GUI
 		perf_gtk__exit(wait_for_ok);
 		break;
+#endif
 
+#ifdef CONFIG_TUI
 	case 1:
 		ui__exit(wait_for_ok);
 		break;
+#endif
 
 	default:
 		break;
-- 
1.7.11.7


  parent reply	other threads:[~2013-04-01 19:21 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 19:18 [RFC 00/27] perf tools: Build changes and kbuild support Jiri Olsa
2013-04-01 19:18 ` [PATCH 01/27] perf tools: Add automated make test suite Jiri Olsa
2013-04-01 19:53   ` Sam Ravnborg
2013-04-01 21:09     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 02/27] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif Jiri Olsa
2013-04-01 19:49   ` Sam Ravnborg
2013-04-01 21:11     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 03/27] perf tools: Move arch check into config/Makefile Jiri Olsa
2013-04-01 19:54   ` Sam Ravnborg
2013-04-01 21:07     ` Jiri Olsa
2013-04-01 21:54   ` Namhyung Kim
2013-04-01 22:00     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 04/27] perf tools: Move programs " Jiri Olsa
2013-04-01 22:09   ` Namhyung Kim
2013-04-01 22:27     ` Jiri Olsa
2013-04-02  3:59       ` Namhyung Kim
2013-04-01 19:18 ` [PATCH 05/27] perf tools: Move compiler and linker flags " Jiri Olsa
2013-04-01 22:20   ` Namhyung Kim
2013-04-01 23:06     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 06/27] perf tools: Move libelf check config " Jiri Olsa
2013-04-01 19:18 ` [PATCH 07/27] perf tools: Move libdw " Jiri Olsa
2013-04-01 19:18 ` [PATCH 08/27] perf tools: Move libunwind " Jiri Olsa
2013-04-01 19:18 ` [PATCH 09/27] perf tools: Move libaudit " Jiri Olsa
2013-04-01 19:18 ` [PATCH 10/27] perf tools: Move slang " Jiri Olsa
2013-04-01 19:18 ` [PATCH 11/27] perf tools: Move gtk2 " Jiri Olsa
2013-04-01 19:18 ` [PATCH 12/27] perf tools: Move libperl " Jiri Olsa
2013-04-01 19:18 ` [PATCH 13/27] perf tools: Move libpython " Jiri Olsa
2013-04-01 19:18 ` [PATCH 14/27] perf tools: Move libbfd " Jiri Olsa
2013-04-01 19:18 ` [PATCH 15/27] perf tools: Move stdlib " Jiri Olsa
2013-04-01 19:18 ` [PATCH 16/27] perf tools: Move libnuma " Jiri Olsa
2013-04-01 19:18 ` [PATCH 17/27] perf tools: Move paths " Jiri Olsa
2013-04-01 19:18 ` [PATCH 18/27] perf tools: Final touches for CHK config move Jiri Olsa
2013-04-01 19:18 ` [PATCH 19/27] perf tools: Merge all *CFLAGS* make variable into CFLAGS Jiri Olsa
2013-04-01 19:18 ` [PATCH 20/27] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Jiri Olsa
2013-04-01 19:18 ` [PATCH 21/27] perf tools: Switch to full patch C include directories Jiri Olsa
2013-04-01 19:18 ` [PATCH 22/27] perf tools: Add NO_BIONIC variable to confiure bionic setup Jiri Olsa
2013-04-01 19:18 ` [PATCH 23/27] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Jiri Olsa
2013-04-01 19:18 ` [PATCH 24/27] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Jiri Olsa
2013-04-11 10:29   ` Michal Marek
2013-04-01 19:18 ` [PATCH 25/27] perf tools: Kbuild builtin source related fixies Jiri Olsa
2013-04-01 19:18 ` Jiri Olsa [this message]
2013-04-01 19:18 ` [PATCH 27/27] perf tools: Add kbuild support into Makefile.kbuild Jiri Olsa
2013-04-01 20:03   ` Sam Ravnborg
2013-04-01 21:05     ` Jiri Olsa
2013-04-01 20:45 ` [RFC 00/27] perf tools: Build changes and kbuild support David Ahern
2013-04-01 21:18   ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364843930-17974-27-git-send-email-jolsa@redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=bp@alien8.de \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mmarek@suse.cz \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.