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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <stack> | 12 #include <stack> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/atomicops.h" | 17 #include "base/atomicops.h" |
18 #include "base/base_export.h" | 18 #include "base/base_export.h" |
19 #include "base/containers/hash_tables.h" | 19 #include "base/containers/hash_tables.h" |
20 #include "base/gtest_prod_util.h" | 20 #include "base/gtest_prod_util.h" |
21 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
22 #include "base/location.h" | 22 #include "base/location.h" |
23 #include "base/macros.h" | 23 #include "base/macros.h" |
24 #include "base/process/process_handle.h" | 24 #include "base/process/process_handle.h" |
25 #include "base/profiler/alternate_timer.h" | |
26 #include "base/profiler/tracked_time.h" | 25 #include "base/profiler/tracked_time.h" |
27 #include "base/synchronization/lock.h" | 26 #include "base/synchronization/lock.h" |
28 #include "base/threading/thread_checker.h" | 27 #include "base/threading/thread_checker.h" |
29 #include "base/threading/thread_local_storage.h" | 28 #include "base/threading/thread_local_storage.h" |
30 | 29 |
31 namespace base { | 30 namespace base { |
32 struct TrackingInfo; | 31 struct TrackingInfo; |
33 } | 32 } |
34 | 33 |
35 // TrackedObjects provides a database of stats about objects (generally Tasks) | 34 // TrackedObjects provides a database of stats about objects (generally Tasks) |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 // Current allowable states of the tracking system. The states can vary | 438 // Current allowable states of the tracking system. The states can vary |
440 // between ACTIVE and DEACTIVATED, but can never go back to UNINITIALIZED. | 439 // between ACTIVE and DEACTIVATED, but can never go back to UNINITIALIZED. |
441 enum Status { | 440 enum Status { |
442 UNINITIALIZED, // Pristine, link-time state before running. | 441 UNINITIALIZED, // Pristine, link-time state before running. |
443 DORMANT_DURING_TESTS, // Only used during testing. | 442 DORMANT_DURING_TESTS, // Only used during testing. |
444 DEACTIVATED, // No longer recording profiling. | 443 DEACTIVATED, // No longer recording profiling. |
445 PROFILING_ACTIVE, // Recording profiles. | 444 PROFILING_ACTIVE, // Recording profiles. |
446 STATUS_LAST = PROFILING_ACTIVE | 445 STATUS_LAST = PROFILING_ACTIVE |
447 }; | 446 }; |
448 | 447 |
448 typedef unsigned int NowFunction(); // Type for an alternate timer function. | |
Ilya Sherman
2016/01/28 01:36:47
Why is this needed?
Primiano Tucci (use gerrit)
2016/01/28 10:46:36
This was previously in alternate_timer.h, which I
Ilya Sherman
2016/01/29 01:23:14
Is it just used for testing? If so, let's not exp
Primiano Tucci (use gerrit)
2016/02/01 13:34:19
Good point. Just testing. Done.
| |
449 typedef base::hash_map<Location, Births*, Location::Hash> BirthMap; | 449 typedef base::hash_map<Location, Births*, Location::Hash> BirthMap; |
450 typedef std::map<const Births*, DeathData> DeathMap; | 450 typedef std::map<const Births*, DeathData> DeathMap; |
451 | 451 |
452 // Initialize the current thread context with a new instance of ThreadData. | 452 // Initialize the current thread context with a new instance of ThreadData. |
453 // This is used by all threads that have names, and should be explicitly | 453 // This is used by all threads that have names, and should be explicitly |
454 // set *before* any births on the threads have taken place. It is generally | 454 // set *before* any births on the threads have taken place. It is generally |
455 // only used by the message loop, which has a well defined thread name. | 455 // only used by the message loop, which has a well defined thread name. |
456 static void InitializeThreadContext(const std::string& suggested_name); | 456 static void InitializeThreadContext(const std::string& suggested_name); |
457 | 457 |
458 // Using Thread Local Store, find the current instance for collecting data. | 458 // Using Thread Local Store, find the current instance for collecting data. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 ProcessDataSnapshot(); | 818 ProcessDataSnapshot(); |
819 ~ProcessDataSnapshot(); | 819 ~ProcessDataSnapshot(); |
820 | 820 |
821 PhasedProcessDataSnapshotMap phased_snapshots; | 821 PhasedProcessDataSnapshotMap phased_snapshots; |
822 base::ProcessId process_id; | 822 base::ProcessId process_id; |
823 }; | 823 }; |
824 | 824 |
825 } // namespace tracked_objects | 825 } // namespace tracked_objects |
826 | 826 |
827 #endif // BASE_TRACKED_OBJECTS_H_ | 827 #endif // BASE_TRACKED_OBJECTS_H_ |
OLD | NEW |