perf ui/gtk: Separate out GTK code to a shared object (v3)
Namhyung Kim
maintainercover perf ui/gtk: Separate out GTK code to a shared object (v3)
Hi,
This is v3 of gtk code separation patchset to reduce library dependencies of the perf executable.
I only built libperf-gtk.so with -fPIC, and it's not linked to libperf at build time. All unresolved symbols used for perf should be resolved at runtime via perf executable (so libperf.a) - I didn't know that the linker permits unresolved symbols in a shared library at build time.
Tested on my x86-64 machine only. It seems work well for me.
v3 changes:
* fix build failure on O= option
* fix build failure on NO_GTK2= option
* add Reviewed-by tag from Pekka
* patch 1 of previous series already merged
You can find it on my 'perf/separate-v3' branch in my tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
Any comments are welcome, thanks
Namhyung
Namhyung Kim (3):
perf tools: Separate out GTK codes to libperf-gtk.so perf tools: Setup GTK browser dynamically perf tools: Run dynamic loaded GTK browser
tools/perf/Makefile | 39 +++++++++++++++++++++++---------- tools/perf/builtin-annotate.c | 26 +++++++++++++++++++--- tools/perf/builtin-report.c | 16 ++++++++++++-- tools/perf/config/Makefile | 12 ++++++++--- tools/perf/ui/gtk/annotate.c | 13 ++++++++--- tools/perf/ui/gtk/gtk.h | 16 ++++++++++++++ tools/perf/ui/setup.c | 50 +++++++++++++++++++++++++++++++++++++++++-- tools/perf/ui/ui.h | 12 +---------- tools/perf/util/annotate.h | 24 --------------------- tools/perf/util/hist.h | 15 ------------- 10 files changed, 149 insertions(+), 74 deletions(-)
Signature · 1 line
1.7.11.7
Namhyung Kim
maintainerPATCH 1/3 perf tools: Separate out GTK codes to libperf-gtk.so
Separate out GTK codes to a shared object called libperf-gtk.so. This time only GTK codes are built with -fPIC and libperf remains as is.
--- tools/perf/Makefile | 39 ++++++++++++++++++++++++++++----------- tools/perf/config/Makefile | 14 ++++++++++---- 2 files changed, 38 insertions(+), 15 deletions(-)
tools/perf/Makefile +28 -11
@@ -113,6 +113,7 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ BUILTIN_OBJS = LIB_H = LIB_OBJS = +GTK_OBJS = PYRF_OBJS = SCRIPT_SH =
@@ -485,13 +486,19 @@ ifndef NO_SLANG endif ifndef NO_GTK2 - LIB_OBJS += $(OUTPUT)ui/gtk/browser.o - LIB_OBJS += $(OUTPUT)ui/gtk/hists.o - LIB_OBJS += $(OUTPUT)ui/gtk/setup.o - LIB_OBJS += $(OUTPUT)ui/gtk/util.o - LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o - LIB_OBJS += $(OUTPUT)ui/gtk/progress.o - LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o + 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 + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)' + $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)' endif ifndef NO_LIBPERL
@@ -545,6 +552,12 @@ $(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 $(ALL_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)"' \
@@ -763,7 +776,9 @@ check: $(OUTPUT)common-cmds.h ### Installation rules -install-bin: all +install-gtk: + +install-bin: all install-gtk $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
@@ -796,15 +811,17 @@ $(INSTALL_DOC_TARGETS): ### Cleaning rules clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean - $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) + $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(GTK_OBJS) + $(RM) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(RM) $(ALL_PROGRAMS) perf - $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* + $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo + $(RM) $(OUTPUT)common-cmds.h TAGS tags cscope* $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(RM) $(OUTPUT)util/*-bison* $(RM) $(OUTPUT)util/*-flex* $(python-clean) -.PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) +.PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) install-gtk .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS
tools/perf/config/Makefile +10 -4
@@ -267,11 +267,11 @@ ifndef NO_GTK2 NO_GTK2 := 1 else ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) - CFLAGS += -DHAVE_GTK_INFO_BAR + GTK_CFLAGS := -DHAVE_GTK_INFO_BAR endif - CFLAGS += -DGTK2_SUPPORT - CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) - EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) + GTK_CFLAGS += -DGTK2_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) endif endif
@@ -456,7 +456,12 @@ else sysconfdir = $(prefix)/etc ETC_PERFCONFIG = etc/perfconfig endif +ifeq ($(IS_X86_64),1) +lib = lib64 +else lib = lib +endif +libdir = $(prefix)/$(lib) # Shell quote (do not use $(call) to accommodate ancient setups); ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
@@ -469,6 +474,7 @@ template_dir_SQ = $(subst ','\'',$(template_dir)) htmldir_SQ = $(subst ','\'',$(htmldir)) prefix_SQ = $(subst ','\'',$(prefix)) sysconfdir_SQ = $(subst ','\'',$(sysconfdir)) +libdir_SQ = $(subst ','\'',$(libdir)) ifneq ($(filter /%,$(firstword $(perfexecdir))),) perfexec_instdir = $(perfexecdir)
Signature · 1 line
1.7.11.7
Re: [PATCH 1/3] perf tools: Separate out GTK codes to libperf-gtk.so
Em Thu, Aug 08, 2013 at 03:34:08PM +0900, Namhyung Kim escreveu:
Quoted 2 lines
Separate out GTK codes to a shared object called libperf-gtk.so. This time only GTK codes are built with -fPIC and libperf remains as is.
[acme@sandy linux]$ cat /etc/fedora-release
Fedora release 18 (Spherical Cow)
[acme@sandy linux]$
Applying: perf tools: Separate out GTK codes to libperf-gtk.so [perf/core c1ca5ea] perf tools: Separate out GTK codes to libperf-gtk.so
Author: Namhyung Kim <[email protected]>
2 files changed, 38 insertions(+), 15 deletions(-)
[acme@sandy linux]$ make -j8 O=/tmp/build/perf -C tools/perf/ install-bin
CHK -fstack-protector-all
<SNIP>
CC /tmp/build/perf/scripts/perl/Perf-Trace-Util/Context.o
CC /tmp/build/perf/util/scripting-engines/trace-event-python.o
CC /tmp/build/perf/scripts/python/Perf-Trace-Util/Context.o
GEN perf-archive
GEN /tmp/build/perf/python/perf.so
CC /tmp/build/perf/perf.o
AR /tmp/build/perf/libperf.a
LINK /tmp/build/perf/perf
LINK /tmp/build/perf/libperf-gtk.so/usr/bin/ld: /tmp/build/perf/ui/gtk/browser.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /tmp/build/perf/ui/gtk/browser.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [/tmp/build/perf/libperf-gtk.so] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@sandy linux]$
And if I just do:
[acme@sandy linux]$ rm -rf /tmp/build/perf
[acme@sandy linux]$ mkdir /tmp/build/perf
[acme@sandy linux]$ make -j8 O=/tmp/build/perf -C tools/perf/ install-bin
CHK -fstack-protector-all
CHK -Wstack-protector
CHK -Wvolatile-register-var
CHK -D_FORTIFY_SOURCE=2
CHK bionic
CHK libelf
CHK libdw
CHK -DLIBELF_MMAP
CHK -DLIBELF_MMAP
CHK libunwind
CHK libaudit
CHK libslang
CHK gtk2
CHK -DHAVE_GTK_INFO_BAR
CHK perl
CHK python
CHK python version
CHK libbfd
CHK -DHAVE_STRLCPY
CHK -DHAVE_ON_EXIT
CHK -DBACKTRACE_SUPPORT
CHK libnuma
make: Entering directory `/home/acme/git/linux/tools/perf'
MKDIR /tmp/build/perf/arch/
MKDIR /tmp/build/perf/arch/x86/util/
MKDIR /tmp/build/perf/bench/
MKDIR /tmp/build/perf/scripts/perl/Perf-Trace-Util/
MKDIR /tmp/build/perf/scripts/python/Perf-Trace-Util/
MKDIR /tmp/build/perf/ui/
MKDIR /tmp/build/perf/ui/browsers/
MKDIR /tmp/build/perf/tests/
MKDIR /tmp/build/perf/ui/stdio/
MKDIR /tmp/build/perf/ui/tui/
MKDIR /tmp/build/perf/util/
MKDIR /tmp/build/perf/util/scripting-engines/
* new build flags or prefix
BISON /tmp/build/perf/util/pmu-bison.c
CC /tmp/build/perf/util/environment.o
<SNIP>
CC /tmp/build/perf/builtin-buildid-cache.o
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/setup.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/setup.o] Error 1
make: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/util.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/util.o] Error 1
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/progress.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/progress.o] Error 1
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/browser.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/browser.o] Error 1
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/helpline.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/helpline.o] Error 1
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/annotate.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/annotate.o] Error 1
Assembler messages:
Fatal error: can't create /tmp/build/perf/ui/gtk/hists.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/hists.o] Error 1
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@sandy linux]$
Namhyung Kim
maintainerRe: [PATCH 1/3] perf tools: Separate out GTK codes to libperf-gtk.so
Hi Arnaldo,
Quoted 12 lines · Arnaldo Carvalho de Melo
Em Thu, Aug 08, 2013 at 03:34:08PM +0900, Namhyung Kim escreveu:
Quoted 2 lines
Separate out GTK codes to a shared object called libperf-gtk.so. This time only GTK codes are built with -fPIC and libperf remains as is.
[acme@sandy linux]$ cat
/etc/fedora-release
Fedora release 18 (Spherical Cow)
[acme@sandy linux]$Applying: perf tools: Separate out GTK codes to libperf-gtk.so [perf/core c1ca5ea] perf tools: Separate out GTK codes to libperf-gtk.so
Author: Namhyung Kim <[email protected]>2 files changed, 38 insertions(+), 15 deletions(-)
Quoted 14 lines
[acme@sandy linux]$ make -j8 O=/tmp/build/perf -C
tools/perf/install-bin
CHK -fstack-protector-all
<SNIP>
CC/tmp/build/perf/scripts/perl/Perf-Trace-Util/Context.o
CC/tmp/build/perf/util/scripting-engines/trace-event-python.o
CC/tmp/build/perf/scripts/python/Perf-Trace-Util/Context.o
GEN perf-archive
GEN/tmp/build/perf/python/perf.so
CC/tmp/build/perf/perf.o
AR/tmp/build/perf/libperf.a
LINK/tmp/build/perf/perf
LINK/tmp/build/perf/libperf-gtk.so/usr/bin/ld:/tmp/build/perf/ui/gtk/browser.o: relocationR_X86_64_32against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC/tmp/build/perf/ui/gtk/browser.o: could not read symbols: Bad value
Hmm.. this looks like the browser.o previously built without -fPIC.
Quoted 67 lines
collect2: error: ld returned 1 exit status
make: *** [/tmp/build/perf/libperf-gtk.so] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/acme/git/linux/tools/perf' [acme@sandy linux]$And if I just do:
[acme@sandy linux]$ rm -rf
/tmp/build/perf
[acme@sandy linux]$ mkdir/tmp/build/perf
[acme@sandy linux]$ make -j8 O=/tmp/build/perf -Ctools/perf/install-bin
CHK -fstack-protector-all
CHK -Wstack-protector
CHK -Wvolatile-register-var
CHK -D_FORTIFY_SOURCE=2
CHK bionic
CHK libelf
CHK libdw
CHK -DLIBELF_MMAP
CHK -DLIBELF_MMAP
CHK libunwind
CHK libaudit
CHK libslang
CHK gtk2
CHK -DHAVE_GTK_INFO_BAR
CHK perl
CHK python
CHK python version
CHK libbfd
CHK -DHAVE_STRLCPY
CHK -DHAVE_ON_EXIT
CHK -DBACKTRACE_SUPPORT
CHK libnuma
make: Entering directory `/home/acme/git/linux/tools/perf'
MKDIR/tmp/build/perf/arch/
MKDIR/tmp/build/perf/arch/x86/util/
MKDIR/tmp/build/perf/bench/
MKDIR/tmp/build/perf/scripts/perl/Perf-Trace-Util/
MKDIR/tmp/build/perf/scripts/python/Perf-Trace-Util/
MKDIR/tmp/build/perf/ui/
MKDIR/tmp/build/perf/ui/browsers/
MKDIR/tmp/build/perf/tests/
MKDIR/tmp/build/perf/ui/stdio/
MKDIR/tmp/build/perf/ui/tui/
MKDIR/tmp/build/perf/util/
MKDIR/tmp/build/perf/util/scripting-engines/
* new build flags or prefix
BISON/tmp/build/perf/util/pmu-bison.c
CC/tmp/build/perf/util/environment.o
<SNIP>
CC/tmp/build/perf/builtin-buildid-cache.o
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/setup.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/setup.o] Error 1
make: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/util.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/util.o] Error 1
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/progress.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/progress.o] Error 1
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/browser.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/browser.o] Error 1
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/helpline.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/helpline.o] Error 1
Quoted 8 lines
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/annotate.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/annotate.o] Error 1
Assembler messages:
Fatal error: can't create/tmp/build/perf/ui/gtk/hists.o: No such file or directory
make: *** [/tmp/build/perf/ui/gtk/hists.o] Error 1
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@sandy linux]$
Argh... sorry about that. I forgot to add GTK_OBJS to DIRECTORY_DEPS. Will send v4 soon.
Thanks,
Namhyung
Namhyung Kim
maintainerPATCH 2/3 perf tools: Setup GTK browser dynamically
In reply to Namhyung KimCall setup/exit GTK browser function using libdl.
--- tools/perf/ui/gtk/gtk.h | 3 +++ tools/perf/ui/setup.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++-- tools/perf/ui/ui.h | 12 +----------- 3 files changed, 52 insertions(+), 13 deletions(-)
tools/perf/ui/gtk/gtk.h +3 -0
@@ -20,6 +20,9 @@ struct perf_gtk_context {guint statbar_ctx_id; }; +int perf_gtk__init (void ); +void perf_gtk__exit (bool wait_for_ok); +extern struct perf_gtk_context *pgctx;static inline bool perf_gtk__is_active_context (struct perf_gtk_context *ctx)
tools/perf/ui/setup.c +48 -2
72 lines not on this page · raw message
tools/perf/ui/ui.h +1 -11
@@ -6,6 +6,7 @@#include <linux/compiler.h> extern pthread_mutex_t ui__lock; +extern void *perf_gtk_handle;extern int use_browser;
@@ -23,17 +24,6 @@ static inline int ui__init(void)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_ */
Signature · 1 line
1.7.11.7
Namhyung Kim
maintainerPATCH 3/3 perf tools: Run dynamic loaded GTK browser
In reply to Namhyung KimRun GTK hist and annotation browser using libdl.
--- tools/perf/builtin-annotate.c | 26 +++++++++++++++++++++++--- tools/perf/builtin-report.c | 16 ++++++++++++++-- tools/perf/config/Makefile | 2 +- tools/perf/ui/gtk/annotate.c | 13 ++++++++++--- tools/perf/ui/gtk/gtk.h | 13 +++++++++++++ tools/perf/util/annotate.h | 24 ------------------------ tools/perf/util/hist.h | 15 --------------- 7 files changed, 61 insertions(+), 48 deletions(-)
tools/perf/builtin-annotate.c +23 -3
@@ -30,6 +30,7 @@#include "util/tool.h" #include "arch/common.h" +#include <dlfcn.h> #include <linux/bitmap.h> struct perf_annotate {
@@ -143,8 +144,18 @@ find_next:if (use_browser ==2 ) {int ret; +int (*annotate)(struct hist_entry *he, +struct perf_evsel *evsel, +struct hist_browser_timer *hbt); + + annotate =dlsym (perf_gtk_handle, +"hist_entry__gtk_annotate" ); +if (annotate ==NULL ) { +ui__error ("GTK browser not found!\n" ); +return ; + } - ret =hist_entry__gtk_annotate (he, evsel,NULL ); + ret =annotate (he, evsel,NULL );if (!ret || !ann->skip_missing)return ;
@@ -246,8 +257,17 @@ static int __cmd_annotate(struct perf_annotate *ann) goto out_delete; } -if (use_browser ==2 ) -perf_gtk__show_annotations (); +if (use_browser ==2 ) { +void (*show_annotations)(void ); + + show_annotations =dlsym (perf_gtk_handle, +"perf_gtk__show_annotations" ); +if (show_annotations ==NULL ) { +ui__error ("GTK browser not found!\n" ); + goto out_delete; + } +show_annotations (); + } out_delete:/*
tools/perf/builtin-report.c +14 -2
@@ -35,6 +35,7 @@#include "util/hist.h" #include "arch/common.h" +#include <dlfcn.h> #include <linux/bitmap.h> struct perf_report {
@@ -592,8 +593,19 @@ static int __cmd_report(struct perf_report *rep) ret =0 ; }else if (use_browser ==2 ) { -perf_evlist__gtk_browse_hists (session->evlist, help, -NULL , rep->min_percent); +int (*hist_browser)(struct perf_evlist *, +const char *, +struct hist_browser_timer *, +float min_pcnt); + + hist_browser =dlsym (perf_gtk_handle, +"perf_evlist__gtk_browse_hists" ); +if (hist_browser ==NULL ) { +ui__error ("GTK browser not found!\n" ); +return ret; + } +hist_browser (session->evlist, help,NULL , + rep->min_percent); } }else perf_evlist__tty_browse_hists (session->evlist, rep, help);
tools/perf/config/Makefile +1 -1
@@ -269,7 +269,7 @@ ifndef NO_GTK2 ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) GTK_CFLAGS := -DHAVE_GTK_INFO_BAR endif - GTK_CFLAGS += -DGTK2_SUPPORT + CFLAGS += -DGTK2_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) endif
tools/perf/ui/gtk/annotate.c +10 -3
@@ -154,9 +154,9 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,return 0 ; } -int symbol__gtk_annotate (struct symbol *sym,struct map *map, -struct perf_evsel *evsel, -struct hist_browser_timer *hbt) +static int symbol__gtk_annotate (struct symbol *sym,struct map *map, +struct perf_evsel *evsel, +struct hist_browser_timer *hbt) {GtkWidget *window;GtkWidget *notebook;
@@ -226,6 +226,13 @@ int symbol__gtk_annotate(struct symbol *sym, struct map *map,return 0 ; } +int hist_entry__gtk_annotate (struct hist_entry *he, +struct perf_evsel *evsel, +struct hist_browser_timer *hbt) +{ +return symbol__gtk_annotate (he->ms.sym, he->ms.map, evsel, hbt); +} +void perf_gtk__show_annotations (void ) {GtkWidget *window;
tools/perf/ui/gtk/gtk.h +13 -0
@@ -51,4 +51,17 @@ static inline GtkWidget *perf_gtk__setup_info_bar(void) }#endif +struct perf_evsel ; +struct perf_evlist ; +struct hist_entry ; +struct hist_browser_timer ; + +int perf_evlist__gtk_browse_hists (struct perf_evlist *evlist,const char *help, +struct hist_browser_timer *hbt, +float min_pcnt); +int hist_entry__gtk_annotate (struct hist_entry *he, +struct perf_evsel *evsel, +struct hist_browser_timer *hbt); +void perf_gtk__show_annotations (void ); +#endif /* _PERF_GTK_H_ */
tools/perf/util/annotate.h +0 -24
@@ -165,30 +165,6 @@ static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, }#endif -#ifdef GTK2_SUPPORT -int symbol__gtk_annotate (struct symbol *sym,struct map *map, -struct perf_evsel *evsel, -struct hist_browser_timer *hbt); - -static inline int hist_entry__gtk_annotate (struct hist_entry *he, -struct perf_evsel *evsel, -struct hist_browser_timer *hbt) -{ -return symbol__gtk_annotate (he->ms.sym, he->ms.map, evsel, hbt); -} - -void perf_gtk__show_annotations (void ); -#else -static inline int hist_entry__gtk_annotate (struct hist_entry *he__maybe_unused , -struct perf_evsel *evsel__maybe_unused , -struct hist_browser_timer *hbt__maybe_unused ) -{ -return 0 ; -} - -static inline void perf_gtk__show_annotations (void ) {} -#endif -extern const char *disassembler_style;#endif /* __PERF_ANNOTATE_H */
tools/perf/util/hist.h +0 -15
@@ -224,20 +224,5 @@ static inline int script_browse(const char *script_opt __maybe_unused)#define K_SWITCH_INPUT_DATA -3000#endif -#ifdef GTK2_SUPPORT -int perf_evlist__gtk_browse_hists (struct perf_evlist *evlist,const char *help, -struct hist_browser_timer *hbt__maybe_unused , -float min_pcnt); -#else -static inline -int perf_evlist__gtk_browse_hists (struct perf_evlist *evlist__maybe_unused , -const char *help__maybe_unused , -struct hist_browser_timer *hbt__maybe_unused , -float min_pcnt__maybe_unused ) -{ -return 0 ; -} -#endif -unsigned int hists__sort_list_width (struct hists *self);#endif /* __PERF_HIST_H */
Signature · 1 line
1.7.11.7