Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Issue 1425263003: Use TimeTicks as much as possible in startup_metric_utils. (Closed)

Created:
5 years, 1 month ago by gab
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use TimeTicks as much as possible in startup_metric_utils. BUG=544131, 521164 Committed: https://crrev.com/4768aeea7babd463eae04fc7a51f318bad812885 Cr-Commit-Position: refs/heads/master@{#359183}

Patch Set 1 #

Total comments: 8

Patch Set 2 : comment #6 #

Patch Set 3 : merge up to r358781 #

Patch Set 4 : fix mac compile #

Total comments: 2

Patch Set 5 : adapt mojo as well + nit #

Total comments: 6

Patch Set 6 : msw nits #

Patch Set 7 : ifdef thread priority dance out on Mac per lack of support in base #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -155 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/mac/mac_startup_profiler.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/mac/mac_startup_profiler.cc View 1 2 3 4 5 1 chunk +6 lines, -11 lines 0 comments Download
M chrome/browser/metrics/first_web_contents_profiler.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/html_viewer/html_frame.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M components/html_viewer/html_widget.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M components/html_viewer/stats_collection_controller.cc View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M components/startup_metric_utils/browser/startup_metric_utils.h View 1 2 chunks +19 lines, -13 lines 0 comments Download
M components/startup_metric_utils/browser/startup_metric_utils.cc View 1 2 3 4 5 6 9 chunks +121 lines, -79 lines 2 comments Download
M mandoline/ui/desktop_ui/browser_manager.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M mandoline/ui/desktop_ui/browser_manager.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M mandoline/ui/desktop_ui/browser_window.cc View 1 2 3 4 3 chunks +6 lines, -5 lines 0 comments Download
M mojo/services/tracing/public/interfaces/tracing.mojom View 1 2 3 4 5 2 chunks +10 lines, -9 lines 0 comments Download
M mojo/services/tracing/tracing_app.h View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M mojo/services/tracing/tracing_app.cc View 1 2 3 4 2 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 62 (29 generated)
gab
Francois PTAL :-). Thanks! Gab
5 years, 1 month ago (2015-11-09 20:21:13 UTC) #5
fdoray
lgtm with comments https://codereview.chromium.org/1425263003/diff/60001/components/startup_metric_utils/browser/startup_metric_utils.cc File components/startup_metric_utils/browser/startup_metric_utils.cc (right): https://codereview.chromium.org/1425263003/diff/60001/components/startup_metric_utils/browser/startup_metric_utils.cc#newcode259 components/startup_metric_utils/browser/startup_metric_utils.cc:259: // is temporarily increased to avoid ...
5 years, 1 month ago (2015-11-09 21:27:16 UTC) #6
gab
Thanks, done (except for a TODO request which I didn't understand). https://codereview.chromium.org/1425263003/diff/60001/components/startup_metric_utils/browser/startup_metric_utils.cc File components/startup_metric_utils/browser/startup_metric_utils.cc (right): ...
5 years, 1 month ago (2015-11-10 01:25:29 UTC) #7
gab
@Nico for OWNERS on side-effects in chrome/browser/* Thanks, Gab
5 years, 1 month ago (2015-11-10 01:28:05 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/80001
5 years, 1 month ago (2015-11-10 01:30:33 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/92189) ios_rel_device_ninja on ...
5 years, 1 month ago (2015-11-10 01:46:28 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/100001
5 years, 1 month ago (2015-11-10 03:39:19 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/138308)
5 years, 1 month ago (2015-11-10 03:49:57 UTC) #19
Nico
chrome/ lgtm https://codereview.chromium.org/1425263003/diff/120001/chrome/browser/mac/mac_startup_profiler.cc File chrome/browser/mac/mac_startup_profiler.cc (right): https://codereview.chromium.org/1425263003/diff/120001/chrome/browser/mac/mac_startup_profiler.cc#newcode36 chrome/browser/mac/mac_startup_profiler.cc:36: it != profiled_ticks_.end(); ++it) { nit: since ...
5 years, 1 month ago (2015-11-10 05:15:50 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/140001
5 years, 1 month ago (2015-11-10 14:49:57 UTC) #22
gab
@msw for html_viewer @sky for mandoline/ and mojo/ Thanks, Gab https://codereview.chromium.org/1425263003/diff/120001/chrome/browser/mac/mac_startup_profiler.cc File chrome/browser/mac/mac_startup_profiler.cc (right): https://codereview.chromium.org/1425263003/diff/120001/chrome/browser/mac/mac_startup_profiler.cc#newcode36 ...
5 years, 1 month ago (2015-11-10 14:52:41 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/160001
5 years, 1 month ago (2015-11-10 15:14:32 UTC) #27
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/138502)
5 years, 1 month ago (2015-11-10 15:39:04 UTC) #29
sky
LGTM
5 years, 1 month ago (2015-11-10 18:53:10 UTC) #30
msw
lgtm with nits and q/+TODO(msw) https://codereview.chromium.org/1425263003/diff/160001/chrome/browser/mac/mac_startup_profiler.cc File chrome/browser/mac/mac_startup_profiler.cc (right): https://codereview.chromium.org/1425263003/diff/160001/chrome/browser/mac/mac_startup_profiler.cc#newcode35 chrome/browser/mac/mac_startup_profiler.cc:35: const Location location = ...
5 years, 1 month ago (2015-11-10 18:58:38 UTC) #31
gab
Thanks, comments addressed, sending to CQ. https://codereview.chromium.org/1425263003/diff/160001/chrome/browser/mac/mac_startup_profiler.cc File chrome/browser/mac/mac_startup_profiler.cc (right): https://codereview.chromium.org/1425263003/diff/160001/chrome/browser/mac/mac_startup_profiler.cc#newcode35 chrome/browser/mac/mac_startup_profiler.cc:35: const Location location ...
5 years, 1 month ago (2015-11-10 19:18:49 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/180001
5 years, 1 month ago (2015-11-10 19:20:21 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/138651)
5 years, 1 month ago (2015-11-10 19:51:23 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/180001
5 years, 1 month ago (2015-11-11 01:09:36 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/138919)
5 years, 1 month ago (2015-11-11 01:51:24 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/180001
5 years, 1 month ago (2015-11-11 01:57:25 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/138933)
5 years, 1 month ago (2015-11-11 02:29:29 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/180001
5 years, 1 month ago (2015-11-11 16:28:21 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/139146)
5 years, 1 month ago (2015-11-11 17:20:51 UTC) #49
gab
On 2015/11/11 17:20:51, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 1 month ago (2015-11-11 21:57:50 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425263003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425263003/220001
5 years, 1 month ago (2015-11-11 21:58:24 UTC) #54
commit-bot: I haz the power
Committed patchset #7 (id:220001)
5 years, 1 month ago (2015-11-11 23:37:30 UTC) #55
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/4768aeea7babd463eae04fc7a51f318bad812885 Cr-Commit-Position: refs/heads/master@{#359183}
5 years, 1 month ago (2015-11-12 20:01:39 UTC) #56
grt (UTC plus 2)
Question for you, Gab, relating to what I'm trying to fix in https://codereview.chromium.org/2345933002/. Thanks for ...
4 years, 3 months ago (2016-09-17 09:22:06 UTC) #58
fdoray
https://codereview.chromium.org/1425263003/diff/220001/components/startup_metric_utils/browser/startup_metric_utils.cc File components/startup_metric_utils/browser/startup_metric_utils.cc (right): https://codereview.chromium.org/1425263003/diff/220001/components/startup_metric_utils/browser/startup_metric_utils.cc#newcode269 components/startup_metric_utils/browser/startup_metric_utils.cc:269: static bool statics_initialized = false; On 2016/09/17 09:22:06, grt ...
4 years, 3 months ago (2016-09-19 13:14:46 UTC) #59
grt (UTC plus 2)
On 2016/09/19 13:14:46, fdoray wrote: > https://codereview.chromium.org/1425263003/diff/220001/components/startup_metric_utils/browser/startup_metric_utils.cc > File components/startup_metric_utils/browser/startup_metric_utils.cc (right): > > https://codereview.chromium.org/1425263003/diff/220001/components/startup_metric_utils/browser/startup_metric_utils.cc#newcode269 > ...
4 years, 3 months ago (2016-09-19 13:57:57 UTC) #60
gab
On 2016/09/19 13:57:57, grt (UTC plus 2) wrote: > On 2016/09/19 13:14:46, fdoray wrote: > ...
4 years, 3 months ago (2016-09-19 14:32:56 UTC) #61
fdoray
4 years, 3 months ago (2016-09-19 14:57:58 UTC) #62
Message was sent while issue was closed.
On 2016/09/19 13:57:57, grt (UTC plus 2) wrote:
> On 2016/09/19 13:14:46, fdoray wrote:
> >
>
https://codereview.chromium.org/1425263003/diff/220001/components/startup_met...
> > File components/startup_metric_utils/browser/startup_metric_utils.cc
(right):
> > 
> >
>
https://codereview.chromium.org/1425263003/diff/220001/components/startup_met...
> > components/startup_metric_utils/browser/startup_metric_utils.cc:269: static
> bool
> > statics_initialized = false;
> > On 2016/09/17 09:22:06, grt (UTC plus 2) wrote:
> > > Hi gang. The call to RecordExeMainEntryPointTime from chrome.exe is
> > problematic
> > > since it results in chrome.exe having a dependence on many browser-level
> libs.
> > > This recently led to an accidental 150% size increase in chrome.exe. In
> trying
> > > to resolve this, I naively grabbed TimeTicks in wWinMain instead of Time.
> > After
> > > brucedawson asked why I did that, I noticed this code here. Are you aware
> that
> > > there will be two copies of these statics in the process: one in
chrome.exe
> > > (initialized when RecordExeMainEntryPointTime is called) and one in
> chrome.dll
> > > (initialized when RecordStartupProcessCreationTime is called)? Is this a
> > > problem?
> > > 
> > > Will the right thing happen if I pass an internal base::Time value from
> > wWinMain
> > > into ChromeMain, and then do the Time -> TimeTicks conversion for the
> > > ExeMainEntryPointTime there?
> > 
> > RecordStartupProcessCreationTime() takes a base::Time as argument because
the
> > process creation time is only available as base::Time
> >
>
https://cs.chromium.org/chromium/src/base/process/process_info.h?sq=package:c...
> > , but there is no good reason why RecordExeMainEntryPointTime() takes a
> > base::Time as argument and converts it to base::Time instead of taking a
> > base::TimeTicks directly [1].
> > 
> > [1] Maybe a call to StartupTimeToTimeTicks was kept in
> > RecordExeMainEntryPointTime to initialize the static variable below? To make
> the
> > conversion of the process creation time from base::Time to base::TimeTicks
as
> > accurate as possible, these variables must be initialized as soon as
possible
> > after process creation. Given that there is a different copy of these
> variables
> > in chrome.exe/chrome.dll, it's really not useful to keep a call to
> > StartupTimeToTimeTicks in RecordExeMainEntryPointTime.
> > 
> > My recommendation:
> > 1. Change RecordExeMainEntryPointTime() to take a TimeTicks as argument.
> > 2. Capture a TimeTicks on exe main entry. Forward it to ChromeMain() and
call
> > RecordExeMainEntryPointTime() in ChromeMain.
> > 3. Remove the dependency from chrome.exe on startup_metric_utils.
> > 4. Capture base::Time/base::TimeTicks early in chrome.exe main. Forward the
> > values to ChromeMain() and use them to do the conversion of the process
> creation
> > time from base::Time to base::TimeTicks. (gab@ or me could take care of
this).
> 
> I did 1-3 in https://codereview.chromium.org/2345933002/#ps60001. Would you
mind
> taking a look at that to see what you think? In Patch Set 4 I switched back to
> base::Time, so disregard that. Is it "safe" for me to land Patch Set 3 before
> you or gab@ do #4?

It is "safe" to do 1-3 before we do 4. Because there are different copies of the
static variables in chrome.exe/chrome.dll, doing 1-3 won't change the time at
which we initialize the copies used to convert process creation time from Time
to TimeTicks.

Powered by Google App Engine
This is Rietveld 408576698