From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/3] perf/core: store context switch out type into Perf trace
Date: Thu, 29 Mar 2018 21:02:21 +0300 [thread overview]
Message-ID: <e3f8881e-d688-1597-b87c-ccc034c95958@linux.intel.com> (raw)
In-Reply-To: <20180329154323.mxi3iaaqimtozjoj@lakrids.cambridge.arm.com>
Hi,
On 29.03.2018 18:43, Mark Rutland wrote:
> Hi,
>
> On Thu, Mar 29, 2018 at 06:02:48PM +0300, Alexey Budankov wrote:
>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>> index 912b85b52344..cd6ad7e13824 100644
>> --- a/include/uapi/linux/perf_event.h
>> +++ b/include/uapi/linux/perf_event.h
>> @@ -655,6 +655,10 @@ struct perf_event_mmap_page {
>> * perf_event_attr::precise_ip.
>> */
>> #define PERF_RECORD_MISC_EXACT_IP (1 << 14)
>> +/*
>> + * Indicates that thread was preempted in TASK_RUNNING state
>> + */
>> +#define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)
>> /*
>> * Reserve the last bit to indicate some extended misc field
>> */
>
> Could you please add a description (in the header) describing why it's safe to
> reuse this bit? i.e. describe which events these are valid for, so it's clear
> they don't overlap.
It is currently employed only on x86 architecture when reporting precise events
samples with exact bit set in pt_regs->flags. Apparently there is no conflict on
this bit among different trace records so the message could be like this:
/*
* These PERF_RECORD_MISC_* flags are safely reused for the following events:
*
* PERF_RECORD_MISC_PRECISE_IP - PERF_RECORD_SAMPLE of precise events
* PERF_RECORD_MISC_SWITCH_OUT_PREEMPT - PERF_RECORD_SWITCH* events
*/
Thanks,
Alexey
>
> For bit 13 we have:
>
> /*
> * Following PERF_RECORD_MISC_* are used on different
> * events, so can reuse the same bit position:
> *
> * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events
> * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event
> * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events
> */
> #define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
> #define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
> #define PERF_RECORD_MISC_SWITCH_OUT (1 << 13)
>
> Thanks,
> Mark.
>
next prev parent reply other threads:[~2018-03-29 18:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 14:54 [PATCH v4 0/3] perf/core: expose thread context switch out event type to user space Alexey Budankov
2018-03-29 15:02 ` [PATCH v4 1/3] perf/core: store context switch out type into Perf trace Alexey Budankov
2018-03-29 15:43 ` Mark Rutland
2018-03-29 18:02 ` Alexey Budankov [this message]
2018-03-29 15:03 ` [PATCH v4 2/3] perf report: extend raw dump (-D) out with switch out event type Alexey Budankov
2018-03-29 15:04 ` [PATCH v4 3/3] perf script: extend misc field decoding " Alexey Budankov
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=e3f8881e-d688-1597-b87c-ccc034c95958@linux.intel.com \
--to=alexey.budankov@linux.intel.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--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