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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 2040663002: Tracing: Added necessary plumbing to make sure clocksync metadata events are always included. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_log.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "content/browser/tracing/tracing_controller_impl.h" 4 #include "content/browser/tracing/tracing_controller_impl.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/cpu.h" 7 #include "base/cpu.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/json/string_escape.h" 10 #include "base/json/string_escape.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 FROM_HERE, base::TimeDelta::FromSeconds(kStartTracingTimeoutSeconds), 301 FROM_HERE, base::TimeDelta::FromSeconds(kStartTracingTimeoutSeconds),
302 base::Bind(&TracingControllerImpl::OnAllTracingAgentsStarted, 302 base::Bind(&TracingControllerImpl::OnAllTracingAgentsStarted,
303 base::Unretained(this))); 303 base::Unretained(this)));
304 304
305 return true; 305 return true;
306 } 306 }
307 307
308 void TracingControllerImpl::OnAllTracingAgentsStarted() { 308 void TracingControllerImpl::OnAllTracingAgentsStarted() {
309 DCHECK_CURRENTLY_ON(BrowserThread::UI); 309 DCHECK_CURRENTLY_ON(BrowserThread::UI);
310 310
311 TRACE_EVENT_API_ADD_METADATA_EVENT( 311 TRACE_EVENT_METADATA_FORCED1("IsTimeTicksHighResolution", "value",
312 TraceLog::GetCategoryGroupEnabled("__metadata"), 312 base::TimeTicks::IsHighResolution());
313 "IsTimeTicksHighResolution", "value", 313 TRACE_EVENT_METADATA_FORCED1(
314 base::TimeTicks::IsHighResolution()); 314 "TraceConfig", "value",
315 TRACE_EVENT_API_ADD_METADATA_EVENT(
316 TraceLog::GetCategoryGroupEnabled("__metadata"), "TraceConfig", "value",
317 start_tracing_trace_config_->AsConvertableToTraceFormat()); 315 start_tracing_trace_config_->AsConvertableToTraceFormat());
318 316
319 // Notify all child processes. 317 // Notify all child processes.
320 for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin(); 318 for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
321 it != trace_message_filters_.end(); ++it) { 319 it != trace_message_filters_.end(); ++it) {
322 it->get()->SendBeginTracing(*start_tracing_trace_config_); 320 it->get()->SendBeginTracing(*start_tracing_trace_config_);
323 } 321 }
324 322
325 if (!start_tracing_done_callback_.is_null()) 323 if (!start_tracing_done_callback_.is_null())
326 start_tracing_done_callback_.Run(); 324 start_tracing_done_callback_.Run();
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 const bool global_success = failed_memory_dump_count_ == 0; 1024 const bool global_success = failed_memory_dump_count_ == 0;
1027 if (!pending_memory_dump_callback_.is_null()) { 1025 if (!pending_memory_dump_callback_.is_null()) {
1028 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, 1026 pending_memory_dump_callback_.Run(pending_memory_dump_guid_,
1029 global_success); 1027 global_success);
1030 pending_memory_dump_callback_.Reset(); 1028 pending_memory_dump_callback_.Reset();
1031 } 1029 }
1032 pending_memory_dump_guid_ = 0; 1030 pending_memory_dump_guid_ = 0;
1033 } 1031 }
1034 1032
1035 } // namespace content 1033 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/trace_log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698