linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: rainkin <rainkin1993@gmail.com>
Cc: linux-perf-users <linux-perf-users@vger.kernel.org>
Subject: Re: [Question] How to sample PERF_TYPE_HARDWARE
Date: Tue, 16 Feb 2021 16:50:39 +0900	[thread overview]
Message-ID: <CAM9d7cg2qfQcNkH__XL8HUPSfsFqSwnYUXWCJZQLr06dip9RCw@mail.gmail.com> (raw)
In-Reply-To: <CAHb-xavRszhCbGcs0DgrdoJCHmOznHC4UzhLXxtXz=gXXk+wMQ@mail.gmail.com>

Hello,

On Mon, Feb 8, 2021 at 12:50 PM rainkin <rainkin1993@gmail.com> wrote:
>
> Hello~
>
> My goal is to record the number of occurring PERF_TYPE_HARDWARE events
> (e.g., branches) every N events.
>
> In my understanding, the "perf stat -e branches -I N " command is not
> sampling, it is actually count model which records branches every N
> millisecond. Thus perf stat does not meet my goal.
>
> For the "perf record -e cycles -b" command, it does sampling, which
> records a LBR sample every N cycles events. However, it seems that
> "perf record" does not support sampling PERF_TYPE_HARDWARE.

The 'cycles' is a PERF_TYPE_HARDWARE event.

>
> I also look at the syscall perf_event_open, but still cannot find any
> documentation about how to sample PERF_TYPE_HARDWARE.
>
> Does anyone know how to do that?Any suggestions is helpful for me :)

  perf record -e branches -c N

?

Thanks,
Namhyung

  reply	other threads:[~2021-02-16  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  3:47 [Question] How to sample PERF_TYPE_HARDWARE rainkin
2021-02-16  7:50 ` Namhyung Kim [this message]
2021-02-18  1:22   ` rainkin
2021-02-18  2:04   ` rainkin
2021-02-19  7:09     ` Namhyung Kim

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=CAM9d7cg2qfQcNkH__XL8HUPSfsFqSwnYUXWCJZQLr06dip9RCw@mail.gmail.com \
    --to=namhyung@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=rainkin1993@gmail.com \
    /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).