Hi Stephane,

I am testing an implementation of libpfm4, and ran into some curious behavior 
with the plm field in the perf_event_attr structure.  The code makes it appear 
to be intentional, but I thought I'd run this by you to see if it's what you 
had 
intended.

If I specify an event, such as PM_RUN_CYC:i, and I don't specify any u,k, or h 
modifiers, none of the exclude_* bits in the perf_events attribute record get 
set.  This seems ok; users may want to have events counted in all privilege 
levels by default.

However, if I specify "PM_RUN_CYC:i:k=0", saying I don't want kernel samples, I 
actually get all samples, because of this code:

        if (perf_attrs.plm) {
                hw->exclude_user = !(perf_attrs.plm & PFM_PLM3);
                hw->exclude_kernel = !(perf_attrs.plm & PFM_PLM0);
                hw->exclude_hv = !(perf_attrs.plm & PFM_PLMH);
        }

perf_attrs.plm is set to zero, if I set k=0.  If I were using this interface, 
I'd probably want hw->exclude_kernel to be set to 1.

Do you agree?  Should the behavior be changed?

Regards,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
cjash...@us.ibm.com


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to