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

Commit 67d61296 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

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



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

Build fixes:

- Fix 'perf trace' build when DWARF unwind isn't available (Arnaldo Carvalho de Melo)

- Remove x86 references from arch-neutral Build, fixing it in !x86 arches,
  reported as breaking the build for powerpc64le in linux-next (Arnaldo Carvalho de Melo)

Infrastructure changes:

- Do memset() variable 'st' using the correct size in the jit code (Colin Ian King)

- Fix postgresql ubuntu 'perf script' install instructions (Chris Phlipot)

- Use callchain_param more thoroughly when checking how callchains were
  configured, eventually will be the only way to look for callchain parameters
  (Arnaldo Carvalho de Melo)

- Fix some issues in the 'perf test kallsyms' entry (Arnaldo Carvalho de Melo)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 31b84310 6566feaf
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -946,7 +946,6 @@ int record_opts__parse_callchain(struct record_opts *record,
				 const char *arg, bool unset)
{
	int ret;
	record->callgraph_set = true;
	callchain->enabled = !unset;

	/* --no-call-graph */
@@ -978,15 +977,14 @@ int record_callchain_opt(const struct option *opt,
			 const char *arg __maybe_unused,
			 int unset __maybe_unused)
{
	struct record_opts *record = (struct record_opts *)opt->value;
	struct callchain_param *callchain = opt->value;

	record->callgraph_set = true;
	callchain_param.enabled = true;
	callchain->enabled = true;

	if (callchain_param.record_mode == CALLCHAIN_NONE)
		callchain_param.record_mode = CALLCHAIN_FP;
	if (callchain->record_mode == CALLCHAIN_NONE)
		callchain->record_mode = CALLCHAIN_FP;

	callchain_debug(&callchain_param);
	callchain_debug(callchain);
	return 0;
}

@@ -1224,7 +1222,7 @@ struct option __record_options[] = {
		     record__parse_mmap_pages),
	OPT_BOOLEAN(0, "group", &record.opts.group,
		    "put the counters into a counter group"),
	OPT_CALLBACK_NOOPT('g', NULL, &record.opts,
	OPT_CALLBACK_NOOPT('g', NULL, &callchain_param,
			   NULL, "enables call-graph recording" ,
			   &record_callchain_opt),
	OPT_CALLBACK(0, "call-graph", &record.opts,
+6 −5
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ struct report {
	struct perf_tool	tool;
	struct perf_session	*session;
	bool			use_tui, use_gtk, use_stdio;
	bool			dont_use_callchains;
	bool			show_full_info;
	bool			show_threads;
	bool			inverted_callchain;
@@ -247,7 +246,7 @@ static int report__setup_sample_type(struct report *rep)
				  "you call 'perf record' without -g?\n");
			return -1;
		}
	} else if (!rep->dont_use_callchains &&
	} else if (!callchain_param.enabled &&
		   callchain_param.mode != CHAIN_NONE &&
		   !symbol_conf.use_callchain) {
			symbol_conf.use_callchain = true;
@@ -599,13 +598,15 @@ static int __cmd_report(struct report *rep)
static int
report_parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
	struct report *rep = (struct report *)opt->value;
	struct callchain_param *callchain = opt->value;

	callchain->enabled = !unset;
	/*
	 * --no-call-graph
	 */
	if (unset) {
		rep->dont_use_callchains = true;
		symbol_conf.use_callchain = false;
		callchain->mode = CHAIN_NONE;
		return 0;
	}

@@ -734,7 +735,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
		   "regex filter to identify parent, see: '--sort parent'"),
	OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
		    "Only display entries with parent-match"),
	OPT_CALLBACK_DEFAULT('g', "call-graph", &report,
	OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param,
			     "print_type,threshold[,print_limit],order,sort_key[,branch],value",
			     report_callchain_help, &report_parse_callchain_opt,
			     callchain_default_opt),
+1 −1
Original line number Diff line number Diff line
@@ -791,7 +791,7 @@ static void process_event(struct perf_script *script,
	if (PRINT_FIELD(IP)) {
		struct callchain_cursor *cursor = NULL, cursor_callchain;

		if (symbol_conf.use_callchain &&
		if (symbol_conf.use_callchain && sample->callchain &&
		    thread__resolve_callchain(al->thread, &cursor_callchain, evsel,
					      sample, NULL, NULL, scripting_max_stack) == 0)
			cursor = &cursor_callchain;
+12 −13
Original line number Diff line number Diff line
@@ -917,15 +917,15 @@ static int perf_top__start_counters(struct perf_top *top)
	return -1;
}

static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
static int callchain_param__setup_sample_type(struct callchain_param *callchain)
{
	if (!sort__has_sym) {
		if (symbol_conf.use_callchain) {
		if (callchain->enabled) {
			ui__error("Selected -g but \"sym\" not present in --sort/-s.");
			return -EINVAL;
		}
	} else if (callchain_param.mode != CHAIN_NONE) {
		if (callchain_register_param(&callchain_param) < 0) {
	} else if (callchain->mode != CHAIN_NONE) {
		if (callchain_register_param(callchain) < 0) {
			ui__error("Can't register callchain params.\n");
			return -EINVAL;
		}
@@ -952,7 +952,7 @@ static int __cmd_top(struct perf_top *top)
			goto out_delete;
	}

	ret = perf_top__setup_sample_type(top);
	ret = callchain_param__setup_sample_type(&callchain_param);
	if (ret)
		goto out_delete;

@@ -1045,18 +1045,17 @@ callchain_opt(const struct option *opt, const char *arg, int unset)
static int
parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
	struct record_opts *record = (struct record_opts *)opt->value;
	struct callchain_param *callchain = opt->value;

	record->callgraph_set = true;
	callchain_param.enabled = !unset;
	callchain_param.record_mode = CALLCHAIN_FP;
	callchain->enabled = !unset;
	callchain->record_mode = CALLCHAIN_FP;

	/*
	 * --no-call-graph
	 */
	if (unset) {
		symbol_conf.use_callchain = false;
		callchain_param.record_mode = CALLCHAIN_NONE;
		callchain->record_mode = CALLCHAIN_NONE;
		return 0;
	}

@@ -1162,10 +1161,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
		   "output field(s): overhead, period, sample plus all of sort keys"),
	OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
		    "Show a column with the number of samples"),
	OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts,
	OPT_CALLBACK_NOOPT('g', NULL, &callchain_param,
			   NULL, "enables call-graph recording and display",
			   &callchain_opt),
	OPT_CALLBACK(0, "call-graph", &top.record_opts,
	OPT_CALLBACK(0, "call-graph", &callchain_param,
		     "record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]",
		     top_callchain_help, &parse_callchain_opt),
	OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
@@ -1312,7 +1311,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)

	top.sym_evsel = perf_evlist__first(top.evlist);

	if (!symbol_conf.use_callchain) {
	if (!callchain_param.enabled) {
		symbol_conf.cumulate_callchain = false;
		perf_hpp__cancel_cumulate();
	}
+5 −5
Original line number Diff line number Diff line
@@ -2457,7 +2457,7 @@ static int trace__add_syscall_newtp(struct trace *trace)
	perf_evlist__add(evlist, sys_enter);
	perf_evlist__add(evlist, sys_exit);

	if (trace->opts.callgraph_set && !trace->kernel_syscallchains) {
	if (callchain_param.enabled && !trace->kernel_syscallchains) {
		/*
		 * We're interested only in the user space callchain
		 * leading to the syscall, allow overriding that for
@@ -2546,7 +2546,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)

	perf_evlist__config(evlist, &trace->opts, NULL);

	if (trace->opts.callgraph_set && trace->syscalls.events.sys_exit) {
	if (callchain_param.enabled && trace->syscalls.events.sys_exit) {
		perf_evsel__config_callchain(trace->syscalls.events.sys_exit,
					     &trace->opts, &callchain_param);
               /*
@@ -3109,7 +3109,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
			"per thread proc mmap processing timeout in ms"),
	OPT_END()
	};
	bool max_stack_user_set = true;
	bool __maybe_unused max_stack_user_set = true;
	bool mmap_pages_user_set = true;
	const char * const trace_subcommands[] = { "record", NULL };
	int err;
@@ -3153,11 +3153,11 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
	}

#ifdef HAVE_DWARF_UNWIND_SUPPORT
	if ((trace.min_stack || max_stack_user_set) && !trace.opts.callgraph_set)
	if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled)
		record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
#endif

	if (trace.opts.callgraph_set) {
	if (callchain_param.enabled) {
		if (!mmap_pages_user_set && geteuid() == 0)
			trace.opts.mmap_pages = perf_event_mlock_kb_in_pages() * 4;

Loading