| Index: include/v8-tracing-controller.h
|
| diff --git a/include/v8-tracing-controller.h b/include/v8-tracing-controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..bfcc02b0fd8f09aa7fe847ec93ae5b7fd60af630
|
| --- /dev/null
|
| +++ b/include/v8-tracing-controller.h
|
| @@ -0,0 +1,63 @@
|
| +// Copyright 2016 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef V8_TRACING_CONTROLLER_H_
|
| +#define V8_TRACING_CONTROLLER_H_
|
| +
|
| +#include "include/v8-sampler.h"
|
| +#include "src/base/platform/elapsed-timer.h"
|
| +
|
| +namespace v8 {
|
| +
|
| +namespace internal {
|
| +struct TickSample;
|
| +}
|
| +
|
| +class Isolate;
|
| +class Profiler;
|
| +class Ticker;
|
| +class TracingLogger;
|
| +struct JitCodeEvent;
|
| +
|
| +class TracingController {
|
| + public:
|
| + static void SetUp() {
|
| + if (!TracingController::mutex_)
|
| + TracingController::mutex_ = new base::Mutex();
|
| + V8Sampler::SetUp();
|
| + }
|
| + static void TearDown() {
|
| + V8Sampler::TearDown();
|
| + delete mutex_;
|
| + mutex_ = NULL;
|
| + }
|
| + static void StartTracing(Isolate* isolate);
|
| + static void StopTracing();
|
| + static void SetInterval(int interval);
|
| +
|
| + Isolate* isolate() const { return isolate_; }
|
| + bool IsTracing() const { return is_tracing_; }
|
| + private:
|
| + static void InstallJitCodeEventHandler(Isolate* isolate, void* data);
|
| + static void HandleJitCodeEvent(const JitCodeEvent* event);
|
| + void Start();
|
| + void Stop();
|
| + TracingController(Isolate* isolate);
|
| + void LogSample(i::TickSample* sample, bool overflow);
|
| + friend class Profiler;
|
| + friend class Ticker;
|
| +
|
| + base::ElapsedTimer timer_;
|
| + bool is_tracing_;
|
| + Isolate* isolate_;
|
| + Profiler* profiler_;
|
| + Ticker* ticker_;
|
| + TracingLogger* logger_;
|
| + static base::Mutex* mutex_;
|
| + static TracingController* tracing_controller_;
|
| +};
|
| +
|
| +}
|
| +
|
| +#endif // V8_TRACING_CONTROLLER_H_
|
|
|