From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbbDAQgw (ORCPT ); Wed, 1 Apr 2015 12:36:52 -0400 Received: from mail.kernel.org ([198.145.29.136]:40434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753022AbbDAQgs (ORCPT ); Wed, 1 Apr 2015 12:36:48 -0400 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , Borislav Petkov , David Ahern , Don Zickus , Frederic Weisbecker , Namhyung Kim , Stephane Eranian Subject: [PATCH 1/2] perf script: No need to lookup thread twice Date: Wed, 1 Apr 2015 13:36:49 -0300 Message-Id: <1427906210-10519-2-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1427906210-10519-1-git-send-email-acme@kernel.org> References: <1427906210-10519-1-git-send-email-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo We get the thread when we call perf_event__preprocess_sample(), no need to do it before that. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-ksvs38n1d5vf9hfnhzj75xrm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 662366ceb572..c286b49c81b2 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -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; } -- 1.9.3