| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |