Xenomai  3.1
testing.h
Go to the documentation of this file.
1 
23 #ifndef _RTDM_UAPI_TESTING_H
24 #define _RTDM_UAPI_TESTING_H
25 
26 #include <linux/types.h>
27 
28 #define RTTST_PROFILE_VER 2
29 
30 typedef struct rttst_bench_res {
31  __s32 avg;
32  __s32 min;
33  __s32 max;
34  __s32 overruns;
35  __s32 test_loops;
36 } rttst_bench_res_t;
37 
38 typedef struct rttst_interm_bench_res {
39  struct rttst_bench_res last;
40  struct rttst_bench_res overall;
41 } rttst_interm_bench_res_t;
42 
43 typedef struct rttst_overall_bench_res {
44  struct rttst_bench_res result;
45  __s32 *histogram_avg;
46  __s32 *histogram_min;
47  __s32 *histogram_max;
48 } rttst_overall_bench_res_t;
49 
50 #define RTTST_TMBENCH_INVALID -1 /* internal use only */
51 #define RTTST_TMBENCH_TASK 0
52 #define RTTST_TMBENCH_HANDLER 1
53 
54 typedef struct rttst_tmbench_config {
55  int mode;
56  int priority;
57  __u64 period;
58  int warmup_loops;
59  int histogram_size;
60  int histogram_bucketsize;
61  int freeze_max;
62 } rttst_tmbench_config_t;
63 
64 struct rttst_swtest_task {
65  unsigned int index;
66  unsigned int flags;
67 };
68 
69 /* Possible values for struct rttst_swtest_task::flags. */
70 #define RTTST_SWTEST_FPU 0x1
71 #define RTTST_SWTEST_USE_FPU 0x2 /* Only for kernel-space tasks. */
72 #define RTTST_SWTEST_FREEZE 0x4 /* Only for kernel-space tasks. */
73 
74 struct rttst_swtest_dir {
75  unsigned int from;
76  unsigned int to;
77 };
78 
79 struct rttst_swtest_error {
80  struct rttst_swtest_dir last_switch;
81  unsigned int fp_val;
82 };
83 
84 #define RTTST_RTDM_NORMAL_CLOSE 0
85 #define RTTST_RTDM_DEFER_CLOSE_CONTEXT 1
86 
87 #define RTTST_RTDM_MAGIC_PRIMARY 0xfefbfefb
88 #define RTTST_RTDM_MAGIC_SECONDARY 0xa5b9a5b9
89 
90 #define RTTST_HEAPCHECK_ZEROOVRD 1
91 #define RTTST_HEAPCHECK_SHUFFLE 2
92 #define RTTST_HEAPCHECK_PATTERN 4
93 #define RTTST_HEAPCHECK_HOT 8
94 
95 struct rttst_heap_parms {
96  __u64 heap_size;
97  __u64 block_size;
98  int flags;
99  int nrstats;
100 };
101 
102 struct rttst_heap_stats {
103  __u64 heap_size;
104  __u64 user_size;
105  __u64 block_size;
106  __s64 alloc_avg_ns;
107  __s64 alloc_max_ns;
108  __s64 free_avg_ns;
109  __s64 free_max_ns;
110  __u64 maximum_free;
111  __u64 largest_free;
112  int nrblocks;
113  int flags;
114 };
115 
116 struct rttst_heap_stathdr {
117  int nrstats;
118  struct rttst_heap_stats *buf;
119 };
120 
121 #define RTIOC_TYPE_TESTING RTDM_CLASS_TESTING
122 
127 #define RTDM_SUBCLASS_TIMERBENCH 0
128 
129 #define RTDM_SUBCLASS_IRQBENCH 1
130 
131 #define RTDM_SUBCLASS_SWITCHTEST 2
132 
133 #define RTDM_SUBCLASS_RTDMTEST 3
134 
135 #define RTDM_SUBCLASS_HEAPCHECK 4
136 
142 #define RTTST_RTIOC_INTERM_BENCH_RES \
143  _IOWR(RTIOC_TYPE_TESTING, 0x00, struct rttst_interm_bench_res)
144 
145 #define RTTST_RTIOC_TMBENCH_START \
146  _IOW(RTIOC_TYPE_TESTING, 0x10, struct rttst_tmbench_config)
147 
148 #define RTTST_RTIOC_TMBENCH_STOP \
149  _IOWR(RTIOC_TYPE_TESTING, 0x11, struct rttst_overall_bench_res)
150 
151 #define RTTST_RTIOC_SWTEST_SET_TASKS_COUNT \
152  _IOW(RTIOC_TYPE_TESTING, 0x30, __u32)
153 
154 #define RTTST_RTIOC_SWTEST_SET_CPU \
155  _IOW(RTIOC_TYPE_TESTING, 0x31, __u32)
156 
157 #define RTTST_RTIOC_SWTEST_REGISTER_UTASK \
158  _IOW(RTIOC_TYPE_TESTING, 0x32, struct rttst_swtest_task)
159 
160 #define RTTST_RTIOC_SWTEST_CREATE_KTASK \
161  _IOWR(RTIOC_TYPE_TESTING, 0x33, struct rttst_swtest_task)
162 
163 #define RTTST_RTIOC_SWTEST_PEND \
164  _IOR(RTIOC_TYPE_TESTING, 0x34, struct rttst_swtest_task)
165 
166 #define RTTST_RTIOC_SWTEST_SWITCH_TO \
167  _IOR(RTIOC_TYPE_TESTING, 0x35, struct rttst_swtest_dir)
168 
169 #define RTTST_RTIOC_SWTEST_GET_SWITCHES_COUNT \
170  _IOR(RTIOC_TYPE_TESTING, 0x36, __u32)
171 
172 #define RTTST_RTIOC_SWTEST_GET_LAST_ERROR \
173  _IOR(RTIOC_TYPE_TESTING, 0x37, struct rttst_swtest_error)
174 
175 #define RTTST_RTIOC_SWTEST_SET_PAUSE \
176  _IOW(RTIOC_TYPE_TESTING, 0x38, __u32)
177 
178 #define RTTST_RTIOC_RTDM_DEFER_CLOSE \
179  _IOW(RTIOC_TYPE_TESTING, 0x40, __u32)
180 
181 #define RTTST_RTIOC_RTDM_ACTOR_GET_CPU \
182  _IOR(RTIOC_TYPE_TESTING, 0x41, __u32)
183 
184 #define RTTST_RTIOC_RTDM_PING_PRIMARY \
185  _IOR(RTIOC_TYPE_TESTING, 0x42, __u32)
186 
187 #define RTTST_RTIOC_RTDM_PING_SECONDARY \
188  _IOR(RTIOC_TYPE_TESTING, 0x43, __u32)
189 
190 #define RTTST_RTIOC_HEAP_CHECK \
191  _IOR(RTIOC_TYPE_TESTING, 0x44, struct rttst_heap_parms)
192 
193 #define RTTST_RTIOC_HEAP_STAT_COLLECT \
194  _IOR(RTIOC_TYPE_TESTING, 0x45, int)
195 
198 #endif /* !_RTDM_UAPI_TESTING_H */