lkml.org 
[lkml]   [2018]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 1/3] perf/core: store context switch out type into Perf trace
From
Date
Hi Arnaldo,

On 09.04.2018 12:26, Peter Zijlstra wrote:
> On Mon, Apr 09, 2018 at 10:25:32AM +0300, Alexey Budankov wrote:
>>
>> Store preempting context switch out event into Perf trace as a part of
>> PERF_RECORD_SWITCH[_CPU_WIDE] record.
>>
>> Percentage of preempting and non-preempting context switches help
>> understanding the nature of workloads (CPU or IO bound) that are running
>> on a machine;
>>
>> The event is treated as preemption one when task->state value of the
>> thread being switched out is TASK_RUNNING. Event type encoding is
>> implemented using PERF_RECORD_MISC_SWITCH_OUT_PREEMPT bit;
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> Acme, I'm thinking you should route this, since most of the changes are
> actually to the tool.

This is just to make sure it doesn't sneak out of your attention
in hope the plan is still the same as Peter mentioned above.

Thanks,
Alexey

>
>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>> index fc1c330c6bd6..872a5aaa77eb 100644
>> --- a/kernel/events/core.c
>> +++ b/kernel/events/core.c
>> @@ -7584,6 +7584,10 @@ static void perf_event_switch(struct task_struct *task,
>> },
>> };
>>
>> + if (!sched_in && task->state == TASK_RUNNING)
>> + switch_event.event_id.header.misc |=
>> + PERF_RECORD_MISC_SWITCH_OUT_PREEMPT;
>
> I typically prefer {} over any multi-line expression.
>
>> perf_iterate_sb(perf_event_switch_output,
>> &switch_event,
>> NULL);
>

\
 
 \ /
  Last update: 2018-04-16 10:30    [W:0.047 / U:0.772 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site