| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 5 |
| 6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ |
| 7 #define BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ | 7 #define BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ |
| 8 | 8 |
| 9 #include <stack> | 9 #include <stack> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 // Note: these are ordered by size (largest first) for optimal packing. | 172 // Note: these are ordered by size (largest first) for optimal packing. |
| 173 TraceTicks timestamp_; | 173 TraceTicks timestamp_; |
| 174 ThreadTicks thread_timestamp_; | 174 ThreadTicks thread_timestamp_; |
| 175 TimeDelta duration_; | 175 TimeDelta duration_; |
| 176 TimeDelta thread_duration_; | 176 TimeDelta thread_duration_; |
| 177 // id_ can be used to store phase-specific data. | 177 // id_ can be used to store phase-specific data. |
| 178 unsigned long long id_; | 178 unsigned long long id_; |
| 179 scoped_ptr<TraceEventMemoryOverhead> cached_memory_overhead_estimate_; | |
| 180 // context_id_ is used to store context information. | 179 // context_id_ is used to store context information. |
| 181 unsigned long long context_id_; | 180 unsigned long long context_id_; |
| 182 TraceValue arg_values_[kTraceMaxNumArgs]; | 181 TraceValue arg_values_[kTraceMaxNumArgs]; |
| 183 const char* arg_names_[kTraceMaxNumArgs]; | 182 const char* arg_names_[kTraceMaxNumArgs]; |
| 184 scoped_refptr<ConvertableToTraceFormat> convertable_values_[kTraceMaxNumArgs]; | 183 scoped_refptr<ConvertableToTraceFormat> convertable_values_[kTraceMaxNumArgs]; |
| 185 const unsigned char* category_group_enabled_; | 184 const unsigned char* category_group_enabled_; |
| 186 const char* name_; | 185 const char* name_; |
| 187 scoped_refptr<base::RefCountedString> parameter_copy_storage_; | 186 scoped_refptr<base::RefCountedString> parameter_copy_storage_; |
| 188 int thread_id_; | 187 int thread_id_; |
| 189 char phase_; | 188 char phase_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 217 } | 216 } |
| 218 | 217 |
| 219 scoped_ptr<TraceBufferChunk> Clone() const; | 218 scoped_ptr<TraceBufferChunk> Clone() const; |
| 220 | 219 |
| 221 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); | 220 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); |
| 222 | 221 |
| 223 static const size_t kTraceBufferChunkSize = 64; | 222 static const size_t kTraceBufferChunkSize = 64; |
| 224 | 223 |
| 225 private: | 224 private: |
| 226 size_t next_free_; | 225 size_t next_free_; |
| 227 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_when_full_; | 226 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_; |
| 228 TraceEvent chunk_[kTraceBufferChunkSize]; | 227 TraceEvent chunk_[kTraceBufferChunkSize]; |
| 229 uint32 seq_; | 228 uint32 seq_; |
| 230 }; | 229 }; |
| 231 | 230 |
| 232 // TraceBuffer holds the events as they are collected. | 231 // TraceBuffer holds the events as they are collected. |
| 233 class BASE_EXPORT TraceBuffer { | 232 class BASE_EXPORT TraceBuffer { |
| 234 public: | 233 public: |
| 235 virtual ~TraceBuffer() {} | 234 virtual ~TraceBuffer() {} |
| 236 | 235 |
| 237 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t *index) = 0; | 236 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t *index) = 0; |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 subtle::AtomicWord generation_; | 724 subtle::AtomicWord generation_; |
| 726 bool use_worker_thread_; | 725 bool use_worker_thread_; |
| 727 | 726 |
| 728 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 727 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| 729 }; | 728 }; |
| 730 | 729 |
| 731 } // namespace trace_event | 730 } // namespace trace_event |
| 732 } // namespace base | 731 } // namespace base |
| 733 | 732 |
| 734 #endif // BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ | 733 #endif // BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ |
| OLD | NEW |