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