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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 }; | 90 }; |
91 | 91 |
92 | 92 |
93 /** | 93 /** |
94 * CpuProfile contains a CPU profile in a form of top-down call tree | 94 * CpuProfile contains a CPU profile in a form of top-down call tree |
95 * (from main() down to functions that do all the work). | 95 * (from main() down to functions that do all the work). |
96 */ | 96 */ |
97 class V8_EXPORT CpuProfile { | 97 class V8_EXPORT CpuProfile { |
98 public: | 98 public: |
99 /** Returns CPU profile UID (assigned by the profiler.) */ | 99 /** Returns CPU profile UID (assigned by the profiler.) */ |
100 unsigned GetUid() const; | 100 V8_DEPRECATED("This method will be removed.", unsigned GetUid() const); |
101 | 101 |
102 /** Returns CPU profile title. */ | 102 /** Returns CPU profile title. */ |
103 Handle<String> GetTitle() const; | 103 Handle<String> GetTitle() const; |
104 | 104 |
105 /** Returns the root node of the top down call tree. */ | 105 /** Returns the root node of the top down call tree. */ |
106 const CpuProfileNode* GetTopDownRoot() const; | 106 const CpuProfileNode* GetTopDownRoot() const; |
107 | 107 |
108 /** | 108 /** |
109 * Returns number of samples recorded. The samples are not recorded unless | 109 * Returns number of samples recorded. The samples are not recorded unless |
110 * |record_samples| parameter of CpuProfiler::StartCpuProfiling is true. | 110 * |record_samples| parameter of CpuProfiler::StartCpuProfiling is true. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 * Changes default CPU profiler sampling interval to the specified number | 147 * Changes default CPU profiler sampling interval to the specified number |
148 * of microseconds. Default interval is 1000us. This method must be called | 148 * of microseconds. Default interval is 1000us. This method must be called |
149 * when there are no profiles being recorded. | 149 * when there are no profiles being recorded. |
150 */ | 150 */ |
151 void SetSamplingInterval(int us); | 151 void SetSamplingInterval(int us); |
152 | 152 |
153 /** | 153 /** |
154 * Returns the number of profiles collected (doesn't include | 154 * Returns the number of profiles collected (doesn't include |
155 * profiles that are being collected at the moment of call.) | 155 * profiles that are being collected at the moment of call.) |
156 */ | 156 */ |
157 int GetProfileCount(); | 157 V8_DEPRECATED("This method will be removed.", int GetProfileCount()); |
158 | 158 |
159 /** Returns a profile by index. */ | 159 /** Returns a profile by index. */ |
160 const CpuProfile* GetCpuProfile(int index); | 160 V8_DEPRECATED("This method will be removed.", |
| 161 const CpuProfile* GetCpuProfile(int index)); |
161 | 162 |
162 /** | 163 /** |
163 * Starts collecting CPU profile. Title may be an empty string. It | 164 * Starts collecting CPU profile. Title may be an empty string. It |
164 * is allowed to have several profiles being collected at | 165 * is allowed to have several profiles being collected at |
165 * once. Attempts to start collecting several profiles with the same | 166 * once. Attempts to start collecting several profiles with the same |
166 * title are silently ignored. While collecting a profile, functions | 167 * title are silently ignored. While collecting a profile, functions |
167 * from all security contexts are included in it. The token-based | 168 * from all security contexts are included in it. The token-based |
168 * filtering is only performed when querying for a profile. | 169 * filtering is only performed when querying for a profile. |
169 * | 170 * |
170 * |record_samples| parameter controls whether individual samples should | 171 * |record_samples| parameter controls whether individual samples should |
171 * be recorded in addition to the aggregated tree. | 172 * be recorded in addition to the aggregated tree. |
172 */ | 173 */ |
173 void StartCpuProfiling(Handle<String> title, bool record_samples = false); | 174 void StartCpuProfiling(Handle<String> title, bool record_samples = false); |
174 | 175 |
175 /** | 176 /** |
176 * Stops collecting CPU profile with a given title and returns it. | 177 * Stops collecting CPU profile with a given title and returns it. |
177 * If the title given is empty, finishes the last profile started. | 178 * If the title given is empty, finishes the last profile started. |
178 */ | 179 */ |
179 const CpuProfile* StopCpuProfiling(Handle<String> title); | 180 const CpuProfile* StopCpuProfiling(Handle<String> title); |
180 | 181 |
181 /** | 182 /** |
182 * Deletes all existing profiles, also cancelling all profiling | 183 * Deletes all existing profiles, also cancelling all profiling |
183 * activity. All previously returned pointers to profiles and their | 184 * activity. All previously returned pointers to profiles and their |
184 * contents become invalid after this call. | 185 * contents become invalid after this call. |
185 */ | 186 */ |
186 void DeleteAllCpuProfiles(); | 187 V8_DEPRECATED("This method will be removed.", |
| 188 void DeleteAllCpuProfiles()); |
187 | 189 |
188 /** | 190 /** |
189 * Tells the profiler whether the embedder is idle. | 191 * Tells the profiler whether the embedder is idle. |
190 */ | 192 */ |
191 void SetIdle(bool is_idle); | 193 void SetIdle(bool is_idle); |
192 | 194 |
193 private: | 195 private: |
194 CpuProfiler(); | 196 CpuProfiler(); |
195 ~CpuProfiler(); | 197 ~CpuProfiler(); |
196 CpuProfiler(const CpuProfiler&); | 198 CpuProfiler(const CpuProfiler&); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 uint32_t index; // Index of the time interval that was changed. | 584 uint32_t index; // Index of the time interval that was changed. |
583 uint32_t count; // New value of count field for the interval with this index. | 585 uint32_t count; // New value of count field for the interval with this index. |
584 uint32_t size; // New value of size field for the interval with this index. | 586 uint32_t size; // New value of size field for the interval with this index. |
585 }; | 587 }; |
586 | 588 |
587 | 589 |
588 } // namespace v8 | 590 } // namespace v8 |
589 | 591 |
590 | 592 |
591 #endif // V8_V8_PROFILER_H_ | 593 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |