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 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 void TraceLog::UpdateETWCategoryGroupEnabledFlags() { | 1655 void TraceLog::UpdateETWCategoryGroupEnabledFlags() { |
1656 AutoLock lock(lock_); | 1656 AutoLock lock(lock_); |
1657 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index); | 1657 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index); |
1658 // Go through each category and set/clear the ETW bit depending on whether the | 1658 // Go through each category and set/clear the ETW bit depending on whether the |
1659 // category is enabled. | 1659 // category is enabled. |
1660 for (size_t i = 0; i < category_index; i++) { | 1660 for (size_t i = 0; i < category_index; i++) { |
1661 const char* category_group = g_category_groups[i]; | 1661 const char* category_group = g_category_groups[i]; |
1662 DCHECK(category_group); | 1662 DCHECK(category_group); |
1663 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( | 1663 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( |
1664 category_group)) { | 1664 category_group)) { |
1665 g_category_group_enabled[category_index] |= ENABLED_FOR_ETW_EXPORT; | 1665 g_category_group_enabled[i] |= ENABLED_FOR_ETW_EXPORT; |
1666 } else { | 1666 } else { |
1667 g_category_group_enabled[category_index] &= ~ENABLED_FOR_ETW_EXPORT; | 1667 g_category_group_enabled[i] &= ~ENABLED_FOR_ETW_EXPORT; |
1668 } | 1668 } |
1669 } | 1669 } |
1670 } | 1670 } |
1671 #endif // defined(OS_WIN) | 1671 #endif // defined(OS_WIN) |
1672 | 1672 |
1673 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( | 1673 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( |
1674 TraceEventMemoryOverhead* overhead) { | 1674 TraceEventMemoryOverhead* overhead) { |
1675 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); | 1675 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); |
1676 } | 1676 } |
1677 | 1677 |
(...skipping 24 matching lines...) Expand all Loading... |
1702 } | 1702 } |
1703 | 1703 |
1704 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1704 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1705 if (*category_group_enabled_) { | 1705 if (*category_group_enabled_) { |
1706 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1706 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1707 event_handle_); | 1707 event_handle_); |
1708 } | 1708 } |
1709 } | 1709 } |
1710 | 1710 |
1711 } // namespace trace_event_internal | 1711 } // namespace trace_event_internal |
OLD | NEW |