Hi Stephane,

When I posted the patch, I hadn't really tested it much.  Now that I'm testing 
it, I'm seeing some very strange behavior.  After I worked through a number of 
oversights I had made, I have come to this point where I find that grouping and 
"enable_on_exec" don't appear to work together.  At first I thought it was my 
code, but I reverted back to the stock code for "task", and am seeing this on 
Linux kernel version 2.6.33.3:

% ./task -e PM_RUN_CYC,PM_INST_CMPL sleep 3
             438,780 PM_RUN_CYC (963,728 : 963,728)
             139,211 PM_INST_CMPL (963,728 : 963,728)

This looks correct, but if I add the -g switch:

% ./task -g -e PM_RUN_CYC,PM_INST_CMPL sleep 3
task: could not read event0 ret=32         <<<<<<<< Notice this
             437,055 PM_RUN_CYC (930,392 : 930,392)
                   0 PM_INST_CMPL (930,392 : 930,392)

Does this look familiar to you?

I hacked at the code so that it would do only self-monitoring, and found that 
reading up the values works fine in that case.  Only when monitoring another 
pid do we always read fewer bytes than what we ask for (in this case 32 instead 
of 40).  I have read up the "nr" value from the "PERF_EVENT_FORMAT_GROUP" 
record, and the value is correct (it contains the number of counters in the 
group), so it seems to be that we simply cannot read past the first counter 
value.

I'm starting to suspect a kernel bug here.  I've thought about trying the -tip 
kernel (I started with 2.6.32.11 where I had the same issue), but I thought I'd 
run this by you first.

Regards,

- Corey


------------------------------------------------------------------------------
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to