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

Side by Side Diff: base/trace_event/trace_log.cc

Issue 2047793002: tracing: ensure __metadata events are always added to the trace (Closed) 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_event_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 4
5 #include "base/trace_event/trace_log.h" 5 #include "base/trace_event/trace_log.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 enabled_flag |= ENABLED_FOR_EVENT_CALLBACK; 472 enabled_flag |= ENABLED_FOR_EVENT_CALLBACK;
473 } 473 }
474 474
475 #if defined(OS_WIN) 475 #if defined(OS_WIN)
476 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( 476 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled(
477 category_group)) { 477 category_group)) {
478 enabled_flag |= ENABLED_FOR_ETW_EXPORT; 478 enabled_flag |= ENABLED_FOR_ETW_EXPORT;
479 } 479 }
480 #endif 480 #endif
481 481
482 // TODO(primiano): this is a temporary workaround for catapult:#2341,
483 // to guarantee that metadata events are always added even if the category
484 // filter is "-*". See crbug.com/618054 for more details and long-term fix.
485 if (mode_ == RECORDING_MODE && !strcmp(category_group, "__metadata"))
486 enabled_flag |= ENABLED_FOR_RECORDING;
487
482 g_category_group_enabled[category_index] = enabled_flag; 488 g_category_group_enabled[category_index] = enabled_flag;
483 } 489 }
484 490
485 void TraceLog::UpdateCategoryGroupEnabledFlags() { 491 void TraceLog::UpdateCategoryGroupEnabledFlags() {
486 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index); 492 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index);
487 for (size_t i = 0; i < category_index; i++) 493 for (size_t i = 0; i < category_index; i++)
488 UpdateCategoryGroupEnabledFlag(i); 494 UpdateCategoryGroupEnabledFlag(i);
489 } 495 }
490 496
491 void TraceLog::UpdateSyntheticDelaysFromTraceConfig() { 497 void TraceLog::UpdateSyntheticDelaysFromTraceConfig() {
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 } 1792 }
1787 1793
1788 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 1794 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
1789 if (*category_group_enabled_) { 1795 if (*category_group_enabled_) {
1790 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, 1796 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_,
1791 event_handle_); 1797 event_handle_);
1792 } 1798 }
1793 } 1799 }
1794 1800
1795 } // namespace trace_event_internal 1801 } // namespace trace_event_internal
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698