summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-01-22 10:41:25 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-01-22 10:41:25 +0000
commitf8c68c7912da50451167fe4bcfd69717f2a30c98 (patch)
treeb0d03c2488adabfda26823d9bcd3eeaa422b3ce2 /apps/debug_menu.c
parenta3a303e440d751fbbb8c2532640098bfc969b75f (diff)
downloadrockbox-f8c68c7912da50451167fe4bcfd69717f2a30c98.tar.gz
rockbox-f8c68c7912da50451167fe4bcfd69717f2a30c98.zip
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
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c53
1 files changed, 52 insertions, 1 deletions
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)
2237 return false; 2237 return false;
2238} 2238}
2239#endif /* defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) */ 2239#endif /* defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) */
2240 2240#ifdef CPU_BOOST_LOGGING
2241static bool cpu_boost_log(void)
2242{
2243 int i = 0,j=0;
2244 int count = cpu_boost_log_getcount();
2245 int lines = LCD_HEIGHT/SYSFONT_HEIGHT;
2246 char *str;
2247 bool done;
2248 lcd_setmargins(0, 0);
2249 lcd_setfont(FONT_SYSFIXED);
2250 str = cpu_boost_log_getlog_first();
2251 while (i < count)
2252 {
2253 lcd_clear_display();
2254 for(j=0; j<lines; j++,i++)
2255 {
2256 if (!str)
2257 str = cpu_boost_log_getlog_next();
2258 if (str)
2259 {
2260 lcd_puts(0, j,str);
2261 }
2262 str = NULL;
2263 }
2264 lcd_update();
2265 done = false;
2266 action_signalscreenchange();
2267 while (!done)
2268 {
2269 switch(get_action(CONTEXT_STD,TIMEOUT_BLOCK))
2270 {
2271 case ACTION_STD_OK:
2272 case ACTION_STD_PREV:
2273 case ACTION_STD_NEXT:
2274 done = true;
2275 break;
2276 case ACTION_STD_CANCEL:
2277 i = count;
2278 done = true;
2279 break;
2280 }
2281 }
2282 }
2283 get_action(CONTEXT_STD,TIMEOUT_BLOCK);
2284 lcd_setfont(FONT_UI);
2285 action_signalscreenchange();
2286 return false;
2287}
2288#endif
2241bool debug_menu(void) 2289bool debug_menu(void)
2242{ 2290{
2243 int m; 2291 int m;
@@ -2312,6 +2360,9 @@ bool debug_menu(void)
2312 {"logf", logfdisplay }, 2360 {"logf", logfdisplay },
2313 {"logfdump", logfdump }, 2361 {"logfdump", logfdump },
2314#endif 2362#endif
2363#ifdef CPU_BOOST_LOGGING
2364 {"cpu_boost log",cpu_boost_log},
2365#endif
2315 }; 2366 };
2316 2367
2317 m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL, 2368 m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL,