forked from len0rd/rockbox
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
This commit is contained in:
parent
a3a303e440
commit
f8c68c7912
7 changed files with 133 additions and 3 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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<lines; j++,i++)
|
||||
{
|
||||
if (!str)
|
||||
str = cpu_boost_log_getlog_next();
|
||||
if (str)
|
||||
{
|
||||
lcd_puts(0, j,str);
|
||||
}
|
||||
str = NULL;
|
||||
}
|
||||
lcd_update();
|
||||
done = false;
|
||||
action_signalscreenchange();
|
||||
while (!done)
|
||||
{
|
||||
switch(get_action(CONTEXT_STD,TIMEOUT_BLOCK))
|
||||
{
|
||||
case ACTION_STD_OK:
|
||||
case ACTION_STD_PREV:
|
||||
case ACTION_STD_NEXT:
|
||||
done = true;
|
||||
break;
|
||||
case ACTION_STD_CANCEL:
|
||||
i = count;
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
get_action(CONTEXT_STD,TIMEOUT_BLOCK);
|
||||
lcd_setfont(FONT_UI);
|
||||
action_signalscreenchange();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
bool debug_menu(void)
|
||||
{
|
||||
int m;
|
||||
|
|
@ -2311,6 +2359,9 @@ bool debug_menu(void)
|
|||
#ifdef ROCKBOX_HAS_LOGF
|
||||
{"logf", logfdisplay },
|
||||
{"logfdump", logfdump },
|
||||
#endif
|
||||
#ifdef CPU_BOOST_LOGGING
|
||||
{"cpu_boost log",cpu_boost_log},
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -250,8 +250,13 @@ static const struct plugin_api rockbox_api = {
|
|||
#ifndef SIMULATOR
|
||||
system_memory_guard,
|
||||
&cpu_frequency,
|
||||
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
#ifdef CPU_BOOST_LOGGING
|
||||
cpu_boost_,
|
||||
#else
|
||||
cpu_boost,
|
||||
#endif
|
||||
#endif
|
||||
timer_register,
|
||||
timer_unregister,
|
||||
|
|
|
|||
|
|
@ -344,7 +344,11 @@ struct plugin_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
|
||||
bool (*timer_register)(int reg_prio, void (*unregister_callback)(void),
|
||||
long cycles, int int_prio,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue