| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 ~DeathData(); | 331 ~DeathData(); |
| 332 | 332 |
| 333 // Update stats for a task destruction (death) that had a Run() time of | 333 // Update stats for a task destruction (death) that had a Run() time of |
| 334 // |duration|, and has had a queueing delay of |queue_duration|. | 334 // |duration|, and has had a queueing delay of |queue_duration|. |
| 335 void RecordDeath(const int32 queue_duration, | 335 void RecordDeath(const int32 queue_duration, |
| 336 const int32 run_duration, | 336 const int32 run_duration, |
| 337 const uint32 random_number); | 337 const uint32 random_number); |
| 338 | 338 |
| 339 // Metrics and past snapshots accessors, used only for serialization and in | 339 // Metrics and past snapshots accessors, used only for serialization and in |
| 340 // tests. | 340 // tests. |
| 341 int count() const { return count_; } | 341 int count() const; |
| 342 int32 run_duration_sum() const { return run_duration_sum_; } | 342 int32 run_duration_sum() const; |
| 343 int32 run_duration_max() const { return run_duration_max_; } | 343 int32 run_duration_max() const; |
| 344 int32 run_duration_sample() const { return run_duration_sample_; } | 344 int32 run_duration_sample() const; |
| 345 int32 queue_duration_sum() const { return queue_duration_sum_; } | 345 int32 queue_duration_sum() const; |
| 346 int32 queue_duration_max() const { return queue_duration_max_; } | 346 int32 queue_duration_max() const; |
| 347 int32 queue_duration_sample() const { return queue_duration_sample_; } | 347 int32 queue_duration_sample() const; |
| 348 const DeathDataPhaseSnapshot* last_phase_snapshot() const { | 348 const DeathDataPhaseSnapshot* last_phase_snapshot() const; |
| 349 return last_phase_snapshot_; | |
| 350 } | |
| 351 | 349 |
| 352 // Called when the current profiling phase, identified by |profiling_phase|, | 350 // Called when the current profiling phase, identified by |profiling_phase|, |
| 353 // ends. | 351 // ends. |
| 354 // Must be called only on the snapshot thread. | 352 // Must be called only on the snapshot thread. |
| 355 void OnProfilingPhaseCompleted(int profiling_phase); | 353 void OnProfilingPhaseCompleted(int profiling_phase); |
| 356 | 354 |
| 357 private: | 355 private: |
| 358 // Members are ordered from most regularly read and updated, to least | 356 // Members are ordered from most regularly read and updated, to least |
| 359 // frequently used. This might help a bit with cache lines. | 357 // frequently used. This might help a bit with cache lines. |
| 360 // Number of runs seen (divisor for calculating averages). | 358 // Number of runs seen (divisor for calculating averages). |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 ProcessDataSnapshot(); | 864 ProcessDataSnapshot(); |
| 867 ~ProcessDataSnapshot(); | 865 ~ProcessDataSnapshot(); |
| 868 | 866 |
| 869 PhasedProcessDataSnapshotMap phased_snapshots; | 867 PhasedProcessDataSnapshotMap phased_snapshots; |
| 870 base::ProcessId process_id; | 868 base::ProcessId process_id; |
| 871 }; | 869 }; |
| 872 | 870 |
| 873 } // namespace tracked_objects | 871 } // namespace tracked_objects |
| 874 | 872 |
| 875 #endif // BASE_TRACKED_OBJECTS_H_ | 873 #endif // BASE_TRACKED_OBJECTS_H_ |
| OLD | NEW |