Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(861)

Side by Side Diff: base/trace_event/trace_buffer.h

Issue 1265393007: Reland of [tracing] Fix, simplify and speed up accounting of TraceEvent memory overhead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_TRACE_EVENT_TRACE_BUFFER_H_ 5 #ifndef BASE_TRACE_EVENT_TRACE_BUFFER_H_
6 #define BASE_TRACE_EVENT_TRACE_BUFFER_H_ 6 #define BASE_TRACE_EVENT_TRACE_BUFFER_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_impl.h" 10 #include "base/trace_event/trace_event_impl.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 scoped_ptr<TraceBufferChunk> Clone() const; 39 scoped_ptr<TraceBufferChunk> Clone() const;
40 40
41 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); 41 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead);
42 42
43 static const size_t kTraceBufferChunkSize = 64; 43 static const size_t kTraceBufferChunkSize = 64;
44 44
45 private: 45 private:
46 size_t next_free_; 46 size_t next_free_;
47 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_when_full_; 47 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_;
48 TraceEvent chunk_[kTraceBufferChunkSize]; 48 TraceEvent chunk_[kTraceBufferChunkSize];
49 uint32 seq_; 49 uint32 seq_;
50 }; 50 };
51 51
52 // TraceBuffer holds the events as they are collected. 52 // TraceBuffer holds the events as they are collected.
53 class BASE_EXPORT TraceBuffer { 53 class BASE_EXPORT TraceBuffer {
54 public: 54 public:
55 virtual ~TraceBuffer() {} 55 virtual ~TraceBuffer() {}
56 56
57 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) = 0; 57 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) = 0;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 private: 118 private:
119 OutputCallback output_callback_; 119 OutputCallback output_callback_;
120 bool append_comma_; 120 bool append_comma_;
121 }; 121 };
122 122
123 } // namespace trace_event 123 } // namespace trace_event
124 } // namespace base 124 } // namespace base
125 125
126 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_ 126 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/trace_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698