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

Unified Diff: chrome/browser/chrome_browser_field_trials_desktop.cc

Issue 2720353002: Flush stability file after initialization (Closed)
Patch Set: Address rkaplow comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/browser_watcher/features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials_desktop.cc
diff --git a/chrome/browser/chrome_browser_field_trials_desktop.cc b/chrome/browser/chrome_browser_field_trials_desktop.cc
index 47715a06258dff1e92f36cdbb9c33c3b44687a00..17f2a21714f97da299fea96affbe820acc0f8c92 100644
--- a/chrome/browser/chrome_browser_field_trials_desktop.cc
+++ b/chrome/browser/chrome_browser_field_trials_desktop.cc
@@ -115,6 +115,8 @@ void SetupStabilityDebugging() {
return;
}
+ SCOPED_UMA_HISTOGRAM_TIMER("ActivityTracker.Record.SetupTime");
+
// TODO(bcwhite): Adjust these numbers once there is real data to show
// just how much of an arena is necessary.
const size_t kMemorySize = 1 << 20; // 1 MiB
@@ -175,6 +177,17 @@ void SetupStabilityDebugging() {
// Record information about chrome's module. We want this to be done early.
RecordChromeModuleInfo(global_tracker);
+
+ // Trigger a flush of the memory mapped file to maximize the chances of
+ // having a minimal amount of content in the stability file, even if
+ // the system crashes or loses power. Note: this does not flush the file
+ // metadata nor does it wait for the changes to be flushed to disk before
+ // returning. This is an expensive operation. Run as an experiment to
+ // measure the effect on performance and collection.
+ if (base::FeatureList::IsEnabled(
+ browser_watcher::kStabilityDebuggingFlushFeature)) {
+ ::FlushViewOfFile(global_tracker->allocator()->data(), 0U);
+ }
}
}
#endif // defined(OS_WIN)
« no previous file with comments | « no previous file | components/browser_watcher/features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698