From: Vince Weaver <vincent.weaver@maine.edu>
To: Harald Servat <harald.servat@bsc.es>
Cc: "linux-perf-users@vger.kernel.org" <linux-perf-users@vger.kernel.org>
Subject: Re: About using PEBS from the user space
Date: Sun, 3 May 2015 18:19:21 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.11.1505031816450.4940@vincent-weaver-1.umelst.maine.edu> (raw)
In-Reply-To: <55469B90.1090903@bsc.es>
On Mon, 4 May 2015, Harald Servat wrote:
> Dear list,
>
> I'd like to use the perf library to access PEBS so as to collect referenced
> memory addresses from the user space. I think I've successfully setup the perf
> structures (struct perf_event_attr) to configure the performance counters, but
> I don't see what should I do to access to the captured memory addresses. I've
> seen that within arch/x86/kernel/cpu/perf_event_intel_ds.c there are the
> routines alloc_pebs_buffer, alloc_ds_buffer which seems to allocate and setup
> the necessary buffers using kmalloc_node calls. Question is, how can replicate
> this from the user space? And how we should connect these buffers to the PEBS
> infrastructure using perf calls?
You can try looking at the example code in my perf_event_tests code.
https://github.com/deater/perf_event_tests
The stuff you are looking for is probably covered in the
test/record_sample/samples_data_src
test/record_sample/sample_weight
and especially the
test/record_sample/sample_regs_intr
tests, although that last one requires a fairly recent kernel to work.
Vince
next prev parent reply other threads:[~2015-05-03 22:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-03 22:05 About using PEBS from the user space Harald Servat
2015-05-03 22:19 ` Vince Weaver [this message]
2015-05-04 8:13 ` Harald Servat
2015-05-04 10:17 ` Harald Servat
2015-06-25 16:00 ` Harald Servat
2015-06-25 19:06 ` Manuel Selva
2015-06-26 8:13 ` Harald Servat
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=alpine.DEB.2.11.1505031816450.4940@vincent-weaver-1.umelst.maine.edu \
--to=vincent.weaver@maine.edu \
--cc=harald.servat@bsc.es \
--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.