Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: include/v8-profiler.h

Issue 616963005: Extend CPU profiler with mapping ticks to source lines (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed x64.debug linker error Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
25 /** Returns function name (empty string for anonymous functions.) */ 33 /** Returns function name (empty string for anonymous functions.) */
26 Handle<String> GetFunctionName() const; 34 Handle<String> GetFunctionName() const;
27 35
28 /** Returns id of the script where function is located. */ 36 /** Returns id of the script where function is located. */
29 int GetScriptId() const; 37 int GetScriptId() const;
30 38
31 /** Returns resource name for script from where the function originates. */ 39 /** Returns resource name for script from where the function originates. */
32 Handle<String> GetScriptResourceName() const; 40 Handle<String> GetScriptResourceName() const;
33 41
34 /** 42 /**
35 * Returns the number, 1-based, of the line where the function originates. 43 * Returns the number, 1-based, of the line where the function originates.
36 * kNoLineNumberInfo if no line number information is available. 44 * kNoLineNumberInfo if no line number information is available.
37 */ 45 */
38 int GetLineNumber() const; 46 int GetLineNumber() const;
39 47
40 /** 48 /**
41 * Returns 1-based number of the column where the function originates. 49 * Returns 1-based number of the column where the function originates.
42 * kNoColumnNumberInfo if no column number information is available. 50 * kNoColumnNumberInfo if no column number information is available.
43 */ 51 */
44 int GetColumnNumber() const; 52 int GetColumnNumber() const;
45 53
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
46 /** Returns bailout reason for the function 66 /** Returns bailout reason for the function
47 * if the optimization was disabled for it. 67 * if the optimization was disabled for it.
48 */ 68 */
49 const char* GetBailoutReason() const; 69 const char* GetBailoutReason() const;
50 70
51 /** 71 /**
52 * Returns the count of samples where the function was currently executing. 72 * Returns the count of samples where the function was currently executing.
53 */ 73 */
54 unsigned GetHitCount() const; 74 unsigned GetHitCount() const;
55 75
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 uint32_t index; // Index of the time interval that was changed. 622 uint32_t index; // Index of the time interval that was changed.
603 uint32_t count; // New value of count field for the interval with this index. 623 uint32_t count; // New value of count field for the interval with this index.
604 uint32_t size; // New value of size field for the interval with this index. 624 uint32_t size; // New value of size field for the interval with this index.
605 }; 625 };
606 626
607 627
608 } // namespace v8 628 } // namespace v8
609 629
610 630
611 #endif // V8_V8_PROFILER_H_ 631 #endif // V8_V8_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698