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

Side by Side Diff: base/debug/trace_event_impl.h

Issue 11366109: Adding raw tracing to trace framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
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
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 int64 timestamp,
287 unsigned long long id,
288 int num_args,
289 const char** arg_names,
290 const unsigned char* arg_types,
291 const unsigned long long* arg_values,
292 int threshold_begin_id,
293 long long threshold,
294 unsigned char flags);
283 295
284 // For every matching event, a notification will be fired. NOTE: the 296 // For every matching event, a notification will be fired. NOTE: the
285 // notification will fire for each matching event that has already occurred 297 // notification will fire for each matching event that has already occurred
286 // since tracing was started (including before tracing if the process was 298 // since tracing was started (including before tracing if the process was
287 // started with tracing turned on). 299 // started with tracing turned on).
288 void SetWatchEvent(const std::string& category_name, 300 void SetWatchEvent(const std::string& category_name,
289 const std::string& event_name); 301 const std::string& event_name);
290 // Cancel the watch event. If tracing is enabled, this may race with the 302 // Cancel the watch event. If tracing is enabled, this may race with the
291 // watch event notification firing. 303 // watch event notification firing.
292 void CancelWatchEvent(); 304 void CancelWatchEvent();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 const char* category, 371 const char* category,
360 const char* name, 372 const char* name,
361 int num_args, 373 int num_args,
362 const char** arg_names, 374 const char** arg_names,
363 const unsigned char* arg_types, 375 const unsigned char* arg_types,
364 const unsigned long long* arg_values); 376 const unsigned long long* arg_values);
365 void AddClockSyncMetadataEvents(); 377 void AddClockSyncMetadataEvents();
366 static void ApplyATraceEnabledFlag(unsigned char* category_enabled); 378 static void ApplyATraceEnabledFlag(unsigned char* category_enabled);
367 #endif 379 #endif
368 380
381 int AddTraceEventInternal(NotificationHelper& notifier,
382 TimeTicks timestamp,
383 char phase,
384 const unsigned char* category_enabled,
385 const char* name,
386 unsigned long long id,
387 int num_args,
388 const char** arg_names,
389 const unsigned char* arg_types,
390 const unsigned long long* arg_values,
391 int threshold_begin_id,
392 long long threshold,
393 unsigned char flags);
394
369 // TODO(nduca): switch to per-thread trace buffers to reduce thread 395 // TODO(nduca): switch to per-thread trace buffers to reduce thread
370 // synchronization. 396 // synchronization.
371 // This lock protects TraceLog member accesses from arbitrary threads. 397 // This lock protects TraceLog member accesses from arbitrary threads.
372 Lock lock_; 398 Lock lock_;
373 bool enabled_; 399 bool enabled_;
374 NotificationCallback notification_callback_; 400 NotificationCallback notification_callback_;
375 std::vector<TraceEvent> logged_events_; 401 std::vector<TraceEvent> logged_events_;
376 std::vector<std::string> included_categories_; 402 std::vector<std::string> included_categories_;
377 std::vector<std::string> excluded_categories_; 403 std::vector<std::string> excluded_categories_;
378 bool dispatching_to_observer_list_; 404 bool dispatching_to_observer_list_;
(...skipping 10 matching lines...) Expand all
389 const unsigned char* watch_category_; 415 const unsigned char* watch_category_;
390 std::string watch_event_name_; 416 std::string watch_event_name_;
391 417
392 DISALLOW_COPY_AND_ASSIGN(TraceLog); 418 DISALLOW_COPY_AND_ASSIGN(TraceLog);
393 }; 419 };
394 420
395 } // namespace debug 421 } // namespace debug
396 } // namespace base 422 } // namespace base
397 423
398 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ 424 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698