Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung 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: Arnaldo Carvalho de Melo <acme@redhat.com>

+1 -9
+1 -9
tools/perf/builtin-script.c
··· 549 549 struct machine *machine) 550 550 { 551 551 struct addr_location al; 552 - struct thread *thread = machine__findnew_thread(machine, sample->pid, 553 - sample->tid); 554 - 555 - if (thread == NULL) { 556 - pr_debug("problem processing %d event, skipping it.\n", 557 - event->header.type); 558 - return -1; 559 - } 560 552 561 553 if (debug_mode) { 562 554 if (sample->time < last_timestamp) { ··· 573 581 if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) 574 582 return 0; 575 583 576 - scripting_ops->process_event(event, sample, evsel, thread, &al); 584 + scripting_ops->process_event(event, sample, evsel, al.thread, &al); 577 585 578 586 return 0; 579 587 }