summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorUdo Schläpfer <rockbox-2014.10@desktopwarrior.net>2014-12-13 20:45:03 +0100
committerGerrit Rockbox <gerrit@rockbox.org>2015-01-30 20:15:21 +0100
commit6d3dc8fce0401da24ad45593e4eb9a68e2cde297 (patch)
tree48e61a3d6a99141dc2b1e6cf6037adbd0e58f056 /apps/debug_menu.c
parent572b36a51a7796e88c11cf0658ced40c1a6efece (diff)
iBasso DX50/DX90: CPU info enhancements.
System -> Debug (Keep Out) -> View CPU stats Will now show the current cpufreq scaling governor, minimum, current and maximum cpufreq scaling frequency for each CPU. This may be genric for Android kernel based devices but is only enabled for iBasso Devices. Other maintainers may choose do adopt this. Change-Id: I53e212f8707bf2abaa557e297293fb559ac37058
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 75e23b3945..e602b713c3 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -244,6 +244,23 @@ static const char* get_cpuinfo(int selected_item, void *data,
{
int cpu = (selected_item - 5) / (state_count + 1);
int cpu_line = (selected_item - 5) % (state_count + 1);
+#if defined(DX50) || defined(DX90)
+ int min_freq = min_scaling_frequency(cpu);
+ int cur_freq = current_scaling_frequency(cpu);
+ int max_freq = max_scaling_frequency(cpu);
+ char governor[20];
+ bool have_governor = current_scaling_governor(cpu, governor, sizeof(governor));
+ if(cpu_line == 0)
+ {
+ sprintf(buffer,
+ " CPU%d: %s: %d/%d/%d MHz",
+ cpu,
+ have_governor ? governor : "Min/Cur/Max freq",
+ min_freq > 0 ? min_freq/1000 : -1,
+ cur_freq > 0 ? cur_freq/1000 : -1,
+ max_freq > 0 ? max_freq/1000 : -1);
+ }
+#else
int freq1 = frequency_linux(cpu, false);
int freq2 = frequency_linux(cpu, true);
if (cpu_line == 0)
@@ -252,6 +269,7 @@ static const char* get_cpuinfo(int selected_item, void *data,
freq1 > 0 ? freq1/1000 : -1,
freq2 > 0 ? freq2/1000 : -1);
}
+#endif
else
{
cpustatetimes_linux(cpu, states, ARRAYLEN(states));