OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 26 matching lines...) Expand all Loading... |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 // Forward declarations. | 40 // Forward declarations. |
41 class CodeEntry; | 41 class CodeEntry; |
42 class CodeMap; | 42 class CodeMap; |
43 class CompilationInfo; | 43 class CompilationInfo; |
44 class CpuProfile; | 44 class CpuProfile; |
45 class CpuProfilesCollection; | 45 class CpuProfilesCollection; |
46 class ProfileGenerator; | 46 class ProfileGenerator; |
47 class TokenEnumerator; | |
48 | 47 |
49 #define CODE_EVENTS_TYPE_LIST(V) \ | 48 #define CODE_EVENTS_TYPE_LIST(V) \ |
50 V(CODE_CREATION, CodeCreateEventRecord) \ | 49 V(CODE_CREATION, CodeCreateEventRecord) \ |
51 V(CODE_MOVE, CodeMoveEventRecord) \ | 50 V(CODE_MOVE, CodeMoveEventRecord) \ |
52 V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord) \ | 51 V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord) \ |
53 V(REPORT_BUILTIN, ReportBuiltinEventRecord) | 52 V(REPORT_BUILTIN, ReportBuiltinEventRecord) |
54 | 53 |
55 | 54 |
56 class CodeEventRecord { | 55 class CodeEventRecord { |
57 public: | 56 public: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 CpuProfiler(Isolate* isolate, | 200 CpuProfiler(Isolate* isolate, |
202 CpuProfilesCollection* test_collection, | 201 CpuProfilesCollection* test_collection, |
203 ProfileGenerator* test_generator, | 202 ProfileGenerator* test_generator, |
204 ProfilerEventsProcessor* test_processor); | 203 ProfilerEventsProcessor* test_processor); |
205 | 204 |
206 ~CpuProfiler(); | 205 ~CpuProfiler(); |
207 | 206 |
208 void StartProfiling(const char* title, bool record_samples = false); | 207 void StartProfiling(const char* title, bool record_samples = false); |
209 void StartProfiling(String* title, bool record_samples); | 208 void StartProfiling(String* title, bool record_samples); |
210 CpuProfile* StopProfiling(const char* title); | 209 CpuProfile* StopProfiling(const char* title); |
211 CpuProfile* StopProfiling(Object* security_token, String* title); | 210 CpuProfile* StopProfiling(String* title); |
212 int GetProfilesCount(); | 211 int GetProfilesCount(); |
213 CpuProfile* GetProfile(Object* security_token, int index); | 212 CpuProfile* GetProfile(int index); |
214 CpuProfile* FindProfile(Object* security_token, unsigned uid); | |
215 void DeleteAllProfiles(); | 213 void DeleteAllProfiles(); |
216 void DeleteProfile(CpuProfile* profile); | 214 void DeleteProfile(CpuProfile* profile); |
217 bool HasDetachedProfiles(); | |
218 | 215 |
219 // Invoked from stack sampler (thread or signal handler.) | 216 // Invoked from stack sampler (thread or signal handler.) |
220 TickSample* TickSampleEvent(); | 217 TickSample* TickSampleEvent(); |
221 | 218 |
222 // Must be called via PROFILE macro, otherwise will crash when | 219 // Must be called via PROFILE macro, otherwise will crash when |
223 // profiling is not enabled. | 220 // profiling is not enabled. |
224 void CallbackEvent(Name* name, Address entry_point); | 221 void CallbackEvent(Name* name, Address entry_point); |
225 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 222 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
226 Code* code, const char* comment); | 223 Code* code, const char* comment); |
227 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 224 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
(...skipping 26 matching lines...) Expand all Loading... |
254 private: | 251 private: |
255 void StartProcessorIfNotStarted(); | 252 void StartProcessorIfNotStarted(); |
256 void StopProcessorIfLastProfile(const char* title); | 253 void StopProcessorIfLastProfile(const char* title); |
257 void StopProcessor(); | 254 void StopProcessor(); |
258 void ResetProfiles(); | 255 void ResetProfiles(); |
259 void LogBuiltins(); | 256 void LogBuiltins(); |
260 | 257 |
261 Isolate* isolate_; | 258 Isolate* isolate_; |
262 CpuProfilesCollection* profiles_; | 259 CpuProfilesCollection* profiles_; |
263 unsigned next_profile_uid_; | 260 unsigned next_profile_uid_; |
264 TokenEnumerator* token_enumerator_; | |
265 ProfileGenerator* generator_; | 261 ProfileGenerator* generator_; |
266 ProfilerEventsProcessor* processor_; | 262 ProfilerEventsProcessor* processor_; |
267 int saved_logging_nesting_; | 263 int saved_logging_nesting_; |
268 bool need_to_stop_sampler_; | 264 bool need_to_stop_sampler_; |
269 bool is_profiling_; | 265 bool is_profiling_; |
270 | 266 |
271 private: | 267 private: |
272 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 268 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
273 }; | 269 }; |
274 | 270 |
275 } } // namespace v8::internal | 271 } } // namespace v8::internal |
276 | 272 |
277 | 273 |
278 #endif // V8_CPU_PROFILER_H_ | 274 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |