Ring Daemon
Loading...
Searching...
No Matches
tracepoint.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 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, ...) lttng_ust_tracepoint(jami, tp_name __VA_OPT__(, ) __VA_ARGS__)
38
39#define jami_tracepoint_if_enabled(tp_name, ...) \
40 do { \
41 if (lttng_ust_tracepoint_enabled(jami, tp_name)) { \
42 lttng_ust_do_tracepoint(jami, tp_name __VA_OPT__(, ) __VA_ARGS__); \
43 } \
44 } while (0)
45
46#else
47
48#define jami_tracepoint(...) static_assert(true)
49#define jami_tracepoint_if_enabled(...) static_assert(true)
50
51#endif