| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 */ | 200 */ |
| 201 int64_t GetEndTime() const; | 201 int64_t GetEndTime() const; |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * Deletes the profile and removes it from CpuProfiler's list. | 204 * Deletes the profile and removes it from CpuProfiler's list. |
| 205 * All pointers to nodes previously returned become invalid. | 205 * All pointers to nodes previously returned become invalid. |
| 206 */ | 206 */ |
| 207 void Delete(); | 207 void Delete(); |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 | |
| 211 /** | 210 /** |
| 212 * Interface for controlling CPU profiling. Instance of the | 211 * Interface for controlling CPU profiling. Instance of the |
| 213 * profiler can be retrieved using v8::Isolate::GetCpuProfiler. | 212 * profiler can be created using v8::CpuProfiler::New method. |
| 214 */ | 213 */ |
| 215 class V8_EXPORT CpuProfiler { | 214 class V8_EXPORT CpuProfiler { |
| 216 public: | 215 public: |
| 217 /** | 216 /** |
| 217 * Creates a new CPU profiler for the |isolate|. The isolate must be |
| 218 * initialized. The profiler object must be disposed after use by calling |
| 219 * |Dispose| method. |
| 220 */ |
| 221 static CpuProfiler* New(Isolate* isolate); |
| 222 |
| 223 /** |
| 224 * Disposes the CPU profiler object. |
| 225 */ |
| 226 void Dispose(); |
| 227 |
| 228 /** |
| 218 * Changes default CPU profiler sampling interval to the specified number | 229 * Changes default CPU profiler sampling interval to the specified number |
| 219 * of microseconds. Default interval is 1000us. This method must be called | 230 * of microseconds. Default interval is 1000us. This method must be called |
| 220 * when there are no profiles being recorded. | 231 * when there are no profiles being recorded. |
| 221 */ | 232 */ |
| 222 void SetSamplingInterval(int us); | 233 void SetSamplingInterval(int us); |
| 223 | 234 |
| 224 /** | 235 /** |
| 225 * Starts collecting CPU profile. Title may be an empty string. It | 236 * Starts collecting CPU profile. Title may be an empty string. It |
| 226 * is allowed to have several profiles being collected at | 237 * is allowed to have several profiles being collected at |
| 227 * once. Attempts to start collecting several profiles with the same | 238 * once. Attempts to start collecting several profiles with the same |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 uint32_t index; // Index of the time interval that was changed. | 823 uint32_t index; // Index of the time interval that was changed. |
| 813 uint32_t count; // New value of count field for the interval with this index. | 824 uint32_t count; // New value of count field for the interval with this index. |
| 814 uint32_t size; // New value of size field for the interval with this index. | 825 uint32_t size; // New value of size field for the interval with this index. |
| 815 }; | 826 }; |
| 816 | 827 |
| 817 | 828 |
| 818 } // namespace v8 | 829 } // namespace v8 |
| 819 | 830 |
| 820 | 831 |
| 821 #endif // V8_V8_PROFILER_H_ | 832 #endif // V8_V8_PROFILER_H_ |
| OLD | NEW |