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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // on. This is currently a compiled option, atop TrackingStatus(). | 459 // on. This is currently a compiled option, atop TrackingStatus(). |
460 static bool TrackingParentChildStatus(); | 460 static bool TrackingParentChildStatus(); |
461 | 461 |
462 // Marks a start of a tracked run. It's super fast when tracking is disabled, | 462 // Marks a start of a tracked run. It's super fast when tracking is disabled, |
463 // and has some internal side effects when we are tracking, so that we can | 463 // and has some internal side effects when we are tracking, so that we can |
464 // deduce the amount of time accumulated outside of execution of tracked runs. | 464 // deduce the amount of time accumulated outside of execution of tracked runs. |
465 // The task that will be tracked is passed in as |parent| so that parent-child | 465 // The task that will be tracked is passed in as |parent| so that parent-child |
466 // relationships can be (optionally) calculated. | 466 // relationships can be (optionally) calculated. |
467 static void PrepareForStartOfRun(const Births* parent); | 467 static void PrepareForStartOfRun(const Births* parent); |
468 | 468 |
| 469 // Enables profiler timing. |
| 470 static void EnableProfilerTiming(); |
| 471 |
469 // Provide a time function that does nothing (runs fast) when we don't have | 472 // Provide a time function that does nothing (runs fast) when we don't have |
470 // the profiler enabled. It will generally be optimized away when it is | 473 // the profiler enabled. It will generally be optimized away when it is |
471 // ifdef'ed to be small enough (allowing the profiler to be "compiled out" of | 474 // ifdef'ed to be small enough (allowing the profiler to be "compiled out" of |
472 // the code). | 475 // the code). |
473 static TrackedTime Now(); | 476 static TrackedTime Now(); |
474 | 477 |
475 // Use the function |now| to provide current times, instead of calling the | 478 // Use the function |now| to provide current times, instead of calling the |
476 // TrackedTime::Now() function. Since this alternate function is being used, | 479 // TrackedTime::Now() function. Since this alternate function is being used, |
477 // the other time arguments (used for calculating queueing delay) will be | 480 // the other time arguments (used for calculating queueing delay) will be |
478 // ignored. | 481 // ignored. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 ~ProcessDataSnapshot(); | 784 ~ProcessDataSnapshot(); |
782 | 785 |
783 std::vector<TaskSnapshot> tasks; | 786 std::vector<TaskSnapshot> tasks; |
784 std::vector<ParentChildPairSnapshot> descendants; | 787 std::vector<ParentChildPairSnapshot> descendants; |
785 int process_id; | 788 int process_id; |
786 }; | 789 }; |
787 | 790 |
788 } // namespace tracked_objects | 791 } // namespace tracked_objects |
789 | 792 |
790 #endif // BASE_TRACKED_OBJECTS_H_ | 793 #endif // BASE_TRACKED_OBJECTS_H_ |
OLD | NEW |