tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / regression / ust / type-declarations / ust_tests_td.h
CommitLineData
10b56aef
MD
1/*
2 * Copyright (C) 2014 Geneviève Bastien <gbastien@versatic.net>
3 *
9d16b343 4 * SPDX-License-Identifier: MIT
10b56aef 5 *
10b56aef
MD
6 */
7
9d16b343
MJ
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
10b56aef
MD
14#include <lttng/tracepoint.h>
15
16TRACEPOINT_ENUM(ust_tests_td, testenum,
17 TP_ENUM_VALUES(
18 ctf_enum_value("zero", 0)
19 ctf_enum_value("one", 1)
20 )
21)
22
23TRACEPOINT_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
358f4691
PP
31TRACEPOINT_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
10b56aef
MD
41/*
42 * Enumeration field is used twice to make sure the global type declaration
43 * is entered only once in the metadata file.
44 */
45TRACEPOINT_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 */
60TRACEPOINT_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
358f4691
PP
68/*
69 * Test autoincrementing enumeration values.
70 */
71TRACEPOINT_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
10b56aef
MD
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>
This page took 0.032693 seconds and 4 git commands to generate.