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_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 static const unsigned char* GetCategoryEnabled(const char* name); | 253 static const unsigned char* GetCategoryEnabled(const char* name); |
254 static const char* GetCategoryName(const unsigned char* category_enabled); | 254 static const char* GetCategoryName(const unsigned char* category_enabled); |
255 | 255 |
256 // Called by TRACE_EVENT* macros, don't call this directly. | 256 // Called by TRACE_EVENT* macros, don't call this directly. |
257 // If |copy| is set, |name|, |arg_name1| and |arg_name2| will be deep copied | 257 // If |copy| is set, |name|, |arg_name1| and |arg_name2| will be deep copied |
258 // into the event; see "Memory scoping note" and TRACE_EVENT_COPY_XXX above. | 258 // into the event; see "Memory scoping note" and TRACE_EVENT_COPY_XXX above. |
259 void AddTraceEvent(char phase, | 259 void AddTraceEvent(char phase, |
260 const unsigned char* category_enabled, | 260 const unsigned char* category_enabled, |
261 const char* name, | 261 const char* name, |
262 unsigned long long id, | 262 unsigned long long id, |
| 263 int thread_id, |
| 264 int64 timestamp, |
263 int num_args, | 265 int num_args, |
264 const char** arg_names, | 266 const char** arg_names, |
265 const unsigned char* arg_types, | 267 const unsigned char* arg_types, |
266 const unsigned long long* arg_values, | 268 const unsigned long long* arg_values, |
267 unsigned char flags); | 269 unsigned char flags); |
268 static void AddTraceEventEtw(char phase, | 270 static void AddTraceEventEtw(char phase, |
269 const char* name, | 271 const char* name, |
270 const void* id, | 272 const void* id, |
271 const char* extra); | 273 const char* extra); |
272 static void AddTraceEventEtw(char phase, | 274 static void AddTraceEventEtw(char phase, |
(...skipping 26 matching lines...) Expand all Loading... |
299 const TraceEvent& GetEventAt(size_t index) const { | 301 const TraceEvent& GetEventAt(size_t index) const { |
300 DCHECK(index < logged_events_.size()); | 302 DCHECK(index < logged_events_.size()); |
301 return logged_events_[index]; | 303 return logged_events_[index]; |
302 } | 304 } |
303 | 305 |
304 void SetProcessID(int process_id); | 306 void SetProcessID(int process_id); |
305 | 307 |
306 // Allow setting an offset between the current TimeTicks time and the time | 308 // Allow setting an offset between the current TimeTicks time and the time |
307 // that should be reported. | 309 // that should be reported. |
308 void SetTimeOffset(TimeDelta offset); | 310 void SetTimeOffset(TimeDelta offset); |
| 311 TimeDelta GetTimeOffset(); |
309 | 312 |
310 private: | 313 private: |
311 // This allows constructor and destructor to be private and usable only | 314 // This allows constructor and destructor to be private and usable only |
312 // by the Singleton class. | 315 // by the Singleton class. |
313 friend struct StaticMemorySingletonTraits<TraceLog>; | 316 friend struct StaticMemorySingletonTraits<TraceLog>; |
314 | 317 |
315 // The pointer returned from GetCategoryEnabledInternal() points to a value | 318 // The pointer returned from GetCategoryEnabledInternal() points to a value |
316 // with zero or more of the following bits. Used in this class only. | 319 // with zero or more of the following bits. Used in this class only. |
317 // The TRACE_EVENT macros should only use the value as a bool. | 320 // The TRACE_EVENT macros should only use the value as a bool. |
318 enum CategoryEnabledFlags { | 321 enum CategoryEnabledFlags { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 const unsigned char* watch_category_; | 391 const unsigned char* watch_category_; |
389 std::string watch_event_name_; | 392 std::string watch_event_name_; |
390 | 393 |
391 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 394 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
392 }; | 395 }; |
393 | 396 |
394 } // namespace debug | 397 } // namespace debug |
395 } // namespace base | 398 } // namespace base |
396 | 399 |
397 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 400 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |