All of lore.kernel.org
 help / color / mirror / Atom feed
* How to use PERF_RECORD_MMAP
@ 2017-11-27 20:27 Kiran T
  2017-11-28 13:24 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Kiran T @ 2017-11-27 20:27 UTC (permalink / raw)
  To: linux-perf-users

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.)

Thanks,
Kiran

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to use PERF_RECORD_MMAP
  2017-11-27 20:27 How to use PERF_RECORD_MMAP Kiran T
@ 2017-11-28 13:24 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-11-28 13:24 UTC (permalink / raw)
  To: Kiran T; +Cc: linux-perf-users

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-28 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 20:27 How to use PERF_RECORD_MMAP Kiran T
2017-11-28 13:24 ` Arnaldo Carvalho de Melo

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.