From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Feng Tang <feng.tang@intel.com>
Cc: David Ahern <dsahern@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>, Andi Kleen <andi@firstfloor.org>,
Robert Richter <robert.richter@amd.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] perf script: Replace "struct thread" with "struct addr_location" as a parameter for "process_event()"
Date: Thu, 31 May 2012 11:50:42 -0300 [thread overview]
Message-ID: <20120531145042.GA28571@infradead.org> (raw)
In-Reply-To: <1338446072-24655-2-git-send-email-feng.tang@intel.com>
Em Thu, May 31, 2012 at 02:34:31PM +0800, Feng Tang escreveu:
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 8e395a5..282e206 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -405,9 +405,10 @@ static void process_event(union perf_event *event __unused,
> struct perf_sample *sample,
> struct perf_evsel *evsel,
> struct machine *machine,
> - struct thread *thread)
> + struct addr_location *al __unused)
Why the __unused modifier, since you...
> {
> struct perf_event_attr *attr = &evsel->attr;
> + struct thread *thread = al->thread;
... are using al?
> if (output[attr->type].fields == 0)
> return;
> @@ -520,7 +521,7 @@ static int process_sample_event(struct perf_tool *tool __used,
> if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
> return 0;
>
> - scripting_ops->process_event(event, sample, evsel, machine, thread);
> + scripting_ops->process_event(event, sample, evsel, machine, &al);
>
> evsel->hists.stats.total_period += sample->period;
> return 0;
> diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
> index 4c1b3d7..af9a6a4 100644
> --- a/tools/perf/util/scripting-engines/trace-event-perl.c
> +++ b/tools/perf/util/scripting-engines/trace-event-perl.c
> @@ -256,7 +256,7 @@ static void perl_process_tracepoint(union perf_event *pevent __unused,
> struct perf_sample *sample,
> struct perf_evsel *evsel,
> struct machine *machine __unused,
> - struct thread *thread)
> + struct addr_location *al __unused)
Ditto
> {
> struct format_field *field;
> static char handler[256];
> @@ -268,6 +268,7 @@ static void perl_process_tracepoint(union perf_event *pevent __unused,
> int cpu = sample->cpu;
> void *data = sample->raw_data;
> unsigned long long nsecs = sample->time;
> + struct thread *thread = al->thread;
> char *comm = thread->comm;
>
> dSP;
> @@ -346,7 +347,7 @@ static void perl_process_event_generic(union perf_event *pevent __unused,
> struct perf_sample *sample,
> struct perf_evsel *evsel __unused,
> struct machine *machine __unused,
> - struct thread *thread __unused)
> + struct addr_location *al __unused)
Here it seems ok
> {
> dSP;
>
> @@ -372,10 +373,10 @@ static void perl_process_event(union perf_event *pevent,
> struct perf_sample *sample,
> struct perf_evsel *evsel,
> struct machine *machine,
> - struct thread *thread)
> + struct addr_location *al)
And here it is correctly without the __unused marker
Check the others please
next prev parent reply other threads:[~2012-05-31 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 6:34 [PATCH v2 1/3] perf script: Add general python handler to process non-tracepoint events Feng Tang
2012-05-31 6:34 ` [PATCH v2 2/3] perf script: Replace "struct thread" with "struct addr_location" as a parameter for "process_event()" Feng Tang
2012-05-31 14:50 ` Arnaldo Carvalho de Melo [this message]
2012-06-01 1:45 ` [PATCH v3 " Feng Tang
2012-05-31 6:34 ` [PATCH v2 3/3] perf script/python: Pass thread/dso name and symbol info to event handler in python Feng Tang
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=20120531145042.GA28571@infradead.org \
--to=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=feng.tang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.com \
/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).