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 21 matching lines...) Expand all Loading... | |
32 #include "base/trace_event/trace_event.h" | 32 #include "base/trace_event/trace_event.h" |
33 #include "base/trace_event/trace_event_synthetic_delay.h" | 33 #include "base/trace_event/trace_event_synthetic_delay.h" |
34 #include "base/trace_event/trace_log.h" | 34 #include "base/trace_event/trace_log.h" |
35 #include "base/trace_event/trace_sampling_thread.h" | 35 #include "base/trace_event/trace_sampling_thread.h" |
36 | 36 |
37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
38 #include "base/trace_event/trace_event_etw_export_win.h" | 38 #include "base/trace_event/trace_event_etw_export_win.h" |
39 #include "base/trace_event/trace_event_win.h" | 39 #include "base/trace_event/trace_event_win.h" |
40 #endif | 40 #endif |
41 | 41 |
42 class DeleteTraceLogForTesting { | |
43 public: | |
44 static void Delete() { | |
45 Singleton<base::trace_event::TraceLog, | |
46 LeakySingletonTraits<base::trace_event::TraceLog>>::OnExit(0); | |
47 } | |
48 }; | |
49 | |
50 // The thread buckets for the sampling profiler. | 42 // The thread buckets for the sampling profiler. |
51 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3]; | 43 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3]; |
52 | 44 |
53 namespace base { | 45 namespace base { |
46 | |
47 class DeleteTraceLogForTesting { | |
Mark Mentovai
2015/08/31 14:00:51
Should be in the unnamed namespace (base::trace_ev
| |
48 public: | |
49 static void Delete() { | |
50 base::Singleton< | |
51 trace_event::TraceLog, | |
52 LeakySingletonTraits<base::trace_event::TraceLog>>::OnExit(0); | |
53 } | |
54 }; | |
55 | |
54 namespace trace_event { | 56 namespace trace_event { |
55 | 57 |
56 namespace { | 58 namespace { |
57 | 59 |
58 // Controls the number of trace events we will buffer in-memory | 60 // Controls the number of trace events we will buffer in-memory |
59 // before throwing them away. | 61 // before throwing them away. |
60 const size_t kTraceBufferChunkSize = TraceBufferChunk::kTraceBufferChunkSize; | 62 const size_t kTraceBufferChunkSize = TraceBufferChunk::kTraceBufferChunkSize; |
61 | 63 |
62 const size_t kTraceEventVectorBigBufferChunks = | 64 const size_t kTraceEventVectorBigBufferChunks = |
63 512000000 / kTraceBufferChunkSize; | 65 512000000 / kTraceBufferChunkSize; |
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1765 } | 1767 } |
1766 | 1768 |
1767 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1769 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1768 if (*category_group_enabled_) { | 1770 if (*category_group_enabled_) { |
1769 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1771 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1770 event_handle_); | 1772 event_handle_); |
1771 } | 1773 } |
1772 } | 1774 } |
1773 | 1775 |
1774 } // namespace trace_event_internal | 1776 } // namespace trace_event_internal |
OLD | NEW |