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 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 else if (options & kInternalEchoToConsole) | 1700 else if (options & kInternalEchoToConsole) |
1701 return TraceBuffer::CreateTraceBufferRingBuffer( | 1701 return TraceBuffer::CreateTraceBufferRingBuffer( |
1702 kEchoToConsoleTraceEventBufferChunks); | 1702 kEchoToConsoleTraceEventBufferChunks); |
1703 else if (options & kInternalRecordAsMuchAsPossible) | 1703 else if (options & kInternalRecordAsMuchAsPossible) |
1704 return TraceBuffer::CreateTraceBufferVectorOfSize( | 1704 return TraceBuffer::CreateTraceBufferVectorOfSize( |
1705 kTraceEventVectorBigBufferChunks); | 1705 kTraceEventVectorBigBufferChunks); |
1706 return TraceBuffer::CreateTraceBufferVectorOfSize( | 1706 return TraceBuffer::CreateTraceBufferVectorOfSize( |
1707 kTraceEventVectorBufferChunks); | 1707 kTraceEventVectorBufferChunks); |
1708 } | 1708 } |
1709 | 1709 |
| 1710 #if defined(OS_WIN) |
| 1711 void TraceLog::UpdateETWCategoryGroupEnabledFlags() { |
| 1712 AutoLock lock(lock_); |
| 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 |
| 1715 // category is enabled. |
| 1716 for (size_t i = 0; i < category_index; i++) { |
| 1717 const char* category_group = g_category_groups[i]; |
| 1718 DCHECK(category_group); |
| 1719 if (base::trace_event::TraceEventETWExport::IsCategoryGroupEnabled( |
| 1720 category_group)) { |
| 1721 g_category_group_enabled[category_index] |= ENABLED_FOR_ETW_EXPORT; |
| 1722 } else { |
| 1723 g_category_group_enabled[category_index] &= ~ENABLED_FOR_ETW_EXPORT; |
| 1724 } |
| 1725 } |
| 1726 } |
| 1727 #endif // defined(OS_WIN) |
| 1728 |
1710 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( | 1729 void ConvertableToTraceFormat::EstimateTraceMemoryOverhead( |
1711 TraceEventMemoryOverhead* overhead) { | 1730 TraceEventMemoryOverhead* overhead) { |
1712 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); | 1731 overhead->Add("ConvertableToTraceFormat(Unknown)", sizeof(*this)); |
1713 } | 1732 } |
1714 | 1733 |
1715 } // namespace trace_event | 1734 } // namespace trace_event |
1716 } // namespace base | 1735 } // namespace base |
1717 | 1736 |
1718 namespace trace_event_internal { | 1737 namespace trace_event_internal { |
1719 | 1738 |
(...skipping 26 matching lines...) Expand all Loading... |
1746 } | 1765 } |
1747 | 1766 |
1748 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1767 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1749 if (*category_group_enabled_) { | 1768 if (*category_group_enabled_) { |
1750 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1769 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1751 event_handle_); | 1770 event_handle_); |
1752 } | 1771 } |
1753 } | 1772 } |
1754 | 1773 |
1755 } // namespace trace_event_internal | 1774 } // namespace trace_event_internal |
OLD | NEW |