Commit | Line | Data |
---|---|---|
d0e8dd39 MJ |
1 | /* |
2 | * SPDX-License-Identifier: MIT | |
3 | * | |
4 | * Copyright (C) 2014 Geneviève Bastien <gbastien@versatic.net> | |
5 | */ | |
6 | ||
7 | #undef TRACEPOINT_PROVIDER | |
8 | #define TRACEPOINT_PROVIDER ust_tests_ctf_types | |
9 | ||
10 | #if !defined(_TRACEPOINT_UST_TESTS_CTF_TYPES_H) || defined(TRACEPOINT_HEADER_MULTI_READ) | |
11 | #define _TRACEPOINT_UST_TESTS_CTF_TYPES_H | |
12 | ||
13 | #include <lttng/tracepoint.h> | |
14 | ||
15 | TRACEPOINT_ENUM(ust_tests_ctf_types, testenum, | |
16 | TP_ENUM_VALUES( | |
17 | ctf_enum_value("even", 0) | |
18 | ctf_enum_value("uneven", 1) | |
19 | ctf_enum_range("twoto4", 2, 4) | |
20 | ctf_enum_value("five\"extra\\test", 5) | |
21 | ) | |
22 | ) | |
23 | ||
24 | TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2, | |
25 | TP_ENUM_VALUES( | |
26 | ctf_enum_value("zero", 0) | |
27 | ctf_enum_value("five", 5) | |
28 | ctf_enum_range("ten_to_twenty", 10, 20) | |
29 | ) | |
30 | ) | |
31 | ||
32 | /* | |
33 | * Enumeration field is used twice to make sure the type declaration | |
34 | * is entered only once in the metadata file. | |
35 | */ | |
36 | TRACEPOINT_EVENT(ust_tests_ctf_types, tptest, | |
37 | TP_ARGS(int, anint, int, enumval, int, enumval2), | |
38 | TP_FIELDS( | |
39 | ctf_integer(int, intfield, anint) | |
40 | ctf_enum(ust_tests_ctf_types, testenum, int, enumfield, enumval) | |
41 | ctf_enum(ust_tests_ctf_types, testenum, long long, | |
42 | enumfield_bis, enumval) | |
43 | ctf_enum(ust_tests_ctf_types, testenum2, unsigned int, | |
44 | enumfield_third, enumval2) | |
45 | ) | |
46 | ) | |
47 | ||
48 | /* | |
49 | * Another tracepoint using the types to make sure each type is entered | |
50 | * only once in the metadata file. | |
51 | */ | |
52 | TRACEPOINT_EVENT(ust_tests_ctf_types, tptest_bis, | |
53 | TP_ARGS(int, anint, int, enumval), | |
54 | TP_FIELDS( | |
55 | ctf_integer(int, intfield, anint) | |
56 | ctf_enum(ust_tests_ctf_types, testenum, unsigned char, | |
57 | enumfield, enumval) | |
58 | ) | |
59 | ) | |
60 | ||
61 | #endif /* _TRACEPOINT_UST_TESTS_CTF_TYPES_H */ | |
62 | ||
63 | #undef TRACEPOINT_INCLUDE | |
64 | #define TRACEPOINT_INCLUDE "./ust_tests_ctf_types.h" | |
65 | ||
66 | /* This part must be outside ifdef protection */ | |
67 | #include <lttng/tracepoint-event.h> |