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

Unified Diff: base/debug/trace_event_impl.cc

Issue 23717045: Report trace event overhead stat with metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index ab3b36dccdb32adb54a6262d8edd1227ce42897a..39d23dd368fa033024bd19adc267aa9cc09e226d 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -816,20 +816,6 @@ TraceLog::ThreadLocalEventBuffer::ThreadLocalEventBuffer(TraceLog* trace_log)
event_count_(0) {
logged_events_.reserve(kTraceEventThreadLocalBufferSize);
- if (g_category_group_enabled[g_category_trace_event_overhead]) {
- int thread_id = static_cast<int>(PlatformThread::CurrentId());
- logged_events_.push_back(TraceEvent(
- thread_id,
- TimeTicks::NowFromSystemTraceTime() - trace_log->time_offset_,
- ThreadNow(),
- TRACE_EVENT_PHASE_ASYNC_BEGIN,
- &g_category_group_enabled[g_category_trace_event_overhead],
- "thread_trace_event",
- thread_id,
- 0, NULL, NULL, NULL, NULL,
- TRACE_EVENT_FLAG_HAS_ID));
- }
-
// ThreadLocalEventBuffer is created only if the thread has a message loop, so
// the following message_loop won't be NULL.
MessageLoop* message_loop = MessageLoop::current();
@@ -847,8 +833,6 @@ TraceLog::ThreadLocalEventBuffer::~ThreadLocalEventBuffer() {
// - no event generated for the thread;
// - the thread has no message loop;
// - trace_event_overhead is disabled.
- // The trace-viewer will ignore the TRACE_EVENT_PHASE_ASYNC_BEGIN event
- // because of no matching TRACE_EVENT_PHASE_ASYNC_END event.
if (event_count_) {
const char* arg_names[2] = { "event_count", "average_overhead" };
unsigned char arg_types[2];
@@ -858,17 +842,13 @@ TraceLog::ThreadLocalEventBuffer::~ThreadLocalEventBuffer() {
trace_event_internal::SetTraceValue(
overhead_.InMillisecondsF() / event_count_,
&arg_types[1], &arg_values[1]);
- int thread_id = static_cast<int>(PlatformThread::CurrentId());
logged_events_.push_back(TraceEvent(
- thread_id,
- TimeTicks::NowFromSystemTraceTime() - trace_log_->time_offset_,
- ThreadNow(),
- TRACE_EVENT_PHASE_ASYNC_END,
- &g_category_group_enabled[g_category_trace_event_overhead],
- "thread_trace_event",
- thread_id,
+ static_cast<int>(PlatformThread::CurrentId()),
+ TimeTicks(), TimeTicks(), TRACE_EVENT_PHASE_METADATA,
+ &g_category_group_enabled[g_category_metadata],
+ "trace_event_overhead", trace_event_internal::kNoEventId,
2, arg_names, arg_types, arg_values, NULL,
- TRACE_EVENT_FLAG_HAS_ID));
+ TRACE_EVENT_FLAG_NONE));
}
NotificationHelper notifier(trace_log_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698