OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return current_state_ ? current_state_->state() : OTHER; | 270 return current_state_ ? current_state_->state() : OTHER; |
271 } | 271 } |
272 | 272 |
273 static bool is_logging() { | 273 static bool is_logging() { |
274 return is_logging_; | 274 return is_logging_; |
275 } | 275 } |
276 | 276 |
277 // Pause/Resume collection of profiling data. | 277 // Pause/Resume collection of profiling data. |
278 // When data collection is paused, CPU Tick events are discarded until | 278 // When data collection is paused, CPU Tick events are discarded until |
279 // data collection is Resumed. | 279 // data collection is Resumed. |
280 static void PauseProfiler(int flags); | 280 static void PauseProfiler(int flags, int tag); |
281 static void ResumeProfiler(int flags); | 281 static void ResumeProfiler(int flags, int tag); |
282 static int GetActiveProfilerModules(); | 282 static int GetActiveProfilerModules(); |
283 | 283 |
284 // If logging is performed into a memory buffer, allows to | 284 // If logging is performed into a memory buffer, allows to |
285 // retrieve previously written messages. See v8.h. | 285 // retrieve previously written messages. See v8.h. |
286 static int GetLogLines(int from_pos, char* dest_buf, int max_size); | 286 static int GetLogLines(int from_pos, char* dest_buf, int max_size); |
287 | 287 |
288 // Logs all compiled functions found in the heap. | 288 // Logs all compiled functions found in the heap. |
289 static void LogCompiledFunctions(); | 289 static void LogCompiledFunctions(); |
290 // Logs all compiled JSFunction objects found in the heap. | 290 // Logs all compiled JSFunction objects found in the heap. |
291 static void LogFunctionObjects(); | 291 static void LogFunctionObjects(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 friend class EventLog; | 372 friend class EventLog; |
373 friend class TimeLog; | 373 friend class TimeLog; |
374 friend class Profiler; | 374 friend class Profiler; |
375 friend class SlidingStateWindow; | 375 friend class SlidingStateWindow; |
376 friend class StackTracer; | 376 friend class StackTracer; |
377 friend class VMState; | 377 friend class VMState; |
378 | 378 |
379 friend class LoggerTestHelper; | 379 friend class LoggerTestHelper; |
380 | 380 |
381 static bool is_logging_; | 381 static bool is_logging_; |
| 382 static int cpu_profiler_nesting_; |
| 383 static int heap_profiler_nesting_; |
382 #else | 384 #else |
383 static bool is_logging() { return false; } | 385 static bool is_logging() { return false; } |
384 #endif | 386 #endif |
385 }; | 387 }; |
386 | 388 |
387 | 389 |
388 // Class that extracts stack trace, used for profiling. | 390 // Class that extracts stack trace, used for profiling. |
389 class StackTracer : public AllStatic { | 391 class StackTracer : public AllStatic { |
390 public: | 392 public: |
391 static void Trace(TickSample* sample); | 393 static void Trace(TickSample* sample); |
392 }; | 394 }; |
393 | 395 |
394 | 396 |
395 } } // namespace v8::internal | 397 } } // namespace v8::internal |
396 | 398 |
397 #endif // V8_LOG_H_ | 399 #endif // V8_LOG_H_ |
OLD | NEW |