Commit 6a71e69f authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo' of...

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

 * Fix cleanup in case of kzalloc failure, from Daniel Baluta.

 * Limit unwind support to x86 archs, fix from Jiri Olsa.

 * Initial GTK+ annotate browser, from Namhyung Kim.

 * Fix build with bison 2.3 and older, from Vinson Lee.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents a3d4fd7a 02e176af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void)
 err_alloc:
	for_each_possible_cpu(err_cpu) {
		for (i = 0; i < TYPE_MAX; i++)
			kfree(per_cpu(nr_task_bp_pinned[i], cpu));
			kfree(per_cpu(nr_task_bp_pinned[i], err_cpu));
		if (err_cpu == cpu)
			break;
	}
+6 −1
Original line number Diff line number Diff line
@@ -61,11 +61,13 @@ OPTIONS

--stdio:: Use the stdio interface.

--tui:: Use the TUI interface Use of --tui requires a tty, if one is not
--tui:: Use the TUI interface. Use of --tui requires a tty, if one is not
	present, as when piping to other commands, the stdio interface is
	used. This interfaces starts by centering on the line with more
	samples, TAB/UNTAB cycles through the lines with more samples.

--gtk:: Use the GTK interface.

-C::
--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can
	be provided as a comma-separated list with no space: 0,1. Ranges of
@@ -88,6 +90,9 @@ OPTIONS
--objdump=<path>::
        Path to objdump binary.

--skip-missing::
	Skip symbols that cannot be annotated.

SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1]
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@ OPTIONS
-M::
--missing=:: 
	List missing build ids in the cache for the specified file.
-u::
--update::
	Update specified file of the cache. It can be used to update kallsyms
	kernel dso to vmlinux in order to support annotation.
-v::
--verbose::
	Be more verbose.
+8 −2
Original line number Diff line number Diff line
@@ -296,13 +296,13 @@ $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-event
	$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c

$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c
	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_

$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
	$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c

$(OUTPUT)util/pmu-bison.c: util/pmu.y
	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_

$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
@@ -581,6 +581,11 @@ else
endif # SOURCE_LIBELF
endif # NO_LIBELF

# There's only x86 (both 32 and 64) support for CFI unwind so far
ifneq ($(ARCH),x86)
	NO_LIBUNWIND := 1
endif

ifndef NO_LIBUNWIND
# for linking with debug library, run like:
# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
@@ -698,6 +703,7 @@ ifndef NO_GTK2
		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
endif

+25 −2
Original line number Diff line number Diff line
@@ -34,9 +34,10 @@

struct perf_annotate {
	struct perf_tool tool;
	bool	   force, use_tui, use_stdio;
	bool	   force, use_tui, use_stdio, use_gtk;
	bool	   full_paths;
	bool	   print_line;
	bool	   skip_missing;
	const char *sym_hist_filter;
	const char *cpu_list;
	DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
@@ -138,9 +139,22 @@ find_next:
			continue;
		}

		if (use_browser > 0) {
		if (use_browser == 2) {
			int ret;

			ret = hist_entry__gtk_annotate(he, evidx, NULL);
			if (!ret || !ann->skip_missing)
				return;

			/* skip missing symbols */
			nd = rb_next(nd);
		} else if (use_browser == 1) {
			key = hist_entry__tui_annotate(he, evidx, NULL);
			switch (key) {
			case -1:
				if (!ann->skip_missing)
					return;
				/* fall through */
			case K_RIGHT:
				next = rb_next(nd);
				break;
@@ -224,6 +238,10 @@ static int __cmd_annotate(struct perf_annotate *ann)
		ui__error("The %s file has no samples!\n", session->filename);
		goto out_delete;
	}

	if (use_browser == 2)
		perf_gtk__show_annotations();

out_delete:
	/*
	 * Speed up the exit process, for large files this can
@@ -270,6 +288,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
		    "be more verbose (show symbol address, etc)"),
	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
		    "dump raw trace in ASCII"),
	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
@@ -280,6 +299,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
		    "print matching source lines (may be slow)"),
	OPT_BOOLEAN('P', "full-paths", &annotate.full_paths,
		    "Don't shorten the displayed pathnames"),
	OPT_BOOLEAN(0, "skip-missing", &annotate.skip_missing,
		    "Skip symbols that cannot be annotated"),
	OPT_STRING('C', "cpu", &annotate.cpu_list, "cpu", "list of cpus to profile"),
	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
		   "Look for files with symbols relative to this directory"),
@@ -300,6 +321,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
		use_browser = 0;
	else if (annotate.use_tui)
		use_browser = 1;
	else if (annotate.use_gtk)
		use_browser = 2;

	setup_browser(true);

Loading