x86-64 "linear address" for PEBS from Linux userspace? -


is possible use haswell cpu feature pebs (precise event based sampling) directly linux userspace process instead of using kernel interface?

i have succeeded in accessing performance counters userspace using rdpmc instruction , using kernel wrmsr. makes me happy.

now want access pebs. need use msr ia32_ds_area supply "debug store" memory area. however, not sure how allocate memory , address need use. can allocate 2mb of contiguous physical memory (linux hugetlb mlock()). can resolve physical address of memory (via procfs). however, not sure whether either virtual or physical address suitable "linear address" supply msr. (my concern address may have in kernel's virtual address space don't have access to.)

how can prepare suitable memory ia32_ds_area , logging pebs events without writing custom kernel module?

yes, possible using perf infrastructure (you avoid using rdpmc/wrmsr). can find several examples in this github repo , more tests within tests/record_sample directory have multiple examples using pebs infrastructure through perf.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -