All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung.kim@lge.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Pekka Enberg <penberg@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 27/32] perf ui: Always compile browser setup code
Date: Sun, 18 Nov 2012 11:29:52 -0300	[thread overview]
Message-ID: <1353248997-30763-28-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1353248997-30763-1-git-send-email-acme@infradead.org>

From: Namhyung Kim <namhyung.kim@lge.com>

We now have proper fallback logic, so always build it regardless of TUI
or GTK setting.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1352813436-14173-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile     |    3 +--
 tools/perf/ui/ui.h      |   28 ++++++++++++++++++++++++++++
 tools/perf/util/cache.h |   39 +--------------------------------------
 3 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 5a9075e..a7c6aa8 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -422,6 +422,7 @@ LIB_OBJS += $(OUTPUT)util/intlist.o
 LIB_OBJS += $(OUTPUT)util/vdso.o
 LIB_OBJS += $(OUTPUT)util/stat.o
 
+LIB_OBJS += $(OUTPUT)ui/setup.o
 LIB_OBJS += $(OUTPUT)ui/helpline.o
 LIB_OBJS += $(OUTPUT)ui/progress.o
 LIB_OBJS += $(OUTPUT)ui/hist.o
@@ -612,7 +613,6 @@ ifndef NO_NEWT
 		BASIC_CFLAGS += -I/usr/include/slang
 		BASIC_CFLAGS += -DNEWT_SUPPORT
 		EXTLIBS += -lnewt -lslang
-		LIB_OBJS += $(OUTPUT)ui/setup.o
 		LIB_OBJS += $(OUTPUT)ui/browser.o
 		LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
 		LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
@@ -651,7 +651,6 @@ ifndef NO_GTK2
 		LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
 		# Make sure that it'd be included only once.
 		ifeq ($(findstring -DNEWT_SUPPORT,$(BASIC_CFLAGS)),)
-			LIB_OBJS += $(OUTPUT)ui/setup.o
 			LIB_OBJS += $(OUTPUT)ui/util.o
 		endif
 	endif
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index 7b67045..d86359c 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -3,9 +3,37 @@
 
 #include <pthread.h>
 #include <stdbool.h>
+#include <linux/compiler.h>
 
 extern pthread_mutex_t ui__lock;
 
+extern int use_browser;
+
+void setup_browser(bool fallback_to_pager);
+void exit_browser(bool wait_for_ok);
+
+#ifdef NEWT_SUPPORT
+int ui__init(void);
+void ui__exit(bool wait_for_ok);
+#else
+static inline int ui__init(void)
+{
+	return -1;
+}
+static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
+#endif
+
+#ifdef GTK2_SUPPORT
+int perf_gtk__init(void);
+void perf_gtk__exit(bool wait_for_ok);
+#else
+static inline int perf_gtk__init(void)
+{
+	return -1;
+}
+static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {}
+#endif
+
 void ui__refresh_dimensions(bool force);
 
 #endif /* _PERF_UI_H_ */
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index 2bd5137..26e3672 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -5,6 +5,7 @@
 #include "util.h"
 #include "strbuf.h"
 #include "../perf.h"
+#include "../ui/ui.h"
 
 #define CMD_EXEC_PATH "--exec-path"
 #define CMD_PERF_DIR "--perf-dir="
@@ -31,44 +32,6 @@ extern const char *pager_program;
 extern int pager_in_use(void);
 extern int pager_use_color;
 
-extern int use_browser;
-
-#if defined(NEWT_SUPPORT) || defined(GTK2_SUPPORT)
-void setup_browser(bool fallback_to_pager);
-void exit_browser(bool wait_for_ok);
-
-#ifdef NEWT_SUPPORT
-int ui__init(void);
-void ui__exit(bool wait_for_ok);
-#else
-static inline int ui__init(void)
-{
-	return -1;
-}
-static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
-#endif
-
-#ifdef GTK2_SUPPORT
-int perf_gtk__init(void);
-void perf_gtk__exit(bool wait_for_ok);
-#else
-static inline int perf_gtk__init(void)
-{
-	return -1;
-}
-static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {}
-#endif
-
-#else /* NEWT_SUPPORT || GTK2_SUPPORT */
-
-static inline void setup_browser(bool fallback_to_pager)
-{
-	if (fallback_to_pager)
-		setup_pager();
-}
-static inline void exit_browser(bool wait_for_ok __maybe_unused) {}
-#endif /* NEWT_SUPPORT || GTK2_SUPPORT */
-
 char *alias_lookup(const char *alias);
 int split_cmdline(char *cmdline, const char ***argv);
 
-- 
1.7.9.2.358.g22243


  parent reply	other threads:[~2012-11-18 14:30 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-18 14:29 [GIT PULL 00/32] perf/core improvements and fixes Arnaldo Carvalho de Melo
2012-11-18 14:29 ` Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 01/32] perf tests: Move test__vmlinux_matches_kallsyms into separate object Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 02/32] perf tests: Move test__open_syscall_event " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 03/32] perf tests: Move test__open_syscall_event_on_all_cpus " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 04/32] perf tests: Move test__basic_mmap " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 05/32] perf tests: Move test__PERF_RECORD " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 06/32] perf tests: Move test__rdpmc " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 07/32] perf tests: Move perf_evsel__roundtrip_name_test " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 08/32] perf tests: Move perf_evsel__tp_sched_test " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 09/32] perf tests: Move test__syscall_open_tp_fields " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 10/32] perf tests: Move pmu tests " Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 11/32] perf tests: Final cleanup for builtin-test move Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 12/32] perf tests: Check for mkstemp return value in dso-data test Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 13/32] perf tools: Stop using 'self' in pstack Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 14/32] perf hists: Initialize all of he->stat with zeroes Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 15/32] perf tools: Fix compile error on NO_NEWT=1 build Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 16/32] perf tools: Add gtk.<command> config option for launching GTK browser Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 17/32] perf tools: Use sscanf for parsing /proc/pid/maps Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 18/32] perf tools: Fix attributes for '{}' defined event groups Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 19/32] perf tools: Fix 'disabled' attribute config for record command Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 20/32] perf tools: Ensure single disable call per event in record comand Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 21/32] perf tools: Omit group members from perf_evlist__disable/enable Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 22/32] perf tools: Add basic event modifier sanity check Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 23/32] perf ui tui: Move progress.c under ui/tui directory Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 24/32] perf ui: Introduce generic ui_progress helper Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 25/32] perf ui gtk: Implement ui_progress functions Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 26/32] perf ui: Add ui_progress__finish() Arnaldo Carvalho de Melo
2012-11-18 14:29 ` Arnaldo Carvalho de Melo [this message]
2012-11-18 14:29 ` [PATCH 28/32] tools: Define a Makefile function to do subdir processing Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 29/32] tools: Honour the O= flag when tool build called from a higher Makefile Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 30/32] tools: Pass the target in descend Arnaldo Carvalho de Melo
2012-11-18 14:29 ` [PATCH 31/32] perf powerpc: Use uapi/unistd.h to fix build error Arnaldo Carvalho de Melo
2012-11-18 14:29   ` Arnaldo Carvalho de Melo
2012-11-19 13:29   ` Josh Boyer
2012-11-19 13:29     ` Josh Boyer
2012-11-19 15:07     ` Arnaldo Carvalho de Melo
2012-11-19 15:07       ` Arnaldo Carvalho de Melo
2012-11-19 15:18       ` Josh Boyer
2012-11-19 15:18         ` Josh Boyer
2012-11-18 14:29 ` [PATCH 32/32] perf evsel: Introduce is_group_member method Arnaldo Carvalho de Melo
2012-12-08 14:20 ` [GIT PULL 00/32] perf/core improvements and fixes Ingo Molnar
2012-12-08 14:20   ` Ingo Molnar
2012-12-08 14:27 ` Ingo Molnar
2012-12-08 14:27   ` Ingo Molnar

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=1353248997-30763-28-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

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

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