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 "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 /** | 10 /** |
11 * Profiler support for the V8 JavaScript engine. | 11 * Profiler support for the V8 JavaScript engine. |
12 */ | 12 */ |
13 namespace v8 { | 13 namespace v8 { |
14 | 14 |
15 class HeapGraphNode; | 15 class HeapGraphNode; |
16 struct HeapStatsUpdate; | 16 struct HeapStatsUpdate; |
17 | 17 |
18 typedef uint32_t SnapshotObjectId; | 18 typedef uint32_t SnapshotObjectId; |
19 | 19 |
20 /** | 20 /** |
21 * CpuProfileNode represents a node in a call graph. | 21 * CpuProfileNode represents a node in a call graph. |
22 */ | 22 */ |
23 class V8_EXPORT CpuProfileNode { | 23 class V8_EXPORT CpuProfileNode { |
24 public: | 24 public: |
25 struct LineTick { | |
26 /** The 1-based number of the source line where the function originates. */ | |
27 int line; | |
28 | |
29 /** The count of samples associated with the source line. */ | |
30 unsigned int hit_count; | |
31 }; | |
32 | |
33 /** Returns function name (empty string for anonymous functions.) */ | 25 /** Returns function name (empty string for anonymous functions.) */ |
34 Handle<String> GetFunctionName() const; | 26 Handle<String> GetFunctionName() const; |
35 | 27 |
36 /** Returns id of the script where function is located. */ | 28 /** Returns id of the script where function is located. */ |
37 int GetScriptId() const; | 29 int GetScriptId() const; |
38 | 30 |
39 /** Returns resource name for script from where the function originates. */ | 31 /** Returns resource name for script from where the function originates. */ |
40 Handle<String> GetScriptResourceName() const; | 32 Handle<String> GetScriptResourceName() const; |
41 | 33 |
42 /** | 34 /** |
43 * Returns the number, 1-based, of the line where the function originates. | 35 * Returns the number, 1-based, of the line where the function originates. |
44 * kNoLineNumberInfo if no line number information is available. | 36 * kNoLineNumberInfo if no line number information is available. |
45 */ | 37 */ |
46 int GetLineNumber() const; | 38 int GetLineNumber() const; |
47 | 39 |
48 /** | 40 /** |
49 * Returns 1-based number of the column where the function originates. | 41 * Returns 1-based number of the column where the function originates. |
50 * kNoColumnNumberInfo if no column number information is available. | 42 * kNoColumnNumberInfo if no column number information is available. |
51 */ | 43 */ |
52 int GetColumnNumber() const; | 44 int GetColumnNumber() const; |
53 | 45 |
54 /** | |
55 * Returns the number of the function's source lines that collect the samples. | |
56 */ | |
57 unsigned int GetHitLineCount() const; | |
58 | |
59 /** Returns the set of source lines that collect the samples. | |
60 * The caller allocates buffer and responsible for releasing it. | |
61 * True if all available entries are copied, otherwise false. | |
62 * The function copies nothing if buffer is not large enough. | |
63 */ | |
64 bool GetLineTicks(LineTick* entries, unsigned int length) const; | |
65 | |
66 /** Returns bailout reason for the function | 46 /** Returns bailout reason for the function |
67 * if the optimization was disabled for it. | 47 * if the optimization was disabled for it. |
68 */ | 48 */ |
69 const char* GetBailoutReason() const; | 49 const char* GetBailoutReason() const; |
70 | 50 |
71 /** | 51 /** |
72 * Returns the count of samples where the function was currently executing. | 52 * Returns the count of samples where the function was currently executing. |
73 */ | 53 */ |
74 unsigned GetHitCount() const; | 54 unsigned GetHitCount() const; |
75 | 55 |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 uint32_t index; // Index of the time interval that was changed. | 602 uint32_t index; // Index of the time interval that was changed. |
623 uint32_t count; // New value of count field for the interval with this index. | 603 uint32_t count; // New value of count field for the interval with this index. |
624 uint32_t size; // New value of size field for the interval with this index. | 604 uint32_t size; // New value of size field for the interval with this index. |
625 }; | 605 }; |
626 | 606 |
627 | 607 |
628 } // namespace v8 | 608 } // namespace v8 |
629 | 609 |
630 | 610 |
631 #endif // V8_V8_PROFILER_H_ | 611 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |