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

Unified Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 1826973004: tracing: Add the TimeTicks clock source as trace metadata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « chrome/common/trace_event_args_whitelist.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_controller_impl.cc
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 86b0db3d37e6b2cbe91d9bee9c542b43a4ac71af..06ef7c8f04bb84ba2a6b3fb6f268a1004cf51b05 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -90,6 +90,24 @@ std::string GetNetworkTypeString() {
return "Unknown";
}
+std::string GetClockString() {
+ switch (base::TimeTicks::GetClock()) {
+ case base::TimeTicks::Clock::LINUX_CLOCK_MONOTONIC:
+ return "LINUX_CLOCK_MONOTONIC";
+ case base::TimeTicks::Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME:
+ return "IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME";
+ case base::TimeTicks::Clock::MAC_MACH_ABSOLUTE_TIME:
+ return "MAC_MACH_ABSOLUTE_TIME";
+ case base::TimeTicks::Clock::WIN_QPC:
+ return "WIN_QPC";
+ case base::TimeTicks::Clock::WIN_ROLLOVER_PROTECTED_TIME_GET_TIME:
+ return "WIN_ROLLOVER_PROTECTED_TIME_GET_TIME";
+ }
+
+ NOTREACHED();
+ return std::string();
+}
+
scoped_ptr<base::DictionaryValue> GenerateTracingMetadataDict() {
scoped_ptr<base::DictionaryValue> metadata_dict(new base::DictionaryValue());
@@ -145,7 +163,7 @@ scoped_ptr<base::DictionaryValue> GenerateTracingMetadataDict() {
if (delegate)
delegate->GenerateMetadataDict(metadata_dict.get());
- // Highres ticks.
+ metadata_dict->SetString("clock-domain", GetClockString());
metadata_dict->SetBoolean("highres-ticks",
base::TimeTicks::IsHighResolution());
« no previous file with comments | « chrome/common/trace_event_args_whitelist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698