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
Post a Comment