linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sodagudi Prasad <psodagud@codeaurora.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Raghavendra Rao Ananta <rananta@codeaurora.org>,
	mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, linux-kernel@vger.kernel.org,
	tsoni@codeaurora.org
Subject: Re: [PATCH] perf: Add support for creating offline events
Date: Tue, 13 Feb 2018 14:17:07 -0800	[thread overview]
Message-ID: <7d3d97fafa654c30b4ca776180760cb3@codeaurora.org> (raw)
In-Reply-To: <20180213182351.GQ25201@hirez.programming.kicks-ass.net>

On 2018-02-13 10:23, Peter Zijlstra wrote:
> On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote:
>> Perf framework doesn't allow creation of hardware events if
>> the requested CPU is offline. However, creation of an event
>> is achievable if the event is attached to the PMU as soon
>> as the CPU is online again.
>> 
>> So, introducing a feature that could allow to create events
>> even when the CPU is offline and return a success to the caller.
>> If, during the time of event creation, the CPU is found offline,
>> the event is moved to a new state (PERF_EVENT_STATE_DORMANT). As
>> and when the CPU is know to be woken up (through hotplug notifiers),
>> all the dormant events would be attached to the PMU (by
>> perf_install_in_context()). If during the life time of the event,
>> the CPU hasn't come online, the dormant event would just be freed.
> 
> This is horrible.. and you seem to have forgotten to explain why you
> care about offline CPUs.
Hi Peter,

Up to 4.9 kernel, drivers can register cpu hotplug notfiters and drivers 
are able to create perf events dynamically based cpu notifies callback 
events.
As cpu hot plug is converted to state machine approach from hot plug 
notifiers,  every driver need to define a cpuhp state and registers with 
cpu hotplug state machine for creating perf events dynamically.

Qualcomm have use cases to monitor the cpu cycles and other hw events 
continuously on all cpus from kernel and profiling tools.
So we are thinking that there could be other soc vendors, who are 
interested in perf events preserving across cpu hot plug and perf events 
creation on hot plugged cores.

-Thanks, Prasad

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

  reply	other threads:[~2018-02-13 22:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 23:07 [PATCH] perf: Add support for creating offline events Raghavendra Rao Ananta
2018-02-12  9:43 ` Jiri Olsa
2018-02-12 17:42   ` Raghavendra Rao Ananta
2018-02-12 21:04     ` Jiri Olsa
2018-02-12 21:21       ` Jiri Olsa
2018-02-12 22:22         ` Raghavendra Rao Ananta
2018-02-13 16:08           ` Jiri Olsa
2018-02-13 18:03             ` Raghavendra Rao Ananta
2018-02-12  9:44 ` Jiri Olsa
2018-02-12 19:11 ` kbuild test robot
2018-02-13 18:23 ` Peter Zijlstra
2018-02-13 22:17   ` Sodagudi Prasad [this message]
2018-02-14  8:32     ` 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=7d3d97fafa654c30b4ca776180760cb3@codeaurora.org \
    --to=psodagud@codeaurora.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rananta@codeaurora.org \
    --cc=tsoni@codeaurora.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).