trace-categories.h 2.45 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
// Copyright 2020 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_TRACE_CATEGORIES_H_
#define V8_TRACING_TRACE_CATEGORIES_H_

#include "src/base/macros.h"

#if defined(V8_USE_PERFETTO)

// Exports tracks events into the v8 namespace to avoid conflicts with embedders
// like Chrome.
#define PERFETTO_TRACK_EVENT_NAMESPACE v8

// Export trace categories and the track event data source in components builds.
#define PERFETTO_COMPONENT_EXPORT V8_EXPORT_PRIVATE

// For now most of v8 uses legacy trace events.
#define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1

#include "perfetto/tracing.h"

// Trace category prefixes used in tests.
PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES("v8-cat", "cat", "v8.Test2");

// List of categories used by built-in V8 trace events.
// clang-format off
PERFETTO_DEFINE_CATEGORIES(
    perfetto::Category("V8.HandleInterrupts"),
    perfetto::Category("v8"),
    perfetto::Category("v8.console"),
    perfetto::Category("v8.execute"),
    perfetto::Category("v8.runtime"),
35
    perfetto::Category("v8.wasm"),
36
    perfetto::Category::Group("devtools.timeline,v8"),
37 38
    perfetto::Category::Group("devtools.timeline,"
                              TRACE_DISABLED_BY_DEFAULT("v8.gc")),
39 40 41 42 43 44 45 46 47 48 49
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("devtools.timeline")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.compile")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc_stats")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.ic_stats")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats_sampling")),
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.turbofan")),
50
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed")),
51
    perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.zone_stats")),
52
    perfetto::Category::Group("v8,devtools.timeline"),
53
    perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.turbofan") ","
54
                              TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed")));
55 56 57 58 59
// clang-format on

#endif  // defined(V8_USE_PERFETTO)

#endif  // V8_TRACING_TRACE_CATEGORIES_H_