All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: Conflict when accessing PMU counters from userspace
Date: Fri, 8 Sep 2017 11:28:06 +0100	[thread overview]
Message-ID: <20170908102806.GD13657@leverpostej> (raw)
In-Reply-To: <CALk3wS0P-R9=HU1wYCWWYZ2w=7RjFoD4M=Vwzg-1ALRuRNMHUA@mail.gmail.com>

On Thu, Sep 07, 2017 at 12:36:48PM -0700, Jason Teplitz wrote:
> Hello,

Hi,

> I'm reading the PMU counters from a userspace process, but the cycle
> counter keeps getting reset. I don't believe any other running
> processes are doing this. Is there something in the kernel that resets
> the cycle counter periodically and if so is there an easy way to
> disable it?

Reading the PMU counters directly from userspace is not supported, and
we configure the CPU to trap such accesses.

Ignoring explicit reset of the counters, there are a number of reasons
why you will not see consistent values from userspace.

Which kernel are you using (e.g. version? arm/arm64?), and how have you
enabled userspace access?

Thanks,
Mark.

      reply	other threads:[~2017-09-08 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 19:36 Conflict when accessing PMU counters from userspace Jason Teplitz
2017-09-08 10:28 ` Mark Rutland [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=20170908102806.GD13657@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.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 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.