Hi, I have been running some tests where I count and I am using PERF_FORMAT_GROUP. I want to extract all counts in one read().
It turns out that this does not work as expected. I would expect that if I create an event group, I can ALWAYS read it with a single read(). Turns out, it depends on the state of the events. If the events are still attached to a task then the read() returns the expected data which is: /* * { u64 nr; * { u64 time_enabled; } && PERF_FORMAT_ENABLED * { u64 time_running; } && PERF_FORMAT_RUNNING * { u64 value; * { u64 id; } && PERF_FORMAT_ID * } cntr[nr]; */ But if you read once the monitored task has died, i.e., events are detached, then all you get is the data for the leader of the group yet the value of nr still shows all the members of the group. Here is an example with 2 events + ENABLED+RUNNING: - task active, events attached: read()=40 (5* 8, 5=nr+enabled+running+2*value), nr=2 - task died, event detached: read()=32 (4*8 = nr+enabled+running+value) yet nr=2 Seems to me the events need to be linked in sibling_list regardless of the state they are in. And there is mismatch in how nr_siblings and sibling_list are managed. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel