| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 kTraceEventVectorBufferChunks <= TraceBufferChunk::kMaxChunkIndex, | 79 kTraceEventVectorBufferChunks <= TraceBufferChunk::kMaxChunkIndex, |
| 80 "Too many vector buffer chunks"); | 80 "Too many vector buffer chunks"); |
| 81 const size_t kTraceEventRingBufferChunks = kTraceEventVectorBufferChunks / 4; | 81 const size_t kTraceEventRingBufferChunks = kTraceEventVectorBufferChunks / 4; |
| 82 | 82 |
| 83 // ECHO_TO_CONSOLE needs a small buffer to hold the unfinished COMPLETE events. | 83 // ECHO_TO_CONSOLE needs a small buffer to hold the unfinished COMPLETE events. |
| 84 const size_t kEchoToConsoleTraceEventBufferChunks = 256; | 84 const size_t kEchoToConsoleTraceEventBufferChunks = 256; |
| 85 | 85 |
| 86 const size_t kTraceEventBufferSizeInBytes = 100 * 1024; | 86 const size_t kTraceEventBufferSizeInBytes = 100 * 1024; |
| 87 const int kThreadFlushTimeoutMs = 3000; | 87 const int kThreadFlushTimeoutMs = 3000; |
| 88 | 88 |
| 89 #define MAX_CATEGORY_GROUPS 105 | 89 #define MAX_CATEGORY_GROUPS 200 |
| 90 | 90 |
| 91 // Parallel arrays g_category_groups and g_category_group_enabled are separate | 91 // Parallel arrays g_category_groups and g_category_group_enabled are separate |
| 92 // so that a pointer to a member of g_category_group_enabled can be easily | 92 // so that a pointer to a member of g_category_group_enabled can be easily |
| 93 // converted to an index into g_category_groups. This allows macros to deal | 93 // converted to an index into g_category_groups. This allows macros to deal |
| 94 // only with char enabled pointers from g_category_group_enabled, and we can | 94 // only with char enabled pointers from g_category_group_enabled, and we can |
| 95 // convert internally to determine the category name from the char enabled | 95 // convert internally to determine the category name from the char enabled |
| 96 // pointer. | 96 // pointer. |
| 97 const char* g_category_groups[MAX_CATEGORY_GROUPS] = { | 97 const char* g_category_groups[MAX_CATEGORY_GROUPS] = { |
| 98 "toplevel", | 98 "toplevel", |
| 99 "tracing already shutdown", | 99 "tracing already shutdown", |
| (...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 } | 1786 } |
| 1787 | 1787 |
| 1788 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1788 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
| 1789 if (*category_group_enabled_) { | 1789 if (*category_group_enabled_) { |
| 1790 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1790 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
| 1791 event_handle_); | 1791 event_handle_); |
| 1792 } | 1792 } |
| 1793 } | 1793 } |
| 1794 | 1794 |
| 1795 } // namespace trace_event_internal | 1795 } // namespace trace_event_internal |
| OLD | NEW |