All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Kiran T <kiran.lkml@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: How to use PERF_RECORD_MMAP
Date: Tue, 28 Nov 2017 10:24:50 -0300	[thread overview]
Message-ID: <20171128132450.GE3298@kernel.org> (raw)
In-Reply-To: <CABUc5FFGkqn1kS9p=_ZmfuMEn-jhkJc60yvtC3eEjuw7HcHbeg@mail.gmail.com>

Em Mon, Nov 27, 2017 at 12:27:54PM -0800, Kiran T escreveu:
> Hello,
> Man pages/documentation is not clear on how to use PERF_RECORD_MMAP .
> Dummy event did not record this -- probably need a qualifier to add
> sample_id_all?  ( Of course I could create a custom program with
> perf_event_open.  But wanted to use perf if possible.)

# perf record --delay 1 sleep 2
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.019 MB perf.data (8 samples) ]
# perf evlist -v
cycles:ppp: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|PERIOD, read_format: ID, disabled: 1, inherit: 1, freq: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1
dummy:HG: type: 1, size: 112, config: 0x9, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|PERIOD, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1
[root@jouet ~]#

So when you ask for running sleep but only start collecting samples
after 1ms passes after the workload starts ('sleep 2' in this case), we
have to have an active event to at least receive the PERF_RECORD_MMAP
events (perf_event_attr.mmap = 1).

Look at the fields set in the perf_event_attr for the dummy event in the
example above, that should suffice.

There are some fields that just got existing defaults, but are not
relevant nor used here, what matters really is:

dummy: type: 1, size: 112, config: 0x9, sample_type: ID, disabled: 1, mmap: 1, comm: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1

- Arnaldo

      reply	other threads:[~2017-11-28 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 20:27 How to use PERF_RECORD_MMAP Kiran T
2017-11-28 13:24 ` Arnaldo Carvalho de Melo [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=20171128132450.GE3298@kernel.org \
    --to=acme@kernel.org \
    --cc=kiran.lkml@gmail.com \
    --cc=linux-perf-users@vger.kernel.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.