utils/energy_model: Fix loading EM from recent android-4.14 targets
Created by: credp
Since commit 9001b8f1a, "ANDROID: sched: Add support for frequency/power energy model" android-4.14 has been able to load a frequency-based energy model.
Adding this extended the capacity_state structure in sched_group_energy with a new frequency member. This is automatically reflected in the energy model tuples printed in procfs and so Lisa can no longer load sensible Energy models from any target running android-4.14 later than the above commit, although the error is not detected so you do get an EnergyModel object which contains junk capacity and power values.
We can figure out which kind of kernel we have by reading the number of capacity states for a cpu and check how many items are in the cap_state tuples so that we can handle 2 or 3 values per state transparently.
Signed-off-by: Chris Redpath chris.redpath@arm.com