aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-21 00:46:52 +0200
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-21 00:46:52 +0200
commit6751e8c3f3778c971ba777aba2f3719c28211733 (patch)
tree4e8eae700bde75fb3ac68248c32a879b0607aee3
parent8a2d14faa7e56b63b129394d26ed40745907e141 (diff)
Energy_model: Don't add phony frequency to template
Idlestat adds phony frequency entries to the end of trace file to ensure all the last running state is accounted for. This phony frequency was unsigned int "-1" (aka 2^32-1 or 2^64-1), which was then listed in any energy model template generated from the trace file. This patch changes the phony frequency to 0 and makes the energy model template generation ignore 0 frequency. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r--energy_model.c3
-rw-r--r--idlestat.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/energy_model.c b/energy_model.c
index cbf3223..9f15fbc 100644
--- a/energy_model.c
+++ b/energy_model.c
@@ -90,6 +90,9 @@ static int make_energy_model_template(struct program_options *options)
for (i = 0; i < s_cpu->pstates->max; i++) {
struct cpufreq_pstate *p = &s_cpu->pstates->pstate[i];
+ if (p->freq == 0)
+ continue;
+
fprintf(f, "%d\t\t?\t?\n", p->freq/1000);
}
fprintf(f, "\nC-states:\n");
diff --git a/idlestat.c b/idlestat.c
index 9840a2e..b6f8cbc 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -392,7 +392,7 @@ static void output_pstates(FILE *f, struct init_pstates *initp, int nrcpus,
ts_usec = (ts - ts_sec) * USEC_PER_SEC;
for (cpu = 0; cpu < nrcpus; cpu++) {
- freq = initp? initp->freqs[cpu] : -1;
+ freq = initp? initp->freqs[cpu] : 0;
fprintf(f, "%16s-%-5d [%03d] .... %5lu.%06lu: cpu_frequency: "
"state=%u cpu_id=%d\n", "idlestat", getpid(), cpu,
ts_sec, ts_usec, freq, cpu);