All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Raghavendra Rao Ananta <rananta@codeaurora.org>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, namhyung@kernel.org,
	linux-kernel@vger.kernel.org, psodagud@codeaurora.org,
	tsoni@codeaurora.org
Subject: Re: [PATCH] perf: Add support for creating offline events
Date: Mon, 12 Feb 2018 10:43:57 +0100	[thread overview]
Message-ID: <20180212094357.GD5821@krava> (raw)
In-Reply-To: <1518217620-28458-1-git-send-email-rananta@codeaurora.org>

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.
> 
> Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>

hum, I tried and for some reason I'm getting zero counts/times
when the cpu 1 is set back online (in 9.second)

[root@ibm-x3650m4-02 perf]# ./perf stat -C 1 -e sched:sched_switch -v -I 1000
failed to read counter sched:sched_switch
#           time             counts unit events
     1.000921624      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     2.001725364      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     3.002685350      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     4.003463851      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     5.004651601      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     6.005338294      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     7.006351155      <not counted>      sched:sched_switch                                          
failed to read counter sched:sched_switch
     8.007239698      <not counted>      sched:sched_switch                                          
sched:sched_switch: 0 0 0
     9.008665621      <not counted>      sched:sched_switch                                          
sched:sched_switch: 0 0 0
    10.009570492      <not counted>      sched:sched_switch                                          
sched:sched_switch: 0 0 0
    11.010811591      <not counted>      sched:sched_switch                                          
sched:sched_switch: 0 0 0
    12.011614182      <not counted>      sched:sched_switch                                          
sched:sched_switch: 0 0 0
    13.012299851      <not counted>      sched:sched_switch                                          

looks like the dormant event wasn't scheduled in properly

also while at it, could we also handle cpu going offline case,
so the event would survive until it's back online

jirka

  reply	other threads:[~2018-02-12  9:44 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 [this message]
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
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=20180212094357.GD5821@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=psodagud@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.