perfmon: fix pmc hw indices out-dated when multiple pmc 47/18447/2
authorSu Wang <su.z.wang@ericsson.com>
Thu, 21 Mar 2019 04:14:14 +0000 (00:14 -0400)
committerDamjan Marion <dmarion@me.com>
Tue, 26 Mar 2019 11:44:43 +0000 (11:44 +0000)
commit7297f47088274b0759dbef5d2c19d564d32521e6
tree0c3b7ddc6baec33e2503874f34aaebd40e12f320
parentcb36a1dbaf29babb536bd10d0ff3ff35ca57bfa3
perfmon: fix pmc hw indices out-dated when multiple pmc

When adding two or more events using a single "set pmc",
the pmc hardware indices might be out-dated due to kernel
reschdeduling the perf_event hardware counters.
E.g. set pmc cpu-cycles cache-misses

Solution:
Open and enable all the events first, then aquire the
indices from the kernel.

Change-Id: I6913a871ab169e3b2855ac6159f527a1fca343e9
Signed-off-by: Su Wang <su.z.wang@ericsson.com>
src/plugins/perfmon/perfmon_periodic.c