Chromium Code Reviews| 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 Logger* logger_; | |
|
Jakob Kummerow
2012/11/22 10:56:08
"private:"?
Yang
2012/11/22 13:04:20
Done.
| |
| 293 const char* name_; | |
| 294 int64_t start_; | |
| 295 }; | |
| 277 | 296 |
| 278 // ==== Events logged by --log-regexp ==== | 297 // ==== Events logged by --log-regexp ==== |
| 279 // Regexp compilation and execution events. | 298 // Regexp compilation and execution events. |
| 280 | 299 |
| 281 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); | 300 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); |
| 282 | 301 |
| 283 // Log an event reported from generated code | 302 // Log an event reported from generated code |
| 284 void LogRuntime(Vector<const char> format, JSArray* args); | 303 void LogRuntime(Vector<const char> format, JSArray* args); |
| 285 | 304 |
| 286 bool is_logging() { | 305 bool is_logging() { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 // LogMessageBuilder::AppendAddress(Address addr) | 461 // LogMessageBuilder::AppendAddress(Address addr) |
| 443 Address last_address_; | 462 Address last_address_; |
| 444 // Logger::TickEvent(...) | 463 // Logger::TickEvent(...) |
| 445 Address prev_sp_; | 464 Address prev_sp_; |
| 446 Address prev_function_; | 465 Address prev_function_; |
| 447 // Logger::MoveEventInternal(...) | 466 // Logger::MoveEventInternal(...) |
| 448 Address prev_to_; | 467 Address prev_to_; |
| 449 // Logger::FunctionCreateEvent(...) | 468 // Logger::FunctionCreateEvent(...) |
| 450 Address prev_code_; | 469 Address prev_code_; |
| 451 | 470 |
| 471 int64_t epoch_; | |
| 472 | |
| 452 friend class CpuProfiler; | 473 friend class CpuProfiler; |
| 453 }; | 474 }; |
| 454 | 475 |
| 455 | 476 |
| 456 // Process wide registry of samplers. | 477 // Process wide registry of samplers. |
| 457 class SamplerRegistry : public AllStatic { | 478 class SamplerRegistry : public AllStatic { |
| 458 public: | 479 public: |
| 459 enum State { | 480 enum State { |
| 460 HAS_NO_SAMPLERS, | 481 HAS_NO_SAMPLERS, |
| 461 HAS_SAMPLERS, | 482 HAS_SAMPLERS, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 490 // Class that extracts stack trace, used for profiling. | 511 // Class that extracts stack trace, used for profiling. |
| 491 class StackTracer : public AllStatic { | 512 class StackTracer : public AllStatic { |
| 492 public: | 513 public: |
| 493 static void Trace(Isolate* isolate, TickSample* sample); | 514 static void Trace(Isolate* isolate, TickSample* sample); |
| 494 }; | 515 }; |
| 495 | 516 |
| 496 } } // namespace v8::internal | 517 } } // namespace v8::internal |
| 497 | 518 |
| 498 | 519 |
| 499 #endif // V8_LOG_H_ | 520 #endif // V8_LOG_H_ |
| OLD | NEW |