summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
authorTorne Wuff <torne@wolfpuppy.org.uk>2010-04-01 16:27:21 +0000
committerTorne Wuff <torne@wolfpuppy.org.uk>2010-04-01 16:27:21 +0000
commit52e528e057d7fd8d55116edf40500e0c0b3b75e8 (patch)
tree651413bf0f31fc64baeef8b4063c697d5df07baa /apps/main.c
parentf376fd2f4aa9b27f2a6299177b4cc3c014da01f3 (diff)
downloadrockbox-52e528e057d7fd8d55116edf40500e0c0b3b75e8.zip
rockbox-52e528e057d7fd8d55116edf40500e0c0b3b75e8.tar.gz
rockbox-52e528e057d7fd8d55116edf40500e0c0b3b75e8.tar.bz2
rockbox-52e528e057d7fd8d55116edf40500e0c0b3b75e8.tar.xz
Boot charting support.
Select (B)ootchart in advanced options in configure, and logf will record timings for various stages of boot, for performance comparisons. Format logged is: BC:>function_name,123,80 where 123 is the line number, 80 is the number of ticks since boot. This can be loaded as CSV into a spreadsheet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25426 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/apps/main.c b/apps/main.c
index 7c43c0c..487848c 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -75,6 +75,7 @@
#include "icon.h"
#include "viewport.h"
#include "statusbar-skinned.h"
+#include "bootchart.h"
#ifdef IPOD_ACCESSORY_PROTOCOL
#include "iap.h"
@@ -136,7 +137,9 @@ int main(void)
#endif
{
int i;
+ CHART(">init");
init();
+ CHART("<init");
FOR_NB_SCREENS(i)
{
screens[i].clear_display();
@@ -167,6 +170,7 @@ int main(void)
global_status.last_volume_change = 0;
/* no calls INIT_ATTR functions after this point anymore!
* see definition of INIT_ATTR in config.h */
+ CHART(">root_menu");
root_menu();
}
@@ -414,13 +418,18 @@ static void init(void)
#ifdef CPU_ARM
enable_fiq();
#endif
+ /* current_tick should be ticking by now */
+ CHART("ticking");
+
lcd_init();
#ifdef HAVE_REMOTE_LCD
lcd_remote_init();
#endif
font_init();
+ CHART(">show_logo");
show_logo();
+ CHART("<show_logo");
lang_init(core_language_builtin, language_strings,
LANG_LAST_INDEX_IN_ARRAY);
@@ -436,7 +445,9 @@ static void init(void)
rtc_init();
#endif
#ifdef HAVE_RTC_RAM
+ CHART(">settings_load(RTC)");
settings_load(SETTINGS_RTC); /* early load parts of global_settings */
+ CHART("<settings_load(RTC)");
#endif
adc_init();
@@ -460,10 +471,18 @@ static void init(void)
/* Keep the order of this 3 (viewportmanager handles statusbars)
* Must be done before any code uses the multi-screen API */
+ CHART(">gui_syncstatusbar_init");
gui_syncstatusbar_init(&statusbars);
+ CHART("<gui_syncstatusbar_init");
+ CHART(">sb_skin_init");
sb_skin_init();
+ CHART("<sb_skin_init");
+ CHART(">gui_sync_wps_init");
gui_sync_wps_init();
+ CHART("<gui_sync_wps_init");
+ CHART(">viewportmanager_init");
viewportmanager_init();
+ CHART("<viewportmanager_init");
#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
/* charger_inserted() can't be used here because power_thread()
@@ -483,7 +502,9 @@ static void init(void)
}
#endif
+ CHART(">storage_init");
rc = storage_init();
+ CHART("<storage_init");
if(rc)
{
#ifdef HAVE_LCD_BITMAP
@@ -498,7 +519,9 @@ static void init(void)
}
#ifdef HAVE_EEPROM_SETTINGS
+ CHART(">eeprom_settings_init");
eeprom_settings_init();
+ CHART("<eeprom_settings_init");
#endif
#ifndef HAVE_USBSTACK
@@ -527,7 +550,9 @@ static void init(void)
if (!mounted)
{
+ CHART(">disk_mount_all");
rc = disk_mount_all();
+ CHART("<disk_mount_all");
if (rc<=0)
{
lcd_clear_display();
@@ -561,19 +586,32 @@ static void init(void)
}
else
#endif
+ {
+ CHART(">settings_load(ALL)");
settings_load(SETTINGS_ALL);
+ CHART("<settings_load(ALL)");
+ }
- if (init_dircache(true) < 0)
+ CHART(">init_dircache(true)");
+ rc = init_dircache(true);
+ CHART("<init_dircache(true");
+ if (rc < 0)
{
#ifdef HAVE_TAGCACHE
remove(TAGCACHE_STATEFILE);
#endif
}
+ CHART(">settings_apply(true)");
settings_apply(true);
+ CHART("<settings_apply(true)");
+ CHART(">init_dircache(false)");
init_dircache(false);
+ CHART("<init_dircache(false)");
#ifdef HAVE_TAGCACHE
+ CHART(">init_tagcache");
init_tagcache();
+ CHART("<init_tagcache");
#endif
#ifdef HAVE_EEPROM_SETTINGS
@@ -581,7 +619,9 @@ static void init(void)
{
/* In case we crash. */
firmware_settings.disk_clean = false;
+ CHART(">eeprom_settings_store");
eeprom_settings_store();
+ CHART("<eeprom_settings_store");
}
#endif
playlist_init();
@@ -614,7 +654,9 @@ static void init(void)
talk_init();
#endif /* CONFIG_CODEC != SWCODEC */
+ CHART(">audio_init");
audio_init();
+ CHART("<audio_init");
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR)
pcm_rec_init();
@@ -636,9 +678,13 @@ static void init(void)
lineout_set(global_settings.lineout_active);
#endif
#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
+ CHART("<check_bootfile(false)");
check_bootfile(false); /* remember write time and filesize */
+ CHART(">check_bootfile(false)");
#endif
+ CHART("<settings_apply_skins");
settings_apply_skins();
+ CHART(">settings_apply_skins");
}
#ifdef CPU_PP