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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Specify the name of the logfile, default is "v8.log". | 67 // Specify the name of the logfile, default is "v8.log". |
68 // | 68 // |
69 // --prof | 69 // --prof |
70 // Collect statistical profiling information (ticks), default is off. The | 70 // Collect statistical profiling information (ticks), default is off. The |
71 // tick profiler requires code events, so --prof implies --log-code. | 71 // tick profiler requires code events, so --prof implies --log-code. |
72 | 72 |
73 // Forward declarations. | 73 // Forward declarations. |
74 class LogMessageBuilder; | 74 class LogMessageBuilder; |
75 class Profiler; | 75 class Profiler; |
76 class Semaphore; | 76 class Semaphore; |
77 class SlidingStateWindow; | |
78 class Ticker; | 77 class Ticker; |
79 class Isolate; | 78 class Isolate; |
80 | 79 |
81 #undef LOG | 80 #undef LOG |
82 #define LOG(isolate, Call) \ | 81 #define LOG(isolate, Call) \ |
83 do { \ | 82 do { \ |
84 v8::internal::Logger* logger = \ | 83 v8::internal::Logger* logger = \ |
85 (isolate)->logger(); \ | 84 (isolate)->logger(); \ |
86 if (logger->is_logging()) \ | 85 if (logger->is_logging()) \ |
87 logger->Call; \ | 86 logger->Call; \ |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void EnsureTickerStarted(); | 167 void EnsureTickerStarted(); |
169 void EnsureTickerStopped(); | 168 void EnsureTickerStopped(); |
170 | 169 |
171 Sampler* sampler(); | 170 Sampler* sampler(); |
172 | 171 |
173 // Frees resources acquired in SetUp. | 172 // Frees resources acquired in SetUp. |
174 // When a temporary file is used for the log, returns its stream descriptor, | 173 // When a temporary file is used for the log, returns its stream descriptor, |
175 // leaving the file open. | 174 // leaving the file open. |
176 FILE* TearDown(); | 175 FILE* TearDown(); |
177 | 176 |
178 // Enable the computation of a sliding window of states. | |
179 void EnableSlidingStateWindow(); | |
180 | |
181 // Emits an event with a string value -> (name, value). | 177 // Emits an event with a string value -> (name, value). |
182 void StringEvent(const char* name, const char* value); | 178 void StringEvent(const char* name, const char* value); |
183 | 179 |
184 // Emits an event with an int value -> (name, value). | 180 // Emits an event with an int value -> (name, value). |
185 void IntEvent(const char* name, int value); | 181 void IntEvent(const char* name, int value); |
186 void IntPtrTEvent(const char* name, intptr_t value); | 182 void IntPtrTEvent(const char* name, intptr_t value); |
187 | 183 |
188 // Emits an event with an handle value -> (name, location). | 184 // Emits an event with an handle value -> (name, location). |
189 void HandleEvent(const char* name, Object** location); | 185 void HandleEvent(const char* name, Object** location); |
190 | 186 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 bool IsProfilerSamplerActive(); | 422 bool IsProfilerSamplerActive(); |
427 | 423 |
428 // The sampler used by the profiler and the sliding state window. | 424 // The sampler used by the profiler and the sliding state window. |
429 Ticker* ticker_; | 425 Ticker* ticker_; |
430 | 426 |
431 // When the statistical profile is active, profiler_ | 427 // When the statistical profile is active, profiler_ |
432 // points to a Profiler, that handles collection | 428 // points to a Profiler, that handles collection |
433 // of samples. | 429 // of samples. |
434 Profiler* profiler_; | 430 Profiler* profiler_; |
435 | 431 |
436 // SlidingStateWindow instance keeping a sliding window of the most | |
437 // recent VM states. | |
438 SlidingStateWindow* sliding_state_window_; | |
439 | |
440 // An array of log events names. | 432 // An array of log events names. |
441 const char* const* log_events_; | 433 const char* const* log_events_; |
442 | 434 |
443 // Internal implementation classes with access to | 435 // Internal implementation classes with access to |
444 // private members. | 436 // private members. |
445 friend class EventLog; | 437 friend class EventLog; |
446 friend class Isolate; | 438 friend class Isolate; |
447 friend class LogMessageBuilder; | 439 friend class LogMessageBuilder; |
448 friend class TimeLog; | 440 friend class TimeLog; |
449 friend class Profiler; | 441 friend class Profiler; |
450 friend class SlidingStateWindow; | |
451 friend class StackTracer; | 442 friend class StackTracer; |
452 friend class VMState; | 443 friend class VMState; |
453 | 444 |
454 friend class LoggerTestHelper; | 445 friend class LoggerTestHelper; |
455 | 446 |
456 | 447 |
457 int logging_nesting_; | 448 int logging_nesting_; |
458 int cpu_profiler_nesting_; | 449 int cpu_profiler_nesting_; |
459 | 450 |
460 Log* log_; | 451 Log* log_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // Class that extracts stack trace, used for profiling. | 516 // Class that extracts stack trace, used for profiling. |
526 class StackTracer : public AllStatic { | 517 class StackTracer : public AllStatic { |
527 public: | 518 public: |
528 static void Trace(Isolate* isolate, TickSample* sample); | 519 static void Trace(Isolate* isolate, TickSample* sample); |
529 }; | 520 }; |
530 | 521 |
531 } } // namespace v8::internal | 522 } } // namespace v8::internal |
532 | 523 |
533 | 524 |
534 #endif // V8_LOG_H_ | 525 #endif // V8_LOG_H_ |
OLD | NEW |