perf: initial infrasructure for kconfig
Subsystems (2)
PATCH 1/23 perf: initial infrasructure for kconfig
In reply to a message not in the archiveAdd Pconfig file which will hold the build options. Update Makefile with new config files.
Signed-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tools/perf/Pconfig
tools/perf/Makefile +5 -0
@@ -5,6 +5,9 @@ all: include config/utilities.mak +# Read in config if it exists +-include $(OUTPUT)include/config/auto.conf + # Define V to have a more verbose compile. # # Define O to save output files in a separate directory.
@@ -203,6 +206,7 @@ ifneq ($(OUTPUT),) endif BASIC_CFLAGS = \ + -I$(OUTPUT)include \ -Iutil/include \ -Iarch/$(ARCH)/include \ $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
@@ -409,6 +413,7 @@ LIB_H += ui/helpline.h LIB_H += ui/progress.h LIB_H += ui/util.h LIB_H += ui/ui.h +LIB_H += $(OUTPUT)include/generated/autoconf.h LIB_OBJS += $(OUTPUT)util/abspath.o LIB_OBJS += $(OUTPUT)util/alias.o
tools/perf/Pconfig new file +0 -0
Signature · 1 line
1.7.10.1
PATCH 2/23 perf: make perl support based on CONFIG_LIBPERL
In reply to a message not in the archiveSigned-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 34 ++++++++++++++----------------- tools/perf/Pconfig | 2 ++ tools/perf/builtin-script.c | 3 ++- tools/perf/config/feature-tests.mak | 4 ++-- tools/perf/util/trace-event-scripting.c | 13 ++++++------ 5 files changed, 28 insertions(+), 28 deletions(-)
tools/perf/Makefile +15 -19
@@ -16,8 +16,6 @@ include config/utilities.mak # # 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
@@ -718,23 +716,21 @@ ifndef NO_GTK2 endif endif -ifdef NO_LIBPERL - BASIC_CFLAGS += -DNO_LIBPERL -else - 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)) - PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` - FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) - - ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y) - BASIC_CFLAGS += -DNO_LIBPERL - else - ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS) - EXTLIBS += $(PERL_EMBED_LIBADD) - LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o - LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o - endif +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)) + PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` + FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) + + ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y) + $(error perl module ExtUtils::Embed not installed. Install it or unset CONFIG_LIBPERL to continue) + endif + + ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS) + EXTLIBS += $(PERL_EMBED_LIBADD) + LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o + LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o endif disable-python = $(eval $(disable-python_code))
tools/perf/Pconfig +2 -0
@@ -0,0 +1,2 @@ +config LIBPERL + bool "Enable support for perl scripting engine"
tools/perf/builtin-script.c +2 -1
@@ -16,6 +16,7 @@#include "util/evsel.h" #include "util/sort.h" #include <linux/bitmap.h> +#include <linux/kconfig.h> static char const *script_name;static char const *generate_script_lang;
@@ -1110,7 +1111,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
tools/perf/config/feature-tests.mak +2 -2
@@ -102,7 +102,7 @@ int main(void) endef endif -ifndef NO_LIBPERL +ifdef CONFIG_LIBPERL define SOURCE_PERL_EMBED #include <EXTERN.h> #include <perl.h>
@@ -235,4 +235,4 @@ int main(void) numa_available(); return 0; } -endef +endef
tools/perf/util/trace-event-scripting.c +7 -6
@@ -27,6 +27,7 @@#include "../perf.h" #include "util.h" #include "trace-event.h" +#include <linux/kconfig.h> struct scripting_context *scripting_context;
@@ -110,7 +111,7 @@ void setup_python_scripting(void)static void print_perl_unsupported_msg (void ) {fprintf (stderr,"Perl scripting not supported." -" Install libperl and rebuild perf to enable it.\n" +" Enable CONFIG_LIBPERL and rebuild perf.\n" "For example:\n # apt-get install libperl-dev (ubuntu)" "\n # yum install 'perl(ExtUtils::Embed)' (Fedora)" "\n etc.\n" );
@@ -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
Signature · 1 line
1.7.10.1
PATCH 3/23 perf: make python support based on CONFIG_LIBPYTHON
In reply to a message not in the archiveSigned-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 105 +++++++++++++++---------------- tools/perf/Pconfig | 3 + tools/perf/builtin-script.c | 2 +- tools/perf/config/feature-tests.mak | 2 +- tools/perf/util/trace-event-scripting.c | 17 +++-- 5 files changed, 61 insertions(+), 68 deletions(-)
tools/perf/Makefile +49 -56
@@ -16,8 +16,6 @@ include config/utilities.mak # # Define CROSS_COMPILE as prefix name of compiler if you want cross-builds. # -# 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 #
@@ -733,69 +731,64 @@ ifdef CONFIG_LIBPERL LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o endif -disable-python = $(eval $(disable-python_code)) -define disable-python_code - BASIC_CFLAGS += -DNO_LIBPYTHON - $(if $(1),$(warning No $(1) was found)) - $(warning Python support will not be built) -endef +ifdef CONFIG_LIBPYTHON + override PYTHON := \ + $(call get-executable-or-default,PYTHON,python) -override PYTHON := \ - $(call get-executable-or-default,PYTHON,python) + ifndef PYTHON + $(error python interpreter not found. Install it or unset CONFIG_LIBPYTHON to continue.) + endif -ifndef PYTHON - $(call disable-python,python interpreter) -else + PYTHON_WORD := $(call shell-wordify,$(PYTHON)) - PYTHON_WORD := $(call shell-wordify,$(PYTHON)) + # 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 - ifdef NO_LIBPYTHON - $(call disable-python) - else + python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so override PYTHON_CONFIG := \ - $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) + $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) ifndef PYTHON_CONFIG - $(call disable-python,python-config tool) - else - - PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) - - PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) - PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) - PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) - PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) - FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) - - ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y) - $(call disable-python,Python.h (for Python 2.x)) - else - - ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y) - $(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 ,)) - else - ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS) - EXTLIBS += $(PYTHON_EMBED_LIBADD) - LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o - LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o - LANG_BINDINGS += $(OUTPUT)python/perf.so - endif - - endif + $(error python-config not found. Install it or unset CONFIG_LIBPYTHON to continue.) endif - endif + + PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) + + PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) + PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) + PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) + PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) + FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) + + ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y) + $(warning Failed to detect python development kit.) + $(warning Install it or unset CONFIG_LIBPYTHON to continue.) + $(warning e.g., apt-get install python-dev (ubuntu).) + $(warning yum install python-devel (Fedora).) + $(error ) + endif + + ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y) + $(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 by unsetting CONFIG_LIBPYTHON.) + $(error $(and ,)) + endif + + ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS) + EXTLIBS += $(PYTHON_EMBED_LIBADD) + LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o + LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o + LANG_BINDINGS += $(OUTPUT)python/perf.so endif ifdef NO_DEMANGLE
tools/perf/Pconfig +3 -0
@@ -1,2 +1,5 @@ config LIBPERL bool "Enable support for perl scripting engine" + +config LIBPYTHON + bool "Enable support for python scripting engine"
tools/perf/builtin-script.c +1 -1
@@ -1115,7 +1115,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
tools/perf/config/feature-tests.mak +1 -1
@@ -115,7 +115,7 @@ return 0; endef endif -ifndef NO_LIBPYTHON +ifdef CONFIG_LIBPYTHON define SOURCE_PYTHON_VERSION #include <Python.h> #if PY_VERSION_HEX >= 0x03000000
tools/perf/util/trace-event-scripting.c +7 -10
@@ -46,11 +46,8 @@ static void process_event_unsupported(union perf_event *event __maybe_unused,static void print_python_unsupported_msg (void ) { -fprintf (stderr,"Python scripting not supported." -" Install libpython and rebuild perf to enable it.\n" -"For example:\n # apt-get install python-dev (ubuntu)" -"\n # yum install python-devel (Fedora)" -"\n etc.\n" ); +fprintf (stderr,"Python scripting not supported.\n" +"Enable CONFIG_LIBPYTHON and rebuild perf to enable it.\n" ); } static int python_start_script_unsupported(const char *script __maybe_unused,
@@ -94,17 +91,17 @@ static void register_python_scripting(struct scripting_ops *scripting_ops) scripting_context =malloc (sizeof (struct scripting_context )); } -#ifdef NO_LIBPYTHON +#ifdef CONFIG_LIBPYTHON +extern struct scripting_ops python_scripting_ops; +void setup_python_scripting (void ) { -register_python_scripting (&python_scripting_unsupported_ops); +register_python_scripting (&python_scripting_ops); }#else -extern struct scripting_ops python_scripting_ops; -void setup_python_scripting (void ) { -register_python_scripting (&python_scripting_ops); +register_python_scripting (&python_scripting_unsupported_ops); }#endif
Signature · 1 line
1.7.10.1
PATCH 4/23 perf: make gtk2 support based on CONFIG_GTK2
In reply to a message not in the archiveSigned-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 39 ++++++++++++++++------------------- tools/perf/Pconfig | 3 +++ tools/perf/config/feature-tests.mak | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-)
tools/perf/Makefile +18 -21
@@ -36,8 +36,6 @@ include config/utilities.mak # # Define NO_NEWT 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)
@@ -693,25 +691,24 @@ ifndef NO_NEWT endif endif -ifndef NO_GTK2 - FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) - ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) - msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); - else - ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) - BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR - endif - BASIC_CFLAGS += -DGTK2_SUPPORT - BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) - EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) - 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 - endif +ifdef CONFIG_GTK2 + FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) + ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) + $(error GTK2 not found. Please install gtk2-devel or libgtk2.0-dev or unset CONFIG_GTK2) + endif + ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) + BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR + endif + BASIC_CFLAGS += -DGTK2_SUPPORT + BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) + EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) + 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 endif ifdef CONFIG_LIBPERL
tools/perf/Pconfig +3 -0
@@ -1,3 +1,6 @@ +config GTK2 + bool "Enable GTK-based UI" + config LIBPERL bool "Enable support for perl scripting engine"
tools/perf/config/feature-tests.mak +1 -1
@@ -74,7 +74,7 @@ int main(void) endef endif -ifndef NO_GTK2 +ifdef CONFIG_GTK2 define SOURCE_GTK2 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #include <gtk/gtk.h>
Signature · 1 line
1.7.10.1
PATCH 5/23 perf: make newt support based on CONFIG_NEWT
In reply to a message not in the archiveSigned-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 46 +++++++++++++++++------------------ tools/perf/Pconfig | 3 +++ tools/perf/config/feature-tests.mak | 2 +- 3 files changed, 26 insertions(+), 25 deletions(-)
tools/perf/Makefile +22 -24
@@ -34,8 +34,6 @@ include config/utilities.mak # # Define WERROR=0 to disable treating any warnings as errors. # -# Define NO_NEWT if you do not want TUI 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)
@@ -666,29 +664,29 @@ ifndef NO_LIBAUDIT endif endif -ifndef NO_NEWT +ifdef CONFIG_NEWT FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt - ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y) - msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); - else - # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h - BASIC_CFLAGS += -I/usr/include/slang - BASIC_CFLAGS += -DNEWT_SUPPORT - EXTLIBS += -lnewt -lslang - 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/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/browser.h - LIB_H += ui/browsers/map.h - LIB_H += ui/keysyms.h - LIB_H += ui/libslang.h - endif + ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y) + $(error newt not found. Please install newt-devel or libnewt-dev or disable CONFIG_NEWT) + endif + + # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h + BASIC_CFLAGS += -I/usr/include/slang + BASIC_CFLAGS += -DNEWT_SUPPORT + EXTLIBS += -lnewt -lslang + 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/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/browser.h + LIB_H += ui/browsers/map.h + LIB_H += ui/keysyms.h + LIB_H += ui/libslang.h endif ifdef CONFIG_GTK2
tools/perf/Pconfig +3 -0
@@ -1,3 +1,6 @@ +config NEWT + bool "Enable newt-based TUI" + config GTK2 bool "Enable GTK-based UI"
tools/perf/config/feature-tests.mak +1 -1
@@ -61,7 +61,7 @@ int main(void) } endef -ifndef NO_NEWT +ifdef CONFIG_NEWT define SOURCE_NEWT #include <newt.h>
Signature · 1 line
1.7.10.1
PATCH 6/23 perf: remove NEWT_SUPPORT in favor of CONFIG_NEWT
In reply to a message not in the archiveSigned-off-by David Ahern <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
--- tools/perf/Makefile | 1 - tools/perf/ui/ui.h | 3 ++- tools/perf/util/annotate.h | 3 ++- tools/perf/util/hist.h | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-)
tools/perf/Makefile +0 -1
@@ -672,7 +672,6 @@ ifdef CONFIG_NEWT # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h BASIC_CFLAGS += -I/usr/include/slang - BASIC_CFLAGS += -DNEWT_SUPPORT EXTLIBS += -lnewt -lslang LIB_OBJS += $(OUTPUT)ui/browser.o LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
tools/perf/ui/ui.h +2 -1
@@ -4,6 +4,7 @@#include <pthread.h> #include <stdbool.h> #include <linux/compiler.h> +#include <linux/kconfig.h> extern pthread_mutex_t ui__lock;
@@ -12,7 +13,7 @@ extern int use_browser;void setup_browser (bool fallback_to_pager);void exit_browser (bool wait_for_ok); -#ifdef NEWT_SUPPORT +#ifdef CONFIG_NEWT int ui__init (void );void ui__exit (bool wait_for_ok);#else
tools/perf/util/annotate.h +2 -1
@@ -10,6 +10,7 @@#include <linux/list.h> #include <linux/rbtree.h> #include <pthread.h> +#include <linux/kconfig.h> struct ins ;
@@ -141,7 +142,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, bool print_lines, bool full_paths, int min_pcnt, int max_lines); -#ifdef NEWT_SUPPORT +#ifdef CONFIG_NEWT int symbol__tui_annotate (struct symbol *sym,struct map *map,int evidx,struct hist_browser_timer *hbt);#else
tools/perf/util/hist.h +2 -1
@@ -5,6 +5,7 @@#include <pthread.h> #include "callchain.h" #include "header.h" +#include <linux/kconfig.h> extern struct callchain_param callchain_param;
@@ -175,7 +176,7 @@ struct hist_browser_timer {int refresh; }; -#ifdef NEWT_SUPPORT +#ifdef CONFIG_NEWT #include "../ui/keysyms.h" int hist_entry__tui_annotate (struct hist_entry *he,int evidx,struct hist_browser_timer *hbt);
Signature · 1 line
1.7.10.1