blob: 83c4d7086cae8d092be33cb512d2298b1cef1e74 [file] [log] [blame]
Adrien Béraud612b55b2023-05-29 10:42:04 -04001/*
Adrien Béraudcb753622023-07-17 22:32:49 -04002 * Copyright (C) 2004-2023 Savoir-faire Linux Inc.
Adrien Béraud612b55b2023-05-29 10:42:04 -04003 *
Adrien Béraudcb753622023-07-17 22:32:49 -04004 * This program is free software: you can redistribute it and/or modify
Adrien Béraud612b55b2023-05-29 10:42:04 -04005 * it under the terms of the GNU General Public License as published by
Adrien Béraudcb753622023-07-17 22:32:49 -04006 * the Free Software Foundation, either version 3 of the License, or
Adrien Béraud612b55b2023-05-29 10:42:04 -04007 * (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
Adrien Béraudcb753622023-07-17 22:32:49 -040011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Adrien Béraud612b55b2023-05-29 10:42:04 -040012 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
Adrien Béraudcb753622023-07-17 22:32:49 -040015 * along with this program. If not, see <https://www.gnu.org/licenses/>.
Adrien Béraud612b55b2023-05-29 10:42:04 -040016 */
Adrien Béraud612b55b2023-05-29 10:42:04 -040017#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