From 03b3d3fe34206d788cef52947de0093c4aa100da Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Wed, 5 May 2010 23:50:16 +0000 Subject: Add time for when chrome's main() is called. Also output chrome's time to launch on the login screen. Review URL: http://codereview.chromium.org/2003001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46526 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/boot_times_loader.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/browser/chromeos/boot_times_loader.cc') diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index 86354ae5..c169298 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -100,12 +100,21 @@ void BootTimesLoader::Backend::GetBootTimes( const char* kClockSpeedCommand = "dmesg | grep -e 'Detected.*processor'"; const char* kClockSpeedPrefix = "Detected "; const char* kPreStartup = "uptime-pre-startup"; + const char* kChromeExec = "uptime-chrome-exec"; + const char* kChromeMain = "uptime-chrome-main"; const char* kXStarted = "uptime-x-started"; const char* kLoginPromptReady = "uptime-login-prompt-ready"; if (request->canceled()) return; + // Wait until login_prompt_ready is output. + FilePath log_dir(kLogPath); + FilePath log_file = log_dir.Append(kLoginPromptReady); + while (!file_util::PathExists(log_file)) { + usleep(500000); + } + BootTimes boot_times; std::string tsc_value = ExecuteInShell(kInitialTSCCommand, kInitialTSCPrefix); std::string speed_value = @@ -122,6 +131,8 @@ void BootTimesLoader::Backend::GetBootTimes( } GetUptime(kPreStartup, &boot_times.pre_startup); GetUptime(kXStarted, &boot_times.x_started); + GetUptime(kChromeExec, &boot_times.chrome_exec); + GetUptime(kChromeMain, &boot_times.chrome_main); GetUptime(kLoginPromptReady, &boot_times.login_prompt_ready); request->ForwardResult( -- cgit v1.1