From 6d3dc8fce0401da24ad45593e4eb9a68e2cde297 Mon Sep 17 00:00:00 2001 From: Udo Schläpfer Date: Sat, 13 Dec 2014 20:45:03 +0100 Subject: 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 --- apps/debug_menu.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'apps') 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)); -- cgit v1.2.3