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 namespace base { | |
42 class DeleteTraceLogForTesting { | 43 class DeleteTraceLogForTesting { |
rvargas (doing something else)
2015/08/21 19:43:05
move to line 57
| |
43 public: | 44 public: |
44 static void Delete() { | 45 static void Delete() { |
45 Singleton<base::trace_event::TraceLog, | 46 base::Singleton< |
rvargas (doing something else)
2015/08/21 19:43:05
no base::
| |
46 LeakySingletonTraits<base::trace_event::TraceLog>>::OnExit(0); | 47 base::trace_event::TraceLog, |
48 base::LeakySingletonTraits<base::trace_event::TraceLog>>::OnExit(0); | |
47 } | 49 } |
48 }; | 50 }; |
51 } // namespace base | |
49 | 52 |
50 // The thread buckets for the sampling profiler. | 53 // The thread buckets for the sampling profiler. |
51 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3]; | 54 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3]; |
52 | 55 |
53 namespace base { | 56 namespace base { |
57 | |
54 namespace trace_event { | 58 namespace trace_event { |
55 | 59 |
56 namespace { | 60 namespace { |
57 | 61 |
58 // Controls the number of trace events we will buffer in-memory | 62 // Controls the number of trace events we will buffer in-memory |
59 // before throwing them away. | 63 // before throwing them away. |
60 const size_t kTraceBufferChunkSize = TraceBufferChunk::kTraceBufferChunkSize; | 64 const size_t kTraceBufferChunkSize = TraceBufferChunk::kTraceBufferChunkSize; |
61 | 65 |
62 const size_t kTraceEventVectorBigBufferChunks = | 66 const size_t kTraceEventVectorBigBufferChunks = |
63 512000000 / kTraceBufferChunkSize; | 67 512000000 / kTraceBufferChunkSize; |
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1765 } | 1769 } |
1766 | 1770 |
1767 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1771 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1768 if (*category_group_enabled_) { | 1772 if (*category_group_enabled_) { |
1769 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1773 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1770 event_handle_); | 1774 event_handle_); |
1771 } | 1775 } |
1772 } | 1776 } |
1773 | 1777 |
1774 } // namespace trace_event_internal | 1778 } // namespace trace_event_internal |
OLD | NEW |