v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
trace-event.cc
Go to the documentation of this file.
1// Copyright 2015 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
6
7#include <string.h>
8
10#include "src/init/v8.h"
13
14namespace v8 {
15namespace internal {
16namespace tracing {
17
18#if !defined(V8_USE_PERFETTO)
22
23#ifdef V8_RUNTIME_CALL_STATS
24
25void CallStatsScopedTracer::AddEndTraceEvent() {
26 if (!has_parent_scope_ && p_data_->isolate) {
28 p_data_->isolate->counters()->runtime_call_stats()->Dump(value.get());
30 TRACE_EVENT_PHASE_END, p_data_->category_group_enabled, p_data_->name,
33 "runtime-call-stats", std::move(value));
34 } else {
36 TRACE_EVENT_PHASE_END, p_data_->category_group_enabled, p_data_->name,
39 }
40}
41
42void CallStatsScopedTracer::Initialize(v8::internal::Isolate* isolate,
43 const uint8_t* category_group_enabled,
44 const char* name) {
45 data_.isolate = isolate;
46 data_.category_group_enabled = category_group_enabled;
47 data_.name = name;
48 p_data_ = &data_;
49 RuntimeCallStats* table = isolate->counters()->runtime_call_stats();
50 has_parent_scope_ = table->InUse();
51 if (!has_parent_scope_) table->Reset();
53 TRACE_EVENT_PHASE_BEGIN, category_group_enabled, name,
56}
57
58#endif // defined(V8_RUNTIME_CALL_STATS)
59#endif // !defined(V8_USE_PERFETTO)
60
61} // namespace tracing
62} // namespace internal
63} // namespace v8
uint8_t data_[MAX_STACK_LENGTH]
virtual TracingController * GetTracingController()=0
static V8_EXPORT_PRIVATE v8::Platform * GetCurrentPlatform()
Definition v8.cc:282
static V8_EXPORT_PRIVATE v8::TracingController * GetTracingController()
static std::unique_ptr< TracedValue > Create()
Isolate * isolate
static V8_INLINE uint64_t AddTraceEvent(char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags)
const decltype(nullptr) kGlobalScope
const uint64_t kNoId
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
Definition flags.cc:2086
#define TRACE_EVENT_PHASE_END
#define TRACE_EVENT_FLAG_NONE
#define TRACE_EVENT_PHASE_BEGIN