linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>,
	linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Borislav Petkov <bp@suse.de>, Don Zickus <dzickus@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [RFC 0/2] perf scripting cleanups
Date: Thu, 2 Apr 2015 11:15:42 -0300	[thread overview]
Message-ID: <20150402141542.GA9630@kernel.org> (raw)
In-Reply-To: <551D08F8.3040706@intel.com>

Em Thu, Apr 02, 2015 at 12:16:40PM +0300, Adrian Hunter escreveu:
> On 01/04/15 19:36, Arnaldo Carvalho de Melo wrote:
> > Hi David, Jiri,
> > 
> > 	Please take a look if it is ok for you guys
> > 
> > Adrian, there is another thing:
> > 
> >   db_export__sample(&tables->dbe, event, sample, evsel, al->thread, al);
> > 
> > In tools/perf/util/scripting-engines/trace-event-python.c has this redundancy
> > as well, see the (al->thread, al), I'll probably remove that extra thread parm
> 
> Yes please remove it too.
> 
> > there if you don't have any other subtle use for that...
> 
> Nope

Ok, adding it as below, with your Acked-by, there is the one at the
bottom too, i.s. struct export_sample doesn't need a ->thread field,
same reason, if you are ok with that too, will add your Acked-by.

- Arnaldo

>From 765b042be1054ec7b5f76b3a004e0aff503e350f Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 2 Apr 2015 11:08:30 -0300
Subject: [PATCH 1/1] perf db-export: No need to pass thread twice to
 db_export__sample

As it is available via another parameter, address_location->thread.

Acked-by: 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: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: lkml.kernel.org/r/551D08F8.3040706@intel.com
Link: http://lkml.kernel.org/n/tip-6dbn0tcm9hyv92g7h3zj2dbt@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/db-export.c                            | 3 ++-
 tools/perf/util/db-export.h                            | 2 +-
 tools/perf/util/scripting-engines/trace-event-python.c | 3 +--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index c81dae399763..5499887edc46 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -282,8 +282,9 @@ int db_export__branch_type(struct db_export *dbe, u32 branch_type,
 
 int db_export__sample(struct db_export *dbe, union perf_event *event,
 		      struct perf_sample *sample, struct perf_evsel *evsel,
-		      struct thread *thread, struct addr_location *al)
+		      struct addr_location *al)
 {
+	struct thread* thread = al->thread;
 	struct export_sample es = {
 		.event = event,
 		.sample = sample,
diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h
index adbd22d66798..b9faa1386cf4 100644
--- a/tools/perf/util/db-export.h
+++ b/tools/perf/util/db-export.h
@@ -97,7 +97,7 @@ int db_export__branch_type(struct db_export *dbe, u32 branch_type,
 			   const char *name);
 int db_export__sample(struct db_export *dbe, union perf_event *event,
 		      struct perf_sample *sample, struct perf_evsel *evsel,
-		      struct thread *thread, struct addr_location *al);
+		      struct addr_location *al);
 
 int db_export__branch_types(struct db_export *dbe);
 
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index de8df1d5e1bd..1d3cc1b01731 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -852,8 +852,7 @@ static void python_process_event(union perf_event *event,
 	/* Reserve for future process_hw/sw/raw APIs */
 	default:
 		if (tables->db_export_mode)
-			db_export__sample(&tables->dbe, event, sample, evsel,
-					  al->thread, al);
+			db_export__sample(&tables->dbe, event, sample, evsel, al);
 		else
 			python_process_general_event(sample, evsel, al);
 	}
-- 
1.8.3.1

diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index 5499887edc46..bb39a3ffc70b 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -289,7 +289,6 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,
 		.event = event,
 		.sample = sample,
 		.evsel = evsel,
-		.thread = thread,
 		.al = al,
 	};
 	struct thread *main_thread;
diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h
index b9faa1386cf4..25e22fd76aca 100644
--- a/tools/perf/util/db-export.h
+++ b/tools/perf/util/db-export.h
@@ -34,7 +34,6 @@ struct export_sample {
 	union perf_event	*event;
 	struct perf_sample	*sample;
 	struct perf_evsel	*evsel;
-	struct thread		*thread;
 	struct addr_location	*al;
 	u64			db_id;
 	u64			comm_db_id;
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 1d3cc1b01731..5544b8cdd1ee 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -679,7 +679,7 @@ static int python_export_sample(struct db_export *dbe,
 	tuple_set_u64(t, 0, es->db_id);
 	tuple_set_u64(t, 1, es->evsel->db_id);
 	tuple_set_u64(t, 2, es->al->machine->db_id);
-	tuple_set_u64(t, 3, es->thread->db_id);
+	tuple_set_u64(t, 3, es->al->thread->db_id);
 	tuple_set_u64(t, 4, es->comm_db_id);
 	tuple_set_u64(t, 5, es->dso_db_id);
 	tuple_set_u64(t, 6, es->sym_db_id);

  reply	other threads:[~2015-04-02 14:15 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:perf/core] " tip-bot for Arnaldo Carvalho de Melo
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 [this message]
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=20150402141542.GA9630@kernel.org \
    --to=acme@kernel.org \
    --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=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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).