Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6692c262 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf tools: Remove dependency on libnewt

Now that the map browser shares the input routine with the hists
browser, there is no need for using any libnewt routine, so remove all
traces except for honouring NO_NEWT=1 on the makefile command line as an
indication that TUI support is not needed, in fact it just sets
NO_SLANG=1.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-wae5o7xca9m52bj1re28jc5j@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a4032536
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -35,7 +35,9 @@ 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_NEWT if you do not want TUI support. (deprecated)
#
# Define NO_SLANG if you do not want TUI support.
#
# Define NO_GTK2 if you do not want GTK+ GUI support.
#
@@ -104,6 +106,10 @@ ifdef PARSER_DEBUG
	PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG
endif

ifdef NO_NEWT
	NO_SLANG=1
endif

CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS)
EXTLIBS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
@@ -680,15 +686,15 @@ ifndef NO_LIBAUDIT
	endif
endif

ifndef NO_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);
ifndef NO_SLANG
	FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
	ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
		msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-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
		BASIC_CFLAGS += -DSLANG_SUPPORT
		EXTLIBS += -lslang
		LIB_OBJS += $(OUTPUT)ui/browser.o
		LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
		LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
+3 −3
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool,
		return -ENOMEM;

	/*
	 * In the newt browser, we are doing integrated annotation,
	 * In the TUI browser, we are doing integrated annotation,
	 * so we don't allocate the extra space needed because the stdio
	 * code will not use it.
	 */
@@ -263,7 +263,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel,
			return err;
	}
	/*
	 * Only in the newt browser we are doing integrated annotation,
	 * Only in the TUI browser we are doing integrated annotation,
	 * so we don't allocated the extra space needed because the stdio
	 * code will not use it.
	 */
@@ -877,7 +877,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
		usage_with_options(report_usage, options);

	/*
	 * Only in the newt browser we are doing integrated annotation,
	 * Only in the TUI browser we are doing integrated annotation,
	 * so don't allocate extra space that won't be used in the stdio
	 * implementation.
	 */
+5 −7
Original line number Diff line number Diff line
@@ -61,15 +61,13 @@ int main(void)
}
endef

ifndef NO_NEWT
define SOURCE_NEWT
#include <newt.h>
ifndef NO_SLANG
define SOURCE_SLANG
#include <slang.h>

int main(void)
{
	newtInit();
	newtCls();
	return newtFinished();
	return SLsmg_init_smg();
}
endef
endif
+7 −2
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
#include "../cache.h"
#include "../../perf.h"
#include "libslang.h"
#include <newt.h>
#include "ui.h"
#include "util.h"
#include <linux/compiler.h>
@@ -234,7 +233,7 @@ void ui_browser__reset_index(struct ui_browser *browser)
void __ui_browser__show_title(struct ui_browser *browser, const char *title)
{
	SLsmg_gotorc(0, 0);
	ui_browser__set_color(browser, NEWT_COLORSET_ROOT);
	ui_browser__set_color(browser, HE_COLORSET_ROOT);
	slsmg_write_nstring(title, browser->width + 1);
}

@@ -513,6 +512,12 @@ static struct ui_browser_colorset {
		.fg	  = "magenta",
		.bg	  = "default",
	},
	{
		.colorset = HE_COLORSET_ROOT,
		.name	  = "root",
		.fg	  = "white",
		.bg	  = "blue",
	},
	{
		.name = NULL,
	}
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#define HE_COLORSET_SELECTED	53
#define HE_COLORSET_CODE	54
#define HE_COLORSET_ADDR	55
#define HE_COLORSET_ROOT	56

struct ui_browser {
	u64	      index, top_idx;
Loading