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

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

perf script: No need to lookup thread twice



We get the thread when we call perf_event__preprocess_sample(), no need
to do it before that.

Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1427906210-10519-2-git-send-email-acme@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e1abf2cc
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -549,14 +549,6 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
				struct machine *machine)
{
	struct addr_location al;
	struct thread *thread = machine__findnew_thread(machine, sample->pid,
							sample->tid);

	if (thread == NULL) {
		pr_debug("problem processing %d event, skipping it.\n",
			 event->header.type);
		return -1;
	}

	if (debug_mode) {
		if (sample->time < last_timestamp) {
@@ -581,7 +573,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
	if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
		return 0;

	scripting_ops->process_event(event, sample, evsel, thread, &al);
	scripting_ops->process_event(event, sample, evsel, al.thread, &al);

	return 0;
}