From: Scott Wood <scottwood@freescale.com>
To: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: perf/powerpc: reset event hw state when adding it to the PMU
Date: Thu, 29 Jan 2015 23:42:38 -0600 [thread overview]
Message-ID: <20150130054238.GA14897@home.buserror.net> (raw)
In-Reply-To: <1403773138-7558-1-git-send-email-alexandru.sardan@freescale.com>
On Thu, Jun 26, 2014 at 11:58:58AM +0300, Alexandru-Cezar Sardan wrote:
> When adding an event to the PMU with PERF_EF_START the STOPPED and UPTODATE
> flags need to be cleared in the hw.event status variable because they are
> preventing the update of the event count on overflow interrupt.
>
> Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
> ---
> arch/powerpc/perf/core-fsl-emb.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Sorry for the delay -- it wasn't CCed to me and the subject line didn't
indicate that it was fsl related.
> diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
> index d35ae52..ef2ce48 100644
> --- a/arch/powerpc/perf/core-fsl-emb.c
> +++ b/arch/powerpc/perf/core-fsl-emb.c
> @@ -330,9 +330,11 @@ static int fsl_emb_pmu_add(struct perf_event *event, int flags)
> }
> local64_set(&event->hw.prev_count, val);
>
> - if (!(flags & PERF_EF_START)) {
> + if (unlikely(!(flags & PERF_EF_START))) {
> event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
> val = 0;
> + } else {
> + event->hw.state &= ~(PERF_HES_STOPPED | PERF_HES_UPTODATE);
> }
Why unlikely()? None of the other perf drivers have that there.
Commit f53d168c does something similar for book3s. It sets hw.state to
zero instead of clearing the flags. Any reason why core-fsl-emb should
be different?
-Scott
prev parent reply other threads:[~2015-01-30 5:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 8:58 [PATCH] perf/powerpc: reset event hw state when adding it to the PMU Alexandru-Cezar Sardan
2015-01-30 5:42 ` Scott Wood [this message]
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=20150130054238.GA14897@home.buserror.net \
--to=scottwood@freescale.com \
--cc=alexandru.sardan@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.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).