From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Andi Kleen <ak@linux.intel.com>, Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
Stephane Eranian <eranian@google.com>,
mathieu.poirier@linaro.org, Pawel Moll <pawel.moll@arm.com>
Subject: Re: [PATCH V3 2/4] perf tools: Add new PERF_RECORD_SWITCH event
Date: Tue, 7 Jul 2015 10:50:31 -0300 [thread overview]
Message-ID: <20150707135031.GD3326@kernel.org> (raw)
In-Reply-To: <1436258202-6540-3-git-send-email-adrian.hunter@intel.com>
Em Tue, Jul 07, 2015 at 11:36:40AM +0300, Adrian Hunter escreveu:
> +size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp)
> +{
> + bool out = event->header.misc & PERF_RECORD_MISC_SWITCH_OUT;
> + const char *in_out = out ? "OUT" : "IN ";
> +
> + if (event->context_switch.next_prev_pid == (u32)-1)
I.e. we would have the test:
if (!(event->header.misc & PERF_RECORD_MISC_SWITCH_NEXT_PREV_PID))
return fprintf(fp, " %s\n", in_out);
> + return fprintf(fp, " %s %s pid/tid: %5u/%-5u\n",
> + in_out, out ? "next" : "prev",
> + event->context_switch.next_prev_pid,
> + event->context_switch.next_prev_tid);
<SNIP>
> +static void perf_event__switch_swap(union perf_event *event, bool sample_id_all)
> +{
Here too:
if (event->header.misc & PERF_RECORD_MISC_SWITCH_NEXT_PREV_PID) {
event->context_switch.next_prev_pid = bswap_32(event->context_switch.next_prev_pid);
event->context_switch.next_prev_tid = bswap_32(event->context_switch.next_prev_tid);
if (sample_id_all)
swap_sample_id_all(event, &event->context_switch + 1);
} else if (sample_id_all)
swap_sample_id_all(event, &event->header + 1);
> +}
> +
next prev parent reply other threads:[~2015-07-07 13:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 8:36 [PATCH V3 0/4] perf: Add PERF_RECORD_SWITCH to indicate context switches Adrian Hunter
2015-07-07 8:36 ` [PATCH V3 1/4] " Adrian Hunter
2015-07-07 13:25 ` Arnaldo Carvalho de Melo
2015-07-07 13:44 ` Arnaldo Carvalho de Melo
2015-07-07 15:36 ` Peter Zijlstra
2015-07-07 16:13 ` Arnaldo Carvalho de Melo
2015-07-07 22:52 ` Peter Zijlstra
2015-07-08 13:28 ` Arnaldo Carvalho de Melo
2015-07-08 13:42 ` Adrian Hunter
2015-07-08 14:56 ` Arnaldo Carvalho de Melo
2015-07-07 8:36 ` [PATCH V3 2/4] perf tools: Add new PERF_RECORD_SWITCH event Adrian Hunter
2015-07-07 13:50 ` Arnaldo Carvalho de Melo [this message]
2015-07-07 8:36 ` [PATCH V3 3/4] perf record: Add option --switch-events to select PERF_RECORD_SWITCH events Adrian Hunter
2015-07-07 13:53 ` Arnaldo Carvalho de Melo
2015-07-07 8:36 ` [PATCH V3 4/4] perf script: Add option --show-switch-events Adrian Hunter
2015-07-07 13:54 ` Arnaldo Carvalho de Melo
2015-07-07 9:06 ` [PATCH V3 0/4] perf: Add PERF_RECORD_SWITCH to indicate context switches Peter Zijlstra
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=20150707135031.GD3326@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@kernel.org \
--cc=pawel.moll@arm.com \
--cc=peterz@infradead.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).