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

Unified Diff: base/trace_event/trace_event_impl.cc

Issue 1072133006: Add granular file tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@do-initialize
Patch Set: asdf Created 5 years, 8 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
« base/trace_event/trace_event.h ('K') | « base/trace_event/trace_event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_impl.cc
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc
index cbeeeabb0cbc833611d22d85c23781e562fe3f5e..a8fc22572a9714d11a2a3da3dd7291dc36c99719 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -306,7 +306,7 @@ class TraceBufferVector : public TraceBuffer {
scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) override {
// This function may be called when adding normal events or indirectly from
- // AddMetadataEventsWhileLocked(). We can not DECHECK(!IsFull()) because we
+ // AddMetadataEventsWhileLocked(). We can not DCHECK(!IsFull()) because we
// have to add the metadata events and flush thread-local buffers even if
// the buffer is full.
*index = chunks_.size();
@@ -724,7 +724,8 @@ void TraceEvent::AppendAsJSON(std::string* out) const {
}
*out += "}";
- if (phase_ == TRACE_EVENT_PHASE_COMPLETE) {
+ if (phase_ == TRACE_EVENT_PHASE_COMPLETE ||
+ phase_ == TRACE_EVENT_PHASE_NESTABLE_ASYNC_COMPLETE) {
int64 duration = duration_.ToInternalValue();
if (duration != -1)
StringAppendF(out, ",\"dur\":%" PRId64, duration);
@@ -2077,6 +2078,7 @@ std::string TraceLog::EventToConsoleMessage(unsigned char phase,
// The caller should translate TRACE_EVENT_PHASE_COMPLETE to
// TRACE_EVENT_PHASE_BEGIN or TRACE_EVENT_END.
DCHECK(phase != TRACE_EVENT_PHASE_COMPLETE);
+ DCHECK(phase != TRACE_EVENT_PHASE_NESTABLE_ASYNC_COMPLETE);
TimeDelta duration;
int thread_id = trace_event ?
@@ -2159,7 +2161,8 @@ void TraceLog::UpdateTraceEventDuration(
TraceEvent* trace_event = GetEventByHandleInternal(handle, &lock);
if (trace_event) {
- DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE);
+ DCHECK(trace_event->phase() == TRACE_EVENT_PHASE_COMPLETE ||
+ trace_event->phase() == TRACE_EVENT_PHASE_NESTABLE_ASYNC_COMPLETE);
trace_event->UpdateDuration(now, thread_now);
#if defined(OS_ANDROID)
trace_event->SendToATrace();
« base/trace_event/trace_event.h ('K') | « base/trace_event/trace_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698