| 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 void TraceLog::UpdateETWCategoryGroupEnabledFlags() { | 1711 void TraceLog::UpdateETWCategoryGroupEnabledFlags() { |
| 1712 AutoLock lock(lock_); | 1712 AutoLock lock(lock_); |
| 1713 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index); | 1713 size_t category_index = base::subtle::NoBarrier_Load(&g_category_index); |
| 1714 // Go through each category and set/clear the ETW bit depending on whether the | 1714 // Go through each category and set/clear the ETW bit depending on whether the |
| 1715 // category is enabled. | 1715 // category is enabled. |
| 1716 for (size_t i = 0; i < category_index; i++) { | 1716 for (size_t i = 0; i < category_index; i++) { |
| 1717 const char* category_group = g_category_groups[i]; | 1717 const char* category_group = g_category_groups[i]; |
| 1718 DCHECK(category_group); | 1718 DCHECK(category_group); |
| 1719 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( | 1719 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( |
| 1720 category_group)) { | 1720 category_group)) { |
| 1721 g_category_group_enabled[category_index] |= ENABLED_FOR_ETW_EXPORT; | 1721 g_category_group_enabled[i] |= ENABLED_FOR_ETW_EXPORT; |
| 1722 } else { | 1722 } else { |
| 1723 g_category_group_enabled[category_index] &= ~ENABLED_FOR_ETW_EXPORT; | 1723 g_category_group_enabled[i] &= ~ENABLED_FOR_ETW_EXPORT; |
| 1724 } | 1724 } |
| 1725 } | 1725 } |
| 1726 } | 1726 } |
| 1727 #endif // defined(OS_WIN) | 1727 #endif // defined(OS_WIN) |
| 1728 | 1728 |
| 1729 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( | 1729 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( |
| 1730 TraceEventMemoryOverhead* overhead) { | 1730 TraceEventMemoryOverhead* overhead) { |
| 1731 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); | 1731 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); |
| 1732 } | 1732 } |
| 1733 | 1733 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 } | 1765 } |
| 1766 | 1766 |
| 1767 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1767 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
| 1768 if (*category_group_enabled_) { | 1768 if (*category_group_enabled_) { |
| 1769 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1769 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
| 1770 event_handle_); | 1770 event_handle_); |
| 1771 } | 1771 } |
| 1772 } | 1772 } |
| 1773 | 1773 |
| 1774 } // namespace trace_event_internal | 1774 } // namespace trace_event_internal |
| OLD | NEW |