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_TRACING_TRACE_CATEGORIES_H_ 6 #define V8_TRACING_TRACE_CATEGORIES_H_ 7 8 #include "src/base/macros.h" 9 10 #if defined(V8_USE_PERFETTO) 11 12 // Exports tracks events into the v8 namespace to avoid conflicts with embedders 13 // like Chrome. 14 #define PERFETTO_TRACK_EVENT_NAMESPACE v8 15 16 // Export trace categories and the track event data source in components builds. 17 #define PERFETTO_COMPONENT_EXPORT V8_EXPORT_PRIVATE 18 19 // For now most of v8 uses legacy trace events. 20 #define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1 21 22 #include "perfetto/tracing.h" 23 24 // Trace category prefixes used in tests. 25 PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES("v8-cat", "cat", "v8.Test2"); 26 27 // List of categories used by built-in V8 trace events. 28 // clang-format off 29 PERFETTO_DEFINE_CATEGORIES( 30 perfetto::Category("V8.HandleInterrupts"), 31 perfetto::Category("v8"), 32 perfetto::Category("v8.console"), 33 perfetto::Category("v8.execute"), 34 perfetto::Category("v8.runtime"), 35 perfetto::Category("v8.wasm"), 36 perfetto::Category::Group("devtools.timeline,v8"), 37 perfetto::Category::Group("devtools.timeline," 38 TRACE_DISABLED_BY_DEFAULT("v8.gc")), 39 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("devtools.timeline")), 40 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8")), 41 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.compile")), 42 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler")), 43 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc")), 44 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc_stats")), 45 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.ic_stats")), 46 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime")), 47 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats")), 48 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats_sampling")), 49 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.stack_trace")), 50 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.turbofan")), 51 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed")), 52 perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.zone_stats")), 53 perfetto::Category::Group("v8,devtools.timeline"), 54 perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.turbofan") "," 55 TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"))); 56 // clang-format on 57 58 #endif // defined(V8_USE_PERFETTO) 59 60 #endif // V8_TRACING_TRACE_CATEGORIES_H_ 61