aboutsummaryrefslogtreecommitdiff
path: root/topology.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2014-08-03 00:57:16 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-08-05 18:07:53 +0200
commit66257905e7d358b870747eebca515e5b94925656 (patch)
treea25893c043de075430410e1cfc3ec7794c294479 /topology.c
parentff0625ad79dcacff31f2b87584bd11d9cf11faa4 (diff)
Improve the output
The output is now in the form of: ---------------------------------------------------------------- | P-state | min | max | avg | total | hits | ---------------------------------------------------------------- | cpu0 | ---------------------------------------------------------------- | 2.90GHz | 0us | 37.93ms | 383us | 163.89ms | 428 | | 2.20GHz | 11us | 1.69ms | 160us | 3.83ms | 24 | | 1.80GHz | 8us | 2.72ms | 106us | 6.37ms | 60 | | 1.30GHz | 1us | 4.51ms | 1.13ms | 5.65ms | 5 | | 1.20GHz | 0us | 17.75ms | 292us | 3.55s | 12148 | ---------------------------------------------------------------- | cpu1 | ---------------------------------------------------------------- | 2.90GHz | 0us | 5.59ms | 447us | 118.06ms | 264 | | 1.20GHz | 0us | 13.83ms | 656us | 3.05s | 4649 | ---------------------------------------------------------------- | cpu2 | ---------------------------------------------------------------- | 2.90GHz | 1us | 118.77ms | 1.45ms | 326.93ms | 225 | | 2.80GHz | 24us | 1.34ms | 263us | 5.26ms | 20 | | 2.50GHz | 11us | 2.49ms | 327us | 9.49ms | 29 | | 1.20GHz | 1us | 21.24ms | 404us | 3.99s | 9891 | ---------------------------------------------------------------- | cpu3 | ---------------------------------------------------------------- | 2.90GHz | 3us | 21.07ms | 720us | 127.51ms | 177 | | 1.60GHz | 3us | 5.14ms | 120us | 12.03ms | 100 | | 1.20GHz | 1us | 18.07ms | 660us | 2.76s | 4190 | ---------------------------------------------------------------- -------------------------------------------------------------------------------- | C-state | min | max | avg | total | hits | over | under | -------------------------------------------------------------------------------- | clusterA | -------------------------------------------------------------------------------- | C1-IVB | 0us | 1.24ms | 1.24ms | 1.24ms | 1 | 0 | 0 | | C7-IVB | 0us | 10.07ms | 1.78ms | 19.10s | 10739 | 0 | 0 | -------------------------------------------------------------------------------- | core0 | -------------------------------------------------------------------------------- | C1-IVB | 0us | 2.02ms | 262us | 3.14ms | 12 | 0 | 0 | | C7-IVB | 0us | 15.92ms | 2.09ms | 23.30s | 11163 | 0 | 0 | -------------------------------------------------------------------------------- | cpu0 | -------------------------------------------------------------------------------- | POLL | 3us | 3us | 3us | 3us | 1 | 0 | 0 | | C1-IVB | 0us | 2.95ms | 179us | 162.03ms | 905 | 0 | 0 | | C3-IVB | 1us | 9.07ms | 555us | 192.47ms | 347 | 0 | 0 | | C6-IVB | 6us | 3.84ms | 1.18ms | 40.13ms | 34 | 0 | 0 | | C7-IVB | 1us | 16.35ms | 2.27ms | 25.83s | 11396 | 0 | 0 | -------------------------------------------------------------------------------- | cpu1 | -------------------------------------------------------------------------------- | C1-IVB | 1us | 11.12ms | 173us | 54.09ms | 313 | 0 | 0 | | C3-IVB | 2us | 1.39ms | 399us | 55.81ms | 140 | 0 | 0 | | C6-IVB | 20us | 1.04ms | 517us | 2.07ms | 4 | 0 | 0 | | C7-IVB | 1us | 41.48ms | 5.93ms | 26.67s | 4495 | 0 | 0 | -------------------------------------------------------------------------------- | core1 | -------------------------------------------------------------------------------- | C1-IVB | 0us | 1.25ms | 116us | 4.04ms | 35 | 0 | 0 | | C7-IVB | 0us | 22.25ms | 2.17ms | 22.97s | 10605 | 0 | 0 | -------------------------------------------------------------------------------- | cpu2 | -------------------------------------------------------------------------------- | POLL | 3us | 3us | 3us | 3us | 1 | 0 | 0 | | C1-IVB | 1us | 9.65ms | 265us | 133.88ms | 505 | 0 | 0 | | C3-IVB | 1us | 3.74ms | 440us | 127.48ms | 290 | 0 | 0 | | C6-IVB | 24us | 2.34ms | 1.01ms | 32.32ms | 32 | 0 | 0 | | C7-IVB | 1us | 31.43ms | 2.70ms | 25.33s | 9369 | 0 | 0 | -------------------------------------------------------------------------------- | cpu3 | -------------------------------------------------------------------------------- | POLL | 11us | 11us | 11us | 11us | 1 | 0 | 0 | | C1-IVB | 1us | 4.80ms | 94us | 42.66ms | 455 | 0 | 0 | | C3-IVB | 1us | 2.00ms | 420us | 28.59ms | 68 | 0 | 0 | | C6-IVB | 31us | 1.42ms | 800us | 8.00ms | 10 | 0 | 0 | | C7-IVB | 0us | 98.04ms | 6.92ms | 26.99s | 3899 | 0 | 0 | -------------------------------------------------------------------------------- Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Larry Bassel <larry.bassel@linaro.org> Tested-by: Larry Bassel <larry.bassel@linaro.org>
Diffstat (limited to 'topology.c')
-rw-r--r--topology.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/topology.c b/topology.c
index dc71b61..5bf88a1 100644
--- a/topology.c
+++ b/topology.c
@@ -449,35 +449,32 @@ int establish_idledata_to_topo(struct cpuidle_datas *datas)
return 0;
}
-int dump_cpu_topo_info(int (*dump)(struct cpuidle_cstates *,
- struct cpufreq_pstates *, char *))
+int dump_cpu_topo_info(int (*dump)(void *, char *), int pstate)
{
struct cpu_physical *s_phy;
struct cpu_core *s_core;
struct cpu_cpu *s_cpu;
- char tmp[30];
- int tab = 0;
+ char tmp[30];
list_for_each_entry(s_phy, &g_cpu_topo_list.physical_head,
list_physical) {
+
sprintf(tmp, "cluster%c", s_phy->physical_id + 'A');
- dump(s_phy->cstates, NULL, tmp);
- list_for_each_entry(s_core, &s_phy->core_head, list_core) {
- if (s_core->is_ht) {
- sprintf(tmp, " core%d", s_core->core_id);
- dump(s_core->cstates, NULL, tmp);
+ if (!pstate)
+ dump(s_phy->cstates, tmp);
- tab = 1;
- } else {
- tab = 0;
+ list_for_each_entry(s_core, &s_phy->core_head, list_core) {
+ if (s_core->is_ht && !pstate) {
+ sprintf(tmp, "core%d", s_core->core_id);
+ dump(s_core->cstates, tmp);
}
list_for_each_entry(s_cpu, &s_core->cpu_head,
list_cpu) {
- sprintf(tmp, "%*ccpu%d", (tab + 1) * 2, 0x20,
- s_cpu->cpu_id);
- dump(s_cpu->cstates, s_cpu->pstates, tmp);
+ sprintf(tmp, "cpu%d", s_cpu->cpu_id);
+ dump(pstate ? s_cpu->pstates :
+ s_cpu->cstates, tmp);
}
}
}