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

perf evsel: Do not use globals in config()

Instead receive a callchain_param pointer to configure callchain
aspects, not doing so if NULL is passed.

This will allow fine grained control over which evsels in an evlist
gets callchains enabled.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2mupip6khc92mh5x4nw9to82@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 44621819
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ int test__perf_time_to_tsc(int subtest __maybe_unused)

	CHECK__(parse_events(evlist, "cycles:u", NULL));

	perf_evlist__config(evlist, &opts);
	perf_evlist__config(evlist, &opts, NULL);

	evsel = perf_evlist__first(evlist);

+1 −1
Original line number Diff line number Diff line
@@ -982,7 +982,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
	struct perf_evlist *evlist = kvm->evlist;
	char sbuf[STRERR_BUFSIZE];

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

	/*
	 * Note: exclude_{guest,host} do not apply here.
+1 −1
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ static int record__open(struct record *rec)
	struct record_opts *opts = &rec->opts;
	int rc = 0;

	perf_evlist__config(evlist, opts);
	perf_evlist__config(evlist, opts, &callchain_param);

	evlist__for_each(evlist, pos) {
try_again:
+1 −1
Original line number Diff line number Diff line
@@ -886,7 +886,7 @@ static int perf_top__start_counters(struct perf_top *top)
	struct perf_evlist *evlist = top->evlist;
	struct record_opts *opts = &top->record_opts;

	perf_evlist__config(evlist, opts);
	perf_evlist__config(evlist, opts, &callchain_param);

	evlist__for_each(evlist, counter) {
try_again:
+1 −1
Original line number Diff line number Diff line
@@ -2749,7 +2749,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
		goto out_delete_evlist;
	}

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

	signal(SIGCHLD, sig_handler);
	signal(SIGINT, sig_handler);
Loading