Debug menu entry for the dircache.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8071 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2005-11-26 20:22:19 +00:00
parent 3026f046e3
commit 8f280a30f3
3 changed files with 62 additions and 0 deletions

View file

@ -1668,6 +1668,56 @@ static bool dbg_disk_info(void)
}
#endif /* !HAVE_MMC */
#ifdef HAVE_DIRCACHE
static bool dbg_dircache_info(void)
{
bool done = false;
int line;
char buf[32];
lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
while (!done)
{
line = 0;
lcd_clear_display();
snprintf(buf, sizeof(buf), "Cache initialized: %s",
dircache_is_enabled() ? "Yes" : "No");
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "Cache size: %d B",
dircache_get_cache_size());
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "Last size: %d B",
global_settings.dircache_size);
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "Limit: %d B", DIRCACHE_LIMIT);
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "Reserve: %d/%d B",
dircache_get_reserve_used(), DIRCACHE_RESERVE);
lcd_puts(0, line++, buf);
lcd_update();
switch (button_get_w_tmo(HZ/2))
{
case SETTINGS_OK:
case SETTINGS_CANCEL:
done = true;
break;
}
}
return false;
}
#endif /* HAVE_DIRCACHE */
#if CONFIG_CPU == SH7034
bool dbg_save_roms(void)
{
@ -1804,6 +1854,9 @@ bool debug_menu(void)
#else
{ "View disk info", dbg_disk_info },
#endif
#ifdef HAVE_DIRCACHE
{ "View dircache info", dbg_dircache_info },
#endif
#ifdef HAVE_LCD_BITMAP
{ "View audio thread", dbg_audio_thread },
#ifdef PM_DEBUG

View file

@ -494,6 +494,14 @@ int dircache_get_cache_size(void)
return dircache_size;
}
int dircache_get_reserve_used(void)
{
if (!dircache_is_enabled())
return 0;
return reserve_used;
}
void dircache_disable(void)
{
int i;

View file

@ -71,6 +71,7 @@ int dircache_save(const char *path);
int dircache_build(int last_size);
bool dircache_is_enabled(void);
int dircache_get_cache_size(void);
int dircache_get_reserve_used(void);
void dircache_disable(void);
const struct dircache_entry *dircache_get_entry_ptr(const char *filename);
void dircache_copy_path(const struct dircache_entry *entry, char *buf, int size);