| 1 | /* |
| 2 | * Copyright (C) 2014 Geneviève Bastien <gbastien@versatic.net> |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #undef TRACEPOINT_PROVIDER |
| 9 | #define TRACEPOINT_PROVIDER ust_tests_td |
| 10 | |
| 11 | #if !defined(_TRACEPOINT_UST_TESTS_TD_H) || defined(TRACEPOINT_HEADER_MULTI_READ) |
| 12 | #define _TRACEPOINT_UST_TESTS_TD_H |
| 13 | |
| 14 | #include <lttng/tracepoint.h> |
| 15 | |
| 16 | TRACEPOINT_ENUM(ust_tests_td, testenum, |
| 17 | TP_ENUM_VALUES( |
| 18 | ctf_enum_value("zero", 0) |
| 19 | ctf_enum_value("one", 1) |
| 20 | ) |
| 21 | ) |
| 22 | |
| 23 | TRACEPOINT_ENUM(ust_tests_td, testenum2, |
| 24 | TP_ENUM_VALUES( |
| 25 | ctf_enum_value("zero", 0) |
| 26 | ctf_enum_value("five", 5) |
| 27 | ctf_enum_range("ten_to_twenty", 10, 20) |
| 28 | ) |
| 29 | ) |
| 30 | |
| 31 | TRACEPOINT_ENUM(ust_tests_td, testenum3, |
| 32 | TP_ENUM_VALUES( |
| 33 | ctf_enum_auto("zero") |
| 34 | ctf_enum_value("two", 2) |
| 35 | ctf_enum_auto("three") |
| 36 | ctf_enum_range("ten_to_twenty", 10, 20) |
| 37 | ctf_enum_auto("twenty_one") |
| 38 | ) |
| 39 | ) |
| 40 | |
| 41 | /* |
| 42 | * Enumeration field is used twice to make sure the global type declaration |
| 43 | * is entered only once in the metadata file. |
| 44 | */ |
| 45 | TRACEPOINT_EVENT(ust_tests_td, tptest, |
| 46 | TP_ARGS(int, enumval, int, enumval2, int, enumval3), |
| 47 | TP_FIELDS( |
| 48 | ctf_enum(ust_tests_td, testenum, int, enumfield, enumval) |
| 49 | ctf_enum(ust_tests_td, testenum, long long, |
| 50 | enumfield_bis, enumval2) |
| 51 | ctf_enum(ust_tests_td, testenum2, unsigned int, |
| 52 | enumfield_third, enumval3) |
| 53 | ) |
| 54 | ) |
| 55 | |
| 56 | /* |
| 57 | * Another tracepoint using the global types to make sure each global type is |
| 58 | * entered only once in the metadata file. |
| 59 | */ |
| 60 | TRACEPOINT_EVENT(ust_tests_td, tptest_bis, |
| 61 | TP_ARGS(int, enumval), |
| 62 | TP_FIELDS( |
| 63 | ctf_enum(ust_tests_td, testenum, unsigned char, |
| 64 | enumfield, enumval) |
| 65 | ) |
| 66 | ) |
| 67 | |
| 68 | /* |
| 69 | * Test autoincrementing enumeration values. |
| 70 | */ |
| 71 | TRACEPOINT_EVENT(ust_tests_td, test_auto, |
| 72 | TP_ARGS(void), |
| 73 | TP_FIELDS( |
| 74 | ctf_enum(ust_tests_td, testenum3, int, zero, 0) |
| 75 | ctf_enum(ust_tests_td, testenum3, int, two, 2) |
| 76 | ctf_enum(ust_tests_td, testenum3, int, three, 3) |
| 77 | ctf_enum(ust_tests_td, testenum3, int, fifteen, 15) |
| 78 | ctf_enum(ust_tests_td, testenum3, int, twenty_one, 21) |
| 79 | ) |
| 80 | ) |
| 81 | |
| 82 | #endif /* _TRACEPOINT_UST_TESTS_TD_H */ |
| 83 | |
| 84 | #undef TRACEPOINT_INCLUDE |
| 85 | #define TRACEPOINT_INCLUDE "./ust_tests_td.h" |
| 86 | |
| 87 | /* This part must be outside ifdef protection */ |
| 88 | #include <lttng/tracepoint-event.h> |