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

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

Issue 1276163003: Increase number of bits for trace buffer chunk index (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct number of bits 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_event_impl.h » ('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 22 matching lines...) Expand all
33 } 33 }
34 const TraceEvent* GetEventAt(size_t index) const { 34 const TraceEvent* GetEventAt(size_t index) const {
35 DCHECK(index < size()); 35 DCHECK(index < size());
36 return &chunk_[index]; 36 return &chunk_[index];
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 // These values must be kept consistent with the numbers of bits of
44 // chunk_index and event_index fields in TraceEventHandle
45 // (in trace_event_impl.h).
46 static const size_t kMaxChunkIndex = (1u << 26) - 1;
43 static const size_t kTraceBufferChunkSize = 64; 47 static const size_t kTraceBufferChunkSize = 64;
44 48
45 private: 49 private:
46 size_t next_free_; 50 size_t next_free_;
47 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_; 51 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_;
48 TraceEvent chunk_[kTraceBufferChunkSize]; 52 TraceEvent chunk_[kTraceBufferChunkSize];
49 uint32 seq_; 53 uint32 seq_;
50 }; 54 };
51 55
52 // TraceBuffer holds the events as they are collected. 56 // TraceBuffer holds the events as they are collected.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 121
118 private: 122 private:
119 OutputCallback output_callback_; 123 OutputCallback output_callback_;
120 bool append_comma_; 124 bool append_comma_;
121 }; 125 };
122 126
123 } // namespace trace_event 127 } // namespace trace_event
124 } // namespace base 128 } // namespace base
125 129
126 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_ 130 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/trace_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698