> On Jan 7, 2016, at 12:49 AM, Stephane Eranian <[email protected]> wrote:
>
> Thanks for tracking this down. So if I understand correctly, the problem is
> related to the default value of exclude_guest set by libpfm4
> on systems with paranoid=2. Is that correct?
Yes, although I’m not entirely sure the problem is linked to paranoid = 2, but
could be. Unfortunately, it’s something I cannot try. This is on Cray’s Linux
which looks a lot like When I try the examples below on upstream, I still get
errors due to the exclude_guest flag. I had assumed has_vmx was triggered by a
cpuinfo flag but it seems to be solely on the basis of the available attributes.
attr->exclude_user = !(plm & PFM_PLM3);
attr->exclude_kernel = !(plm & PFM_PLM0);
attr->exclude_hv = !(plm & PFM_PLMH);
#if 0
attr->exclude_guest = !(vmx_plm & PFM_PLM3);
#endif
attr->exclude_host = !(vmx_plm & PFM_PLM0);
attr->pinned = pinned;
> If I use upstream and set paranoid=2, then:
> $ LIBPFM_VERBOSE=1 perf_examples/task -e cycles true
> PERF[type=0 config=0x0 config1=0x0 excl=0 e_u=0 e_k=0 e_hv=0 e_host=0 e_gu=1
> period=0 freq=0 precise=0 pinned=0] cycles
> task: cannot attach event0 cycles: Permission denied
>
> $ LIBPFM_VERBOSE=1 perf_examples/task -e cycles:u true
> PERF[type=0 config=0x0 config1=0x0 excl=0 e_u=0 e_k=1 e_hv=0 e_host=0 e_gu=1
> period=0 freq=0 precise=0 pinned=0] cycles:u
>
> 123747 cycles:u (0.00% scaling, ena=1369199, run=1369199)
>
> The problem I have here is related to what paranoid=2 is supposed to restrict
> which is:
> * 2 - disallow kernel profiling for unpriv
>
> But if I do cycles:u, libpfm4 sets up
> exclude_user = 0
> exclude_kernel = 1
> exclude_hypervisor = 0
> exclude_host = 0
> exclude_guest = 1
>
> and this works, meaning that the hypervisor and host can be monitored and
> appear to be
> considered as not part of the kernel which seems contradictory to me. Vince,
> what do you think?
>
> Also libpfm4 does not read any vmx config from cpuinfo.
------------------------------------------------------------------------------
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel