Commit | Line | Data |
---|---|---|
c0c0989a MJ |
1 | /* |
2 | * SPDX-License-Identifier: MIT | |
3 | * | |
4 | * Copyright (C) 2014 Geneviève Bastien <gbastien@versatic.net> | |
5 | */ | |
6 | ||
5b393d64 | 7 | #undef LTTNG_UST_TRACEPOINT_PROVIDER |
bebb067e | 8 | #define LTTNG_UST_TRACEPOINT_PROVIDER ust_tests_ust_fields |
c785c634 | 9 | |
bebb067e MJ |
10 | #if !defined(_TRACEPOINT_UST_TESTS_UST_FIELDS_H) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ) |
11 | #define _TRACEPOINT_UST_TESTS_UST_FIELDS_H | |
c785c634 | 12 | |
c785c634 MD |
13 | #include <lttng/tracepoint.h> |
14 | ||
bebb067e | 15 | LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ust_fields, testenum, |
4849bc7a | 16 | LTTNG_UST_TP_ENUM_VALUES( |
78684808 MJ |
17 | lttng_ust_field_enum_value("even", 0) |
18 | lttng_ust_field_enum_value("uneven", 1) | |
19 | lttng_ust_field_enum_range("twoto4", 2, 4) | |
20 | lttng_ust_field_enum_value("five\"extra\\test", 5) | |
c785c634 MD |
21 | ) |
22 | ) | |
23 | ||
bebb067e | 24 | LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ust_fields, testenum2, |
4849bc7a | 25 | LTTNG_UST_TP_ENUM_VALUES( |
78684808 MJ |
26 | lttng_ust_field_enum_value("zero", 0) |
27 | lttng_ust_field_enum_value("five", 5) | |
28 | lttng_ust_field_enum_range("ten_to_twenty", 10, 20) | |
c785c634 MD |
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 | */ | |
bebb067e | 36 | LTTNG_UST_TRACEPOINT_EVENT(ust_tests_ust_fields, tptest, |
cadfcbfc | 37 | LTTNG_UST_TP_ARGS(int, anint, int, enumval, int, enumval2), |
efa14d16 | 38 | LTTNG_UST_TP_FIELDS( |
b4064f28 | 39 | lttng_ust_field_integer(int, intfield, anint) |
bebb067e MJ |
40 | lttng_ust_field_enum(ust_tests_ust_fields, testenum, int, enumfield, enumval) |
41 | lttng_ust_field_enum(ust_tests_ust_fields, testenum, long long, | |
c785c634 | 42 | enumfield_bis, enumval) |
bebb067e | 43 | lttng_ust_field_enum(ust_tests_ust_fields, testenum2, unsigned int, |
c785c634 MD |
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 | */ | |
bebb067e | 52 | LTTNG_UST_TRACEPOINT_EVENT(ust_tests_ust_fields, tptest_bis, |
cadfcbfc | 53 | LTTNG_UST_TP_ARGS(int, anint, int, enumval), |
efa14d16 | 54 | LTTNG_UST_TP_FIELDS( |
b4064f28 | 55 | lttng_ust_field_integer(int, intfield, anint) |
bebb067e | 56 | lttng_ust_field_enum(ust_tests_ust_fields, testenum, unsigned char, |
c785c634 MD |
57 | enumfield, enumval) |
58 | ) | |
59 | ) | |
60 | ||
bebb067e | 61 | #endif /* _TRACEPOINT_UST_TESTS_UST_FIELDS_H */ |
c785c634 | 62 | |
bb71a8ea | 63 | #undef LTTNG_UST_TRACEPOINT_INCLUDE |
bebb067e | 64 | #define LTTNG_UST_TRACEPOINT_INCLUDE "./ust_tests_ust_fields.h" |
c785c634 MD |
65 | |
66 | /* This part must be outside ifdef protection */ | |
67 | #include <lttng/tracepoint-event.h> |