v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
recorder-mac.cc
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_MAC_H_
6
#define V8_LIBPLATFORM_TRACING_RECORDER_MAC_H_
7
8
#include "
src/libplatform/tracing/recorder.h
"
9
10
#pragma clang diagnostic push
11
#pragma clang diagnostic ignored "-Wunguarded-availability"
12
13
namespace
v8
{
14
namespace
platform {
15
namespace
tracing {
16
17
Recorder::Recorder
() { v8Provider = os_log_create(
"v8"
,
""
); }
18
Recorder::~Recorder
() {}
19
20
bool
Recorder::IsEnabled
() {
21
return
os_log_type_enabled(v8Provider, OS_LOG_TYPE_DEFAULT);
22
}
23
bool
Recorder::IsEnabled
(
const
uint8_t level) {
24
if
(level == OS_LOG_TYPE_DEFAULT || level == OS_LOG_TYPE_INFO ||
25
level == OS_LOG_TYPE_DEBUG || level == OS_LOG_TYPE_ERROR ||
26
level == OS_LOG_TYPE_FAULT) {
27
return
os_log_type_enabled(v8Provider,
static_cast<
os_log_type_t
>
(level));
28
}
29
return
false
;
30
}
31
32
void
Recorder::AddEvent
(
TraceObject
* trace_event) {
33
os_signpost_event_emit(v8Provider, OS_SIGNPOST_ID_EXCLUSIVE,
""
,
34
"%s, cpu_duration: %d"
, trace_event->
name
(),
35
static_cast<
int
>
(trace_event->
cpu_duration
()));
36
}
37
38
}
// namespace tracing
39
}
// namespace platform
40
}
// namespace v8
41
42
#pragma clang diagnostic pop
43
44
#endif
// V8_LIBPLATFORM_TRACING_RECORDER_MAC_H_
v8::platform::tracing::Recorder::IsEnabled
bool IsEnabled()
Definition
recorder-mac.cc:20
v8::platform::tracing::Recorder::~Recorder
~Recorder()
Definition
recorder-mac.cc:18
v8::platform::tracing::Recorder::Recorder
Recorder()
Definition
recorder-mac.cc:17
v8::platform::tracing::Recorder::AddEvent
void AddEvent(TraceObject *trace_event)
Definition
recorder-mac.cc:32
v8::platform::tracing::TraceObject
Definition
v8-tracing.h:36
v8::platform::tracing::TraceObject::name
const char * name() const
Definition
v8-tracing.h:71
v8::platform::tracing::TraceObject::cpu_duration
uint64_t cpu_duration()
Definition
v8-tracing.h:86
v8
Definition
api-arguments-inl.h:19
recorder.h
src
libplatform
tracing
recorder-mac.cc
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0