Skip to content

Commit 26b8aa1

Browse files
acmelgregkh
authored andcommitted
perf tools: Make GTK2 support opt-in
[ Upstream commit 4751bdd ] This is bitrotting, nobody is stepping up to work on it, and since we treat warnings as errors, feature detection is failing in its main, faster test (tools/build/feature/test-all.c) because of the GTK+2 infobar check. So make this opt-in, at some point ditch this if nobody volunteers to take care of this. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a3872e5 commit 26b8aa1

6 files changed

Lines changed: 9 additions & 19 deletions

File tree

‎tools/build/Makefile.feature‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ FEATURE_TESTS_BASIC := \
3838
get_current_dir_name \
3939
gettid \
4040
glibc \
41-
gtk2 \
42-
gtk2-infobar \
4341
libbfd \
4442
libcap \
4543
libelf \
@@ -81,6 +79,8 @@ FEATURE_TESTS_EXTRA := \
8179
compile-32 \
8280
compile-x32 \
8381
cplus-demangle \
82+
gtk2 \
83+
gtk2-infobar \
8484
hello \
8585
libbabeltrace \
8686
libbfd-liberty \
@@ -110,7 +110,6 @@ FEATURE_DISPLAY ?= \
110110
dwarf \
111111
dwarf_getlocations \
112112
glibc \
113-
gtk2 \
114113
libbfd \
115114
libcap \
116115
libelf \

‎tools/build/feature/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
8989
###############################
9090

9191
$(OUTPUT)test-all.bin:
92-
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
92+
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
9393

9494
$(OUTPUT)test-hello.bin:
9595
$(BUILD)

‎tools/build/feature/test-all.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@
7878
# include "test-libslang.c"
7979
#undef main
8080

81-
#define main main_test_gtk2
82-
# include "test-gtk2.c"
83-
#undef main
84-
85-
#define main main_test_gtk2_infobar
86-
# include "test-gtk2-infobar.c"
87-
#undef main
88-
8981
#define main main_test_libbfd
9082
# include "test-libbfd.c"
9183
#undef main
@@ -205,8 +197,6 @@ int main(int argc, char *argv[])
205197
main_test_libelf_getshdrstrndx();
206198
main_test_libunwind();
207199
main_test_libslang();
208-
main_test_gtk2(argc, argv);
209-
main_test_gtk2_infobar(argc, argv);
210200
main_test_libbfd();
211201
main_test_backtrace();
212202
main_test_libnuma();

‎tools/perf/Makefile.config‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,12 +716,14 @@ ifndef NO_SLANG
716716
endif
717717
endif
718718

719-
ifndef NO_GTK2
719+
ifdef GTK2
720720
FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
721+
$(call feature_check,gtk2)
721722
ifneq ($(feature-gtk2), 1)
722723
msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
723724
NO_GTK2 := 1
724725
else
726+
$(call feature_check,gtk2-infobar)
725727
ifeq ($(feature-gtk2-infobar), 1)
726728
GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
727729
endif

‎tools/perf/Makefile.perf‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ include ../scripts/utilities.mak
4848
#
4949
# Define NO_SLANG if you do not want TUI support.
5050
#
51-
# Define NO_GTK2 if you do not want GTK+ GUI support.
51+
# Define GTK2 if you want GTK+ GUI support.
5252
#
5353
# Define NO_DEMANGLE if you do not want C++ symbol demangling.
5454
#
@@ -384,7 +384,7 @@ ifneq ($(OUTPUT),)
384384
CFLAGS += -I$(OUTPUT)
385385
endif
386386

387-
ifndef NO_GTK2
387+
ifdef GTK2
388388
ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
389389
GTK_IN := $(OUTPUT)gtk-in.o
390390
endif
@@ -876,7 +876,7 @@ check: $(OUTPUT)common-cmds.h
876876

877877
### Installation rules
878878

879-
ifndef NO_GTK2
879+
ifdef GTK2
880880
install-gtk: $(OUTPUT)libperf-gtk.so
881881
$(call QUIET_INSTALL, 'GTK UI') \
882882
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \

‎tools/perf/builtin-version.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static void library_status(void)
6060
STATUS(HAVE_DWARF_SUPPORT, dwarf);
6161
STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations);
6262
STATUS(HAVE_GLIBC_SUPPORT, glibc);
63-
STATUS(HAVE_GTK2_SUPPORT, gtk2);
6463
#ifndef HAVE_SYSCALL_TABLE_SUPPORT
6564
STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit);
6665
#endif

0 commit comments

Comments
 (0)