 Chromium Code Reviews
 Chromium Code Reviews Issue 424973004:
  Extend CPU profiler with mapping ticks to source lines   (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 424973004:
  Extend CPU profiler with mapping ticks to source lines   (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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 typedef struct { | |
| 
yurys
2014/07/29 13:15:10
struct LineTick, also it can be nested in CpuProfi
 | |
| 21 /** The 1-based number of the source line where the function originates. */ | |
| 22 unsigned int line; | |
| 
yurys
2014/07/29 13:15:10
Why only line number, column would also be interes
 | |
| 23 | |
| 24 /** The count of samples associated with the source line. */ | |
| 25 unsigned int ticks; | |
| 
alph
2014/07/29 12:55:55
hitCount?
 | |
| 26 } LineTick; | |
| 27 | |
| 20 /** | 28 /** | 
| 21 * CpuProfileNode represents a node in a call graph. | 29 * CpuProfileNode represents a node in a call graph. | 
| 22 */ | 30 */ | 
| 23 class V8_EXPORT CpuProfileNode { | 31 class V8_EXPORT CpuProfileNode { | 
| 24 public: | 32 public: | 
| 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. | |
| 
alph
2014/07/29 12:55:55
According to the implementation it copies nothing
 | |
| 62 */ | |
| 63 bool GetLineTicks(LineTick* entries, unsigned int number) const; | |
| 64 | |
| 46 /** Returns bailout reason for the function | 65 /** Returns bailout reason for the function | 
| 47 * if the optimization was disabled for it. | 66 * if the optimization was disabled for it. | 
| 48 */ | 67 */ | 
| 49 const char* GetBailoutReason() const; | 68 const char* GetBailoutReason() const; | 
| 50 | 69 | 
| 51 /** | 70 /** | 
| 52 * Returns the count of samples where the function was currently executing. | 71 * Returns the count of samples where the function was currently executing. | 
| 53 */ | 72 */ | 
| 54 unsigned GetHitCount() const; | 73 unsigned GetHitCount() const; | 
| 55 | 74 | 
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 uint32_t index; // Index of the time interval that was changed. | 621 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. | 622 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. | 623 uint32_t size; // New value of size field for the interval with this index. | 
| 605 }; | 624 }; | 
| 606 | 625 | 
| 607 | 626 | 
| 608 } // namespace v8 | 627 } // namespace v8 | 
| 609 | 628 | 
| 610 | 629 | 
| 611 #endif // V8_V8_PROFILER_H_ | 630 #endif // V8_V8_PROFILER_H_ | 
| OLD | NEW |