sync: Improve ModelAssociation event tracing

Take advantage of the ASYNC variants of the event tracing macros when
tracing model association times.  This makes the model association
tracing much more reliable and easier to read.

BUG=286541

Review URL: https://chromiumcodereview.appspot.com/23907005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221879 0039d316-1c4b-4281-b951-d872f2087c98
parent 7d72396c
......@@ -240,7 +240,10 @@ void ModelAssociationManager::Stop() {
waiting_to_associate_.size() > 0);
if (currently_associating_) {
TRACE_EVENT_END0("sync", "ModelAssociation");
TRACE_EVENT_ASYNC_END1("sync", "ModelAssociation",
currently_associating_,
"DataType",
ModelTypeToString(currently_associating_->type()));
DVLOG(1) << "ModelAssociationManager: stopping "
<< currently_associating_->name();
currently_associating_->Stop();
......@@ -324,7 +327,10 @@ void ModelAssociationManager::TypeStartCallback(
const syncer::SyncMergeResult& local_merge_result,
const syncer::SyncMergeResult& syncer_merge_result) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TRACE_EVENT_END0("sync", "ModelAssociation");
TRACE_EVENT_ASYNC_END1("sync", "ModelAssociation",
currently_associating_,
"DataType",
ModelTypeToString(currently_associating_->type()));
DVLOG(1) << "ModelAssociationManager: TypeStartCallback";
if (state_ == ABORTED) {
......@@ -513,13 +519,14 @@ void ModelAssociationManager::StartAssociatingNextType() {
if (!waiting_to_associate_.empty()) {
DVLOG(1) << "ModelAssociationManager: Starting "
<< waiting_to_associate_[0]->name();
TRACE_EVENT_BEGIN1("sync", "ModelAssociation",
"DataType",
ModelTypeToString(waiting_to_associate_[0]->type()));
DataTypeController* dtc = waiting_to_associate_[0];
waiting_to_associate_.erase(waiting_to_associate_.begin());
currently_associating_ = dtc;
current_type_association_start_time_ = base::Time::Now();
TRACE_EVENT_ASYNC_BEGIN1("sync", "ModelAssociation",
currently_associating_,
"DataType",
ModelTypeToString(currently_associating_->type()));
dtc->StartAssociating(base::Bind(
&ModelAssociationManager::TypeStartCallback,
weak_ptr_factory_.GetWeakPtr()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment