Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 1 | /* |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 2 | * Copyright (C) 2004-2023 Savoir-faire Linux Inc. |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 3 | * |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 4 | * This program is free software: you can redistribute it and/or modify |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 5 | * it under the terms of the GNU General Public License as published by |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 6 | * the Free Software Foundation, either version 3 of the License, or |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 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 |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 16 | */ |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 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 |