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 #ifndef BASE_TRACKED_OBJECTS_H_ | 5 #ifndef BASE_TRACKED_OBJECTS_H_ |
6 #define BASE_TRACKED_OBJECTS_H_ | 6 #define BASE_TRACKED_OBJECTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <stack> | 10 #include <stack> |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 const TrackedTime& start_of_run, | 414 const TrackedTime& start_of_run, |
415 const TrackedTime& end_of_run); | 415 const TrackedTime& end_of_run); |
416 | 416 |
417 // Record the end of execution in region, generally corresponding to a scope | 417 // Record the end of execution in region, generally corresponding to a scope |
418 // being exited. | 418 // being exited. |
419 static void TallyRunInAScopedRegionIfTracking( | 419 static void TallyRunInAScopedRegionIfTracking( |
420 const Births* birth, | 420 const Births* birth, |
421 const TrackedTime& start_of_run, | 421 const TrackedTime& start_of_run, |
422 const TrackedTime& end_of_run); | 422 const TrackedTime& end_of_run); |
423 | 423 |
424 const std::string thread_name() const; | 424 const std::string& thread_name() const { return thread_name_; } |
425 | 425 |
426 // Hack: asynchronously clear all birth counts and death tallies data values | 426 // Hack: asynchronously clear all birth counts and death tallies data values |
427 // in all ThreadData instances. The numerical (zeroing) part is done without | 427 // in all ThreadData instances. The numerical (zeroing) part is done without |
428 // use of a locks or atomics exchanges, and may (for int64 values) produce | 428 // use of a locks or atomics exchanges, and may (for int64 values) produce |
429 // bogus counts VERY rarely. | 429 // bogus counts VERY rarely. |
430 static void ResetAllThreadData(); | 430 static void ResetAllThreadData(); |
431 | 431 |
432 // Initializes all statics if needed (this initialization call should be made | 432 // Initializes all statics if needed (this initialization call should be made |
433 // while we are single threaded). Returns false if unable to initialize. | 433 // while we are single threaded). Returns false if unable to initialize. |
434 static bool Initialize(); | 434 static bool Initialize(); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 ~ProcessDataSnapshot(); | 708 ~ProcessDataSnapshot(); |
709 | 709 |
710 std::vector<TaskSnapshot> tasks; | 710 std::vector<TaskSnapshot> tasks; |
711 std::vector<ParentChildPairSnapshot> descendants; | 711 std::vector<ParentChildPairSnapshot> descendants; |
712 int process_id; | 712 int process_id; |
713 }; | 713 }; |
714 | 714 |
715 } // namespace tracked_objects | 715 } // namespace tracked_objects |
716 | 716 |
717 #endif // BASE_TRACKED_OBJECTS_H_ | 717 #endif // BASE_TRACKED_OBJECTS_H_ |
OLD | NEW |