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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Address* stack); | 267 Address* stack); |
268 void HeapSampleStats(const char* space, const char* kind, | 268 void HeapSampleStats(const char* space, const char* kind, |
269 intptr_t capacity, intptr_t used); | 269 intptr_t capacity, intptr_t used); |
270 | 270 |
271 void SharedLibraryEvent(const char* library_path, | 271 void SharedLibraryEvent(const char* library_path, |
272 uintptr_t start, | 272 uintptr_t start, |
273 uintptr_t end); | 273 uintptr_t end); |
274 void SharedLibraryEvent(const wchar_t* library_path, | 274 void SharedLibraryEvent(const wchar_t* library_path, |
275 uintptr_t start, | 275 uintptr_t start, |
276 uintptr_t end); | 276 uintptr_t end); |
| 277 void TimerEvent(const char* name, int64_t start, int64_t end); |
| 278 |
| 279 class TimerEventScope { |
| 280 public: |
| 281 TimerEventScope(Logger* logger, const char* name) |
| 282 : logger_(logger), name_(name), start_(0) { |
| 283 if (FLAG_log_timer_events) start_ = OS::Ticks(); |
| 284 } |
| 285 |
| 286 ~TimerEventScope() { |
| 287 if (FLAG_log_timer_events) { |
| 288 logger_->TimerEvent(name_, start_, OS::Ticks()); |
| 289 } |
| 290 } |
| 291 |
| 292 static const char* v8_recompile_synchronous; |
| 293 static const char* v8_recompile_parallel; |
| 294 static const char* v8_compile_full_code; |
| 295 static const char* v8_execute; |
| 296 |
| 297 private: |
| 298 Logger* logger_; |
| 299 const char* name_; |
| 300 int64_t start_; |
| 301 }; |
277 | 302 |
278 // ==== Events logged by --log-regexp ==== | 303 // ==== Events logged by --log-regexp ==== |
279 // Regexp compilation and execution events. | 304 // Regexp compilation and execution events. |
280 | 305 |
281 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); | 306 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); |
282 | 307 |
283 // Log an event reported from generated code | 308 // Log an event reported from generated code |
284 void LogRuntime(Vector<const char> format, JSArray* args); | 309 void LogRuntime(Vector<const char> format, JSArray* args); |
285 | 310 |
286 bool is_logging() { | 311 bool is_logging() { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 // LogMessageBuilder::AppendAddress(Address addr) | 467 // LogMessageBuilder::AppendAddress(Address addr) |
443 Address last_address_; | 468 Address last_address_; |
444 // Logger::TickEvent(...) | 469 // Logger::TickEvent(...) |
445 Address prev_sp_; | 470 Address prev_sp_; |
446 Address prev_function_; | 471 Address prev_function_; |
447 // Logger::MoveEventInternal(...) | 472 // Logger::MoveEventInternal(...) |
448 Address prev_to_; | 473 Address prev_to_; |
449 // Logger::FunctionCreateEvent(...) | 474 // Logger::FunctionCreateEvent(...) |
450 Address prev_code_; | 475 Address prev_code_; |
451 | 476 |
| 477 int64_t epoch_; |
| 478 |
452 friend class CpuProfiler; | 479 friend class CpuProfiler; |
453 }; | 480 }; |
454 | 481 |
455 | 482 |
456 // Process wide registry of samplers. | 483 // Process wide registry of samplers. |
457 class SamplerRegistry : public AllStatic { | 484 class SamplerRegistry : public AllStatic { |
458 public: | 485 public: |
459 enum State { | 486 enum State { |
460 HAS_NO_SAMPLERS, | 487 HAS_NO_SAMPLERS, |
461 HAS_SAMPLERS, | 488 HAS_SAMPLERS, |
(...skipping 28 matching lines...) Expand all Loading... |
490 // Class that extracts stack trace, used for profiling. | 517 // Class that extracts stack trace, used for profiling. |
491 class StackTracer : public AllStatic { | 518 class StackTracer : public AllStatic { |
492 public: | 519 public: |
493 static void Trace(Isolate* isolate, TickSample* sample); | 520 static void Trace(Isolate* isolate, TickSample* sample); |
494 }; | 521 }; |
495 | 522 |
496 } } // namespace v8::internal | 523 } } // namespace v8::internal |
497 | 524 |
498 | 525 |
499 #endif // V8_LOG_H_ | 526 #endif // V8_LOG_H_ |
OLD | NEW |