OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 typedef uint32_t SnapshotObjectId; | 68 typedef uint32_t SnapshotObjectId; |
69 | 69 |
70 /** | 70 /** |
71 * CpuProfileNode represents a node in a call graph. | 71 * CpuProfileNode represents a node in a call graph. |
72 */ | 72 */ |
73 class V8EXPORT CpuProfileNode { | 73 class V8EXPORT CpuProfileNode { |
74 public: | 74 public: |
75 /** Returns function name (empty string for anonymous functions.) */ | 75 /** Returns function name (empty string for anonymous functions.) */ |
76 Handle<String> GetFunctionName() const; | 76 Handle<String> GetFunctionName() const; |
77 | 77 |
| 78 /** Returns id of the script where function is located. */ |
| 79 int GetScriptId() const; |
| 80 |
78 /** Returns resource name for script from where the function originates. */ | 81 /** Returns resource name for script from where the function originates. */ |
79 Handle<String> GetScriptResourceName() const; | 82 Handle<String> GetScriptResourceName() const; |
80 | 83 |
81 /** | 84 /** |
82 * Returns the number, 1-based, of the line where the function originates. | 85 * Returns the number, 1-based, of the line where the function originates. |
83 * kNoLineNumberInfo if no line number information is available. | 86 * kNoLineNumberInfo if no line number information is available. |
84 */ | 87 */ |
85 int GetLineNumber() const; | 88 int GetLineNumber() const; |
86 | 89 |
87 /** | 90 /** |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 * other contexts, filtering by security token is performed while | 174 * other contexts, filtering by security token is performed while |
172 * obtaining profiling results. | 175 * obtaining profiling results. |
173 */ | 176 */ |
174 | 177 |
175 /** | 178 /** |
176 * Returns the number of profiles collected (doesn't include | 179 * Returns the number of profiles collected (doesn't include |
177 * profiles that are being collected at the moment of call.) | 180 * profiles that are being collected at the moment of call.) |
178 */ | 181 */ |
179 int GetProfileCount(); | 182 int GetProfileCount(); |
180 | 183 |
181 /** Deprecated. Use GetCpuProfile with single parameter. */ | |
182 V8_DEPRECATED(const CpuProfile* GetCpuProfile( | |
183 int index, | |
184 Handle<Value> security_token)); | |
185 /** Returns a profile by index. */ | 184 /** Returns a profile by index. */ |
186 const CpuProfile* GetCpuProfile(int index); | 185 const CpuProfile* GetCpuProfile(int index); |
187 | 186 |
188 /** Returns a profile by uid. */ | |
189 V8_DEPRECATED(const CpuProfile* FindCpuProfile( | |
190 unsigned uid, | |
191 Handle<Value> security_token = Handle<Value>())); | |
192 | |
193 /** | 187 /** |
194 * Starts collecting CPU profile. Title may be an empty string. It | 188 * Starts collecting CPU profile. Title may be an empty string. It |
195 * is allowed to have several profiles being collected at | 189 * is allowed to have several profiles being collected at |
196 * once. Attempts to start collecting several profiles with the same | 190 * once. Attempts to start collecting several profiles with the same |
197 * title are silently ignored. While collecting a profile, functions | 191 * title are silently ignored. While collecting a profile, functions |
198 * from all security contexts are included in it. The token-based | 192 * from all security contexts are included in it. The token-based |
199 * filtering is only performed when querying for a profile. | 193 * filtering is only performed when querying for a profile. |
200 * | 194 * |
201 * |record_samples| parameter controls whether individual samples should | 195 * |record_samples| parameter controls whether individual samples should |
202 * be recorded in addition to the aggregated tree. | 196 * be recorded in addition to the aggregated tree. |
203 */ | 197 */ |
204 void StartCpuProfiling(Handle<String> title, bool record_samples = false); | 198 void StartCpuProfiling(Handle<String> title, bool record_samples = false); |
205 | 199 |
206 /** | 200 /** |
207 * Deprecated. Use StopCpuProfiling with one parameter instead. | |
208 */ | |
209 V8_DEPRECATED(const CpuProfile* StopCpuProfiling( | |
210 Handle<String> title, | |
211 Handle<Value> security_token)); | |
212 /** | |
213 * Stops collecting CPU profile with a given title and returns it. | 201 * Stops collecting CPU profile with a given title and returns it. |
214 * If the title given is empty, finishes the last profile started. | 202 * If the title given is empty, finishes the last profile started. |
215 */ | 203 */ |
216 const CpuProfile* StopCpuProfiling(Handle<String> title); | 204 const CpuProfile* StopCpuProfiling(Handle<String> title); |
217 | 205 |
218 /** | 206 /** |
219 * Deletes all existing profiles, also cancelling all profiling | 207 * Deletes all existing profiles, also cancelling all profiling |
220 * activity. All previously returned pointers to profiles and their | 208 * activity. All previously returned pointers to profiles and their |
221 * contents become invalid after this call. | 209 * contents become invalid after this call. |
222 */ | 210 */ |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 */ | 393 */ |
406 typedef RetainedObjectInfo* (*WrapperInfoCallback) | 394 typedef RetainedObjectInfo* (*WrapperInfoCallback) |
407 (uint16_t class_id, Handle<Value> wrapper); | 395 (uint16_t class_id, Handle<Value> wrapper); |
408 | 396 |
409 /** Returns the number of snapshots taken. */ | 397 /** Returns the number of snapshots taken. */ |
410 int GetSnapshotCount(); | 398 int GetSnapshotCount(); |
411 | 399 |
412 /** Returns a snapshot by index. */ | 400 /** Returns a snapshot by index. */ |
413 const HeapSnapshot* GetHeapSnapshot(int index); | 401 const HeapSnapshot* GetHeapSnapshot(int index); |
414 | 402 |
415 /** Returns a profile by uid. */ | |
416 V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid)); | |
417 | |
418 /** | 403 /** |
419 * Returns SnapshotObjectId for a heap object referenced by |value| if | 404 * Returns SnapshotObjectId for a heap object referenced by |value| if |
420 * it has been seen by the heap profiler, kUnknownObjectId otherwise. | 405 * it has been seen by the heap profiler, kUnknownObjectId otherwise. |
421 */ | 406 */ |
422 SnapshotObjectId GetObjectId(Handle<Value> value); | 407 SnapshotObjectId GetObjectId(Handle<Value> value); |
423 | 408 |
424 /** | 409 /** |
425 * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return | 410 * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return |
426 * it in case heap profiler cannot find id for the object passed as | 411 * it in case heap profiler cannot find id for the object passed as |
427 * parameter. HeapSnapshot::GetNodeById will always return NULL for such id. | 412 * parameter. HeapSnapshot::GetNodeById will always return NULL for such id. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 }; | 584 }; |
600 | 585 |
601 | 586 |
602 } // namespace v8 | 587 } // namespace v8 |
603 | 588 |
604 | 589 |
605 #undef V8EXPORT | 590 #undef V8EXPORT |
606 | 591 |
607 | 592 |
608 #endif // V8_V8_PROFILER_H_ | 593 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |