linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@redhat.com, adrian.hunter@intel.com, eranian@google.com,
	acme@redhat.com, linux-kernel@vger.kernel.org, bp@suse.de,
	mingo@kernel.org, fweisbec@gmail.com, tglx@linutronix.de,
	dsahern@gmail.com, dzickus@redhat.com, namhyung@kernel.org,
	hpa@zytor.com
Subject: [tip:perf/core] perf script: No need to lookup thread twice
Date: Thu, 2 Apr 2015 22:06:39 -0700	[thread overview]
Message-ID: <tip-79628f2cfe0f488b23e5dc99a4a9a599032fa653@git.kernel.org> (raw)
In-Reply-To: <1427906210-10519-2-git-send-email-acme@kernel.org>

Commit-ID:  79628f2cfe0f488b23e5dc99a4a9a599032fa653
Gitweb:     http://git.kernel.org/tip/79628f2cfe0f488b23e5dc99a4a9a599032fa653
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Wed, 1 Apr 2015 13:26:45 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 2 Apr 2015 13:18:21 -0300

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>
---
 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 662366c..c286b49 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;
 }

  reply	other threads:[~2015-04-03  5:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 16:36 [RFC 0/2] perf scripting cleanups Arnaldo Carvalho de Melo
2015-04-01 16:36 ` [PATCH 1/2] perf script: No need to lookup thread twice Arnaldo Carvalho de Melo
2015-04-03  5:06   ` tip-bot for Arnaldo Carvalho de Melo [this message]
2015-04-01 16:36 ` [PATCH 2/2] perf scripting: No need to pass thread twice to the scripting callbacks Arnaldo Carvalho de Melo
2015-04-03  5:06   ` [tip:perf/core] " tip-bot for Arnaldo Carvalho de Melo
2015-04-02  8:16 ` [RFC 0/2] perf scripting cleanups Namhyung Kim
2015-04-02  8:35   ` Jiri Olsa
2015-04-02  9:16 ` Adrian Hunter
2015-04-02 14:15   ` Arnaldo Carvalho de Melo
2015-04-02 20:42     ` Adrian Hunter
2015-04-03  5:07     ` [tip:perf/core] perf db-export: No need to have -> thread twice in struct export_sample tip-bot for Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-79628f2cfe0f488b23e5dc99a4a9a599032fa653@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=bp@suse.de \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).