Ring Daemon 16.0.0
Loading...
Searching...
No Matches
tracepoint.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18#pragma GCC diagnostic push
19#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
20#include "tracepoint-def.h"
21#pragma GCC diagnostic pop
22
23#ifdef ENABLE_TRACEPOINTS
24
25# ifndef lttng_ust_tracepoint
26# define lttng_ust_tracepoint(...) tracepoint(__VA_ARGS__)
27# endif
28
29# ifndef lttng_ust_do_tracepoint
30# define lttng_ust_do_tracepoint(...) do_tracepoint(__VA_ARGS__)
31# endif
32
33# ifndef lttng_ust_tracepoint_enabled
34# define lttng_ust_tracepoint_enabled(...) tracepoint_enabled(__VA_ARGS__)
35# endif
36
37# define jami_tracepoint(tp_name, ...) \
38 lttng_ust_tracepoint(jami, tp_name __VA_OPT__(,) __VA_ARGS__)
39
40# define jami_tracepoint_if_enabled(tp_name, ...) \
41 do { \
42 if (lttng_ust_tracepoint_enabled(jami, tp_name)) { \
43 lttng_ust_do_tracepoint(jami, \
44 tp_name \
45 __VA_OPT__(,) \
46 __VA_ARGS__); \
47 } \
48 } \
49 while (0)
50
51#else
52
53# define jami_tracepoint(...) static_assert(true)
54# define jami_tracepoint_if_enabled(...) static_assert(true)
55
56#endif