v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
recorder.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_LIBPLATFORM_TRACING_RECORDER_H_
6#define V8_LIBPLATFORM_TRACING_RECORDER_H_
7
8#include <stdint.h>
9
11
12#if V8_OS_DARWIN
13#include <os/signpost.h>
14#pragma clang diagnostic push
15#pragma clang diagnostic ignored "-Wunguarded-availability"
16#endif
17
18#if !defined(V8_ENABLE_SYSTEM_INSTRUMENTATION)
19#error "only include this file if V8_ENABLE_SYSTEM_INSTRUMENTATION"
20#endif // V8_ENABLE_SYSTEM_INSTRUMENTATION
21
22namespace v8 {
23namespace platform {
24namespace tracing {
25
26// This class serves as a base class for emitting events to system event
27// controllers: ETW for Windows, Signposts on Mac (to be implemented). It is
28// enabled by turning on both the ENABLE_SYSTEM_INSTRUMENTATION build flag and
29// the --enable-system-instrumentation command line flag. When enabled, it is
30// called from within SystemInstrumentationTraceWriter and replaces the
31// JSONTraceWriter for event-tracing.
33 public:
34 Recorder();
35 ~Recorder();
36
37 bool IsEnabled();
38 bool IsEnabled(const uint8_t level);
39
40 void AddEvent(TraceObject* trace_event);
41
42 private:
43#if V8_OS_DARWIN
44 os_log_t v8Provider;
45#endif
46};
47
48} // namespace tracing
49} // namespace platform
50} // namespace v8
51
52#if V8_OS_DARWIN
53#pragma clang diagnostic pop
54#endif
55
56#endif // V8_LIBPLATFORM_TRACING_RECORDER_H_
#define V8_PLATFORM_EXPORT