blob: cd554a557e8402e84b3e5fc5cea16543ab1fb58e [file] [log] [blame]
// Copyright 2020 The Chromium OS 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 VM_TOOLS_SOMMELIER_SOMMELIER_TRACING_H_
#define VM_TOOLS_SOMMELIER_SOMMELIER_TRACING_H_
#if defined(PERFETTO_TRACING)
#include <perfetto.h>
PERFETTO_DEFINE_CATEGORIES(
perfetto::Category("surface").SetDescription(
"Events for Wayland surface management"),
perfetto::Category("display").SetDescription("Events for Wayland display"),
perfetto::Category("shell").SetDescription("Events for Wayland shell"),
perfetto::Category("shm").SetDescription(
"Events for Wayland shared memory"),
perfetto::Category("viewport")
.SetDescription("Events for Wayland viewport"),
perfetto::Category("sync").SetDescription("Events for Wayland sync points"),
perfetto::Category("x11wm").SetDescription(
"Events for X11 window management"),
perfetto::Category("other").SetDescription("Uncategorized Wayland calls."));
void perfetto_annotate_xcb_atom(const perfetto::EventContext& event,
const char* name,
uint32_t atom);
void perfetto_annotate_xcb_property_state(const perfetto::EventContext& event,
const char* name,
uint32_t state);
#else
#define TRACE_EVENT(category, name, ...)
#endif
void initialize_tracing(bool in_process_backend, bool system_backend);
void enable_tracing(bool create_session);
void dump_trace(char const* filename);
#endif // VM_TOOLS_SOMMELIER_SOMMELIER_TRACING_H_