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

Commit 063bd936 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf hists: Reducing arguments of hist_entry_iter__add()



The evsel and sample arguments are to set iter for later use.  As it
also receives an iter as another argument, just set them before calling
the function.

Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1432022650-18205-1-git-send-email-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 554e92ed
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -139,6 +139,8 @@ static int process_sample_event(struct perf_tool *tool,
	struct report *rep = container_of(tool, struct report, tool);
	struct addr_location al;
	struct hist_entry_iter iter = {
		.evsel 			= evsel,
		.sample 		= sample,
		.hide_unresolved 	= rep->hide_unresolved,
		.add_entry_cb 		= hist_iter__report_callback,
	};
@@ -168,8 +170,7 @@ static int process_sample_event(struct perf_tool *tool,
	if (al.map != NULL)
		al.map->dso->hit = 1;

	ret = hist_entry_iter__add(&iter, &al, evsel, sample, rep->max_stack,
				   rep);
	ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep);
	if (ret < 0)
		pr_debug("problem adding hist entry, skipping event\n");
out_put:
+4 −3
Original line number Diff line number Diff line
@@ -775,6 +775,8 @@ static void perf_event__process_sample(struct perf_tool *tool,
	if (al.sym == NULL || !al.sym->ignore) {
		struct hists *hists = evsel__hists(evsel);
		struct hist_entry_iter iter = {
			.evsel		= evsel,
			.sample 	= sample,
			.add_entry_cb 	= hist_iter__top_callback,
		};

@@ -785,8 +787,7 @@ static void perf_event__process_sample(struct perf_tool *tool,

		pthread_mutex_lock(&hists->lock);

		err = hist_entry_iter__add(&iter, &al, evsel, sample,
					   top->max_stack, top);
		err = hist_entry_iter__add(&iter, &al, top->max_stack, top);
		if (err < 0)
			pr_err("Problem incrementing symbol period, skipping event\n");

+4 −2
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
			},
		};
		struct hist_entry_iter iter = {
			.evsel = evsel,
			.sample	= &sample,
			.hide_unresolved = false,
		};

@@ -104,8 +106,8 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
						  &sample) < 0)
			goto out;

		if (hist_entry_iter__add(&iter, &al, evsel, &sample,
					 PERF_MAX_STACK_DEPTH, NULL) < 0) {
		if (hist_entry_iter__add(&iter, &al, PERF_MAX_STACK_DEPTH,
					 NULL) < 0) {
			addr_location__put(&al);
			goto out;
		}
+3 −1
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ static int add_hist_entries(struct perf_evlist *evlist,
				},
			};
			struct hist_entry_iter iter = {
				.evsel = evsel,
				.sample = &sample,
				.ops = &hist_iter_normal,
				.hide_unresolved = false,
			};
@@ -81,7 +83,7 @@ static int add_hist_entries(struct perf_evlist *evlist,
							  &sample) < 0)
				goto out;

			if (hist_entry_iter__add(&iter, &al, evsel, &sample,
			if (hist_entry_iter__add(&iter, &al,
						 PERF_MAX_STACK_DEPTH, NULL) < 0) {
				addr_location__put(&al);
				goto out;
+4 −2
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
			},
		};
		struct hist_entry_iter iter = {
			.evsel = evsel,
			.sample = &sample,
			.ops = &hist_iter_normal,
			.hide_unresolved = false,
		};
@@ -70,8 +72,8 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
						  &sample) < 0)
			goto out;

		if (hist_entry_iter__add(&iter, &al, evsel, &sample,
					 PERF_MAX_STACK_DEPTH, NULL) < 0) {
		if (hist_entry_iter__add(&iter, &al, PERF_MAX_STACK_DEPTH,
					 NULL) < 0) {
			addr_location__put(&al);
			goto out;
		}
Loading