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> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // not the underlying and ongoing statistic). In contrast, pointer data that | 167 // not the underlying and ongoing statistic). In contrast, pointer data that |
168 // is accessed during snapshotting is completely invariant, and hence is | 168 // is accessed during snapshotting is completely invariant, and hence is |
169 // perfectly acquired (i.e., no potential corruption, and no risk of a bad | 169 // perfectly acquired (i.e., no potential corruption, and no risk of a bad |
170 // memory reference). | 170 // memory reference). |
171 // | 171 // |
172 // TODO(jar): We can implement a Snapshot system that *tries* to grab the | 172 // TODO(jar): We can implement a Snapshot system that *tries* to grab the |
173 // snapshots on the source threads *when* they have MessageLoops available | 173 // snapshots on the source threads *when* they have MessageLoops available |
174 // (worker threads don't have message loops generally, and hence gathering from | 174 // (worker threads don't have message loops generally, and hence gathering from |
175 // them will continue to be asynchronous). We had an implementation of this in | 175 // them will continue to be asynchronous). We had an implementation of this in |
176 // the past, but the difficulty is dealing with message loops being terminated. | 176 // the past, but the difficulty is dealing with message loops being terminated. |
177 // We can *try* to spam the available threads via some message loop proxy to | 177 // We can *try* to spam the available threads via some task runner to |
178 // achieve this feat, and it *might* be valuable when we are collecting data | 178 // achieve this feat, and it *might* be valuable when we are collecting data |
179 // for upload via UMA (where correctness of data may be more significant than | 179 // for upload via UMA (where correctness of data may be more significant than |
180 // for a single screen of about:profiler). | 180 // for a single screen of about:profiler). |
181 // | 181 // |
182 // TODO(jar): We need to store DataCollections, and provide facilities for | 182 // TODO(jar): We need to store DataCollections, and provide facilities for |
183 // taking the difference between two gathered DataCollections. For now, we're | 183 // taking the difference between two gathered DataCollections. For now, we're |
184 // just adding a hack that Reset()s to zero all counts and stats. This is also | 184 // just adding a hack that Reset()s to zero all counts and stats. This is also |
185 // done in a slightly thread-unsafe fashion, as the resetting is done | 185 // done in a slightly thread-unsafe fashion, as the resetting is done |
186 // asynchronously relative to ongoing updates (but all data is 32 bit in size). | 186 // asynchronously relative to ongoing updates (but all data is 32 bit in size). |
187 // For basic profiling, this will work "most of the time," and should be | 187 // For basic profiling, this will work "most of the time," and should be |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 ProcessDataSnapshot(const ProcessDataSnapshot& other); | 811 ProcessDataSnapshot(const ProcessDataSnapshot& other); |
812 ~ProcessDataSnapshot(); | 812 ~ProcessDataSnapshot(); |
813 | 813 |
814 PhasedProcessDataSnapshotMap phased_snapshots; | 814 PhasedProcessDataSnapshotMap phased_snapshots; |
815 base::ProcessId process_id; | 815 base::ProcessId process_id; |
816 }; | 816 }; |
817 | 817 |
818 } // namespace tracked_objects | 818 } // namespace tracked_objects |
819 | 819 |
820 #endif // BASE_TRACKED_OBJECTS_H_ | 820 #endif // BASE_TRACKED_OBJECTS_H_ |
OLD | NEW |