OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project 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 V8_V8_PROFILER_H_ | 5 #ifndef V8_V8_PROFILER_H_ |
6 #define V8_V8_PROFILER_H_ | 6 #define V8_V8_PROFILER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "v8.h" // NOLINT(build/include) | 9 #include "v8.h" // NOLINT(build/include) |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 }; | 39 }; |
40 | 40 |
41 } // namespace v8 | 41 } // namespace v8 |
42 | 42 |
43 #ifdef V8_OS_WIN | 43 #ifdef V8_OS_WIN |
44 template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>; | 44 template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>; |
45 #endif | 45 #endif |
46 | 46 |
47 namespace v8 { | 47 namespace v8 { |
48 | 48 |
| 49 /** |
| 50 * TracingCpuProfiler monitors tracing being enabled/disabled |
| 51 * and emits CpuProfile trace events once v8.cpu_profile2 tracing category |
| 52 * is enabled. It has no overhead unless the category is enabled. |
| 53 */ |
| 54 class V8_EXPORT TracingCpuProfiler { |
| 55 public: |
| 56 static std::unique_ptr<TracingCpuProfiler> Create(Isolate*); |
| 57 virtual ~TracingCpuProfiler() = default; |
| 58 |
| 59 protected: |
| 60 TracingCpuProfiler() = default; |
| 61 }; |
| 62 |
49 // TickSample captures the information collected for each sample. | 63 // TickSample captures the information collected for each sample. |
50 struct TickSample { | 64 struct TickSample { |
51 // Internal profiling (with --prof + tools/$OS-tick-processor) wants to | 65 // Internal profiling (with --prof + tools/$OS-tick-processor) wants to |
52 // include the runtime function we're calling. Externally exposed tick | 66 // include the runtime function we're calling. Externally exposed tick |
53 // samples don't care. | 67 // samples don't care. |
54 enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }; | 68 enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }; |
55 | 69 |
56 TickSample() | 70 TickSample() |
57 : state(OTHER), | 71 : state(OTHER), |
58 pc(nullptr), | 72 pc(nullptr), |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 uint32_t index; // Index of the time interval that was changed. | 888 uint32_t index; // Index of the time interval that was changed. |
875 uint32_t count; // New value of count field for the interval with this index. | 889 uint32_t count; // New value of count field for the interval with this index. |
876 uint32_t size; // New value of size field for the interval with this index. | 890 uint32_t size; // New value of size field for the interval with this index. |
877 }; | 891 }; |
878 | 892 |
879 | 893 |
880 } // namespace v8 | 894 } // namespace v8 |
881 | 895 |
882 | 896 |
883 #endif // V8_V8_PROFILER_H_ | 897 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |