linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	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>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 1/3] perf/core: store context switch out type into Perf trace
Date: Mon, 16 Apr 2018 11:29:03 +0300	[thread overview]
Message-ID: <17c73937-5fdc-7323-366d-edb2f483b30c@linux.intel.com> (raw)
In-Reply-To: <20180409092603.GY4043@hirez.programming.kicks-ass.net>

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);
> 

  parent reply	other threads:[~2018-04-16  8:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09  7:20 [PATCH v5 0/3] perf/core: expose thread context switch out event type to user space Alexey Budankov
2018-04-09  7:25 ` [PATCH v5 1/3] perf/core: store context switch out type into Perf trace Alexey Budankov
2018-04-09  9:26   ` Peter Zijlstra
2018-04-09  9:56     ` Alexey Budankov
2018-04-16  8:29     ` Alexey Budankov [this message]
2018-04-16 13:59       ` Arnaldo Carvalho de Melo
2018-04-16 14:28       ` Arnaldo Carvalho de Melo
2018-04-09  7:26 ` [PATCH v5 2/3] perf report: extend raw dump (-D) out with switch out event type Alexey Budankov
2018-04-09  7:26 ` [PATCH v5 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=17c73937-5fdc-7323-366d-edb2f483b30c@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=linux-perf-users@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).