From f8c68c7912da50451167fe4bcfd69717f2a30c98 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 22 Jan 2007 10:41:25 +0000 Subject: Simple cpu boost tracker for LOGF builds. Shows the last 64 cpu_boost() calls from the debug menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12087 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs.c | 4 ++++ apps/codecs.h | 4 ++++ apps/debug_menu.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++- apps/plugin.c | 5 +++++ apps/plugin.h | 4 ++++ firmware/export/system.h | 18 +++++++++++++++- firmware/system.c | 48 ++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 133 insertions(+), 3 deletions(-) diff --git a/apps/codecs.c b/apps/codecs.c index a093c2b601..3af5158fbb 100644 --- a/apps/codecs.c +++ b/apps/codecs.c @@ -131,8 +131,12 @@ struct codec_api ci = { system_memory_guard, &cpu_frequency, #ifdef HAVE_ADJUSTABLE_CPU_FREQ +#ifdef CPU_BOOST_LOGGING + cpu_boost_, +#else cpu_boost, #endif +#endif #endif /* strings and memory */ diff --git a/apps/codecs.h b/apps/codecs.h index dff219c058..cef14c3971 100644 --- a/apps/codecs.h +++ b/apps/codecs.h @@ -209,8 +209,12 @@ struct codec_api { int (*system_memory_guard)(int newmode); long *cpu_frequency; #ifdef HAVE_ADJUSTABLE_CPU_FREQ +#ifdef CPU_BOOST_LOGGING + void (*cpu_boost_)(bool on_off,char*location,int line); +#else void (*cpu_boost)(bool on_off); #endif +#endif #endif /* strings and memory */ diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 081bf2f63e..22db43d272 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2237,7 +2237,55 @@ static bool dbg_write_eeprom(void) return false; } #endif /* defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) */ - +#ifdef CPU_BOOST_LOGGING +static bool cpu_boost_log(void) +{ + int i = 0,j=0; + int count = cpu_boost_log_getcount(); + int lines = LCD_HEIGHT/SYSFONT_HEIGHT; + char *str; + bool done; + lcd_setmargins(0, 0); + lcd_setfont(FONT_SYSFIXED); + str = cpu_boost_log_getlog_first(); + while (i < count) + { + lcd_clear_display(); + for(j=0; j