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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 long long threshold, | 273 long long threshold, |
274 unsigned char flags); | 274 unsigned char flags); |
275 static void AddTraceEventEtw(char phase, | 275 static void AddTraceEventEtw(char phase, |
276 const char* name, | 276 const char* name, |
277 const void* id, | 277 const void* id, |
278 const char* extra); | 278 const char* extra); |
279 static void AddTraceEventEtw(char phase, | 279 static void AddTraceEventEtw(char phase, |
280 const char* name, | 280 const char* name, |
281 const void* id, | 281 const void* id, |
282 const std::string& extra); | 282 const std::string& extra); |
283 int AddTraceEventExplicit(char phase, | |
284 const unsigned char* category_enabled, | |
285 const char* name, | |
286 int thread_id, | |
287 int64 timestamp, | |
288 unsigned long long id, | |
jar (doing other things)
2012/12/06 17:28:59
nit: Why do we use long long rather than int64 (or
dsinclair
2012/12/06 17:38:52
I used it here to keep consistent with the existin
| |
289 int num_args, | |
290 const char** arg_names, | |
291 const unsigned char* arg_types, | |
292 const unsigned long long* arg_values, | |
293 int threshold_begin_id, | |
294 long long threshold, | |
295 unsigned char flags); | |
283 | 296 |
284 // For every matching event, a notification will be fired. NOTE: the | 297 // For every matching event, a notification will be fired. NOTE: the |
285 // notification will fire for each matching event that has already occurred | 298 // notification will fire for each matching event that has already occurred |
286 // since tracing was started (including before tracing if the process was | 299 // since tracing was started (including before tracing if the process was |
287 // started with tracing turned on). | 300 // started with tracing turned on). |
288 void SetWatchEvent(const std::string& category_name, | 301 void SetWatchEvent(const std::string& category_name, |
289 const std::string& event_name); | 302 const std::string& event_name); |
290 // Cancel the watch event. If tracing is enabled, this may race with the | 303 // Cancel the watch event. If tracing is enabled, this may race with the |
291 // watch event notification firing. | 304 // watch event notification firing. |
292 void CancelWatchEvent(); | 305 void CancelWatchEvent(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 const char* category, | 372 const char* category, |
360 const char* name, | 373 const char* name, |
361 int num_args, | 374 int num_args, |
362 const char** arg_names, | 375 const char** arg_names, |
363 const unsigned char* arg_types, | 376 const unsigned char* arg_types, |
364 const unsigned long long* arg_values); | 377 const unsigned long long* arg_values); |
365 void AddClockSyncMetadataEvents(); | 378 void AddClockSyncMetadataEvents(); |
366 static void ApplyATraceEnabledFlag(unsigned char* category_enabled); | 379 static void ApplyATraceEnabledFlag(unsigned char* category_enabled); |
367 #endif | 380 #endif |
368 | 381 |
382 int AddTraceEventInternal(NotificationHelper& notifier, | |
383 TimeTicks timestamp, | |
384 char phase, | |
385 const unsigned char* category_enabled, | |
386 const char* name, | |
387 int thread_id, | |
388 unsigned long long id, | |
389 int num_args, | |
390 const char** arg_names, | |
391 const unsigned char* arg_types, | |
392 const unsigned long long* arg_values, | |
393 int threshold_begin_id, | |
394 long long threshold, | |
395 unsigned char flags); | |
396 | |
369 // TODO(nduca): switch to per-thread trace buffers to reduce thread | 397 // TODO(nduca): switch to per-thread trace buffers to reduce thread |
370 // synchronization. | 398 // synchronization. |
371 // This lock protects TraceLog member accesses from arbitrary threads. | 399 // This lock protects TraceLog member accesses from arbitrary threads. |
372 Lock lock_; | 400 Lock lock_; |
373 bool enabled_; | 401 bool enabled_; |
374 NotificationCallback notification_callback_; | 402 NotificationCallback notification_callback_; |
375 std::vector<TraceEvent> logged_events_; | 403 std::vector<TraceEvent> logged_events_; |
376 std::vector<std::string> included_categories_; | 404 std::vector<std::string> included_categories_; |
377 std::vector<std::string> excluded_categories_; | 405 std::vector<std::string> excluded_categories_; |
378 bool dispatching_to_observer_list_; | 406 bool dispatching_to_observer_list_; |
(...skipping 10 matching lines...) Expand all Loading... | |
389 const unsigned char* watch_category_; | 417 const unsigned char* watch_category_; |
390 std::string watch_event_name_; | 418 std::string watch_event_name_; |
391 | 419 |
392 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 420 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
393 }; | 421 }; |
394 | 422 |
395 } // namespace debug | 423 } // namespace debug |
396 } // namespace base | 424 } // namespace base |
397 | 425 |
398 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 426 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |