4 #include "compiler/compiler.h"
9 static const struct opt_group fio_opt_groups[] = {
12 .mask = FIO_OPT_C_GENERAL,
20 .mask = FIO_OPT_C_FILE,
24 .mask = FIO_OPT_C_STAT,
28 .mask = FIO_OPT_C_LOG,
32 .mask = FIO_OPT_C_PROFILE,
35 .name = "I/O engines",
36 .mask = FIO_OPT_C_ENGINE,
43 static const struct opt_group fio_opt_cat_groups[] = {
46 .mask = FIO_OPT_G_RATE,
50 .mask = FIO_OPT_G_ZONE,
53 .name = "Read/write mix",
54 .mask = FIO_OPT_G_RWMIX,
58 .mask = FIO_OPT_G_VERIFY,
62 .mask = FIO_OPT_G_TRIM,
65 .name = "I/O Logging",
66 .mask = FIO_OPT_G_IOLOG,
70 .mask = FIO_OPT_G_IO_DEPTH,
74 .mask = FIO_OPT_G_IO_FLOW,
77 .name = "Description",
78 .mask = FIO_OPT_G_DESC,
82 .mask = FIO_OPT_G_FILENAME,
85 .name = "General I/O",
86 .mask = FIO_OPT_G_IO_BASIC,
90 .mask = FIO_OPT_G_CGROUP,
94 .mask = FIO_OPT_G_RUNTIME,
98 .mask = FIO_OPT_G_PROCESS,
101 .name = "Job credentials / priority",
102 .mask = FIO_OPT_G_CRED,
105 .name = "Clock settings",
106 .mask = FIO_OPT_G_CLOCK,
110 .mask = FIO_OPT_G_IO_TYPE,
113 .name = "I/O Thinktime",
114 .mask = FIO_OPT_G_THINKTIME,
117 .name = "Randomizations",
118 .mask = FIO_OPT_G_RANDOM,
121 .name = "I/O buffers",
122 .mask = FIO_OPT_G_IO_BUF,
125 .name = "Tiobench profile",
126 .mask = FIO_OPT_G_TIOBENCH,
129 .name = "Error handling",
130 .mask = FIO_OPT_G_ERR,
133 .name = "Ext4 defrag I/O engine", /* e4defrag */
134 .mask = FIO_OPT_G_E4DEFRAG,
137 .name = "Network I/O engine", /* net */
138 .mask = FIO_OPT_G_NETIO,
141 .name = "RDMA I/O engine", /* rdma */
142 .mask = FIO_OPT_G_RDMA,
145 .name = "librpma I/O engines", /* librpma_apm && librpma_gpspm */
146 .mask = FIO_OPT_G_LIBRPMA,
149 .name = "libaio I/O engine", /* libaio */
150 .mask = FIO_OPT_G_LIBAIO,
153 .name = "ACT Aerospike like benchmark profile",
154 .mask = FIO_OPT_G_ACT,
157 .name = "Latency profiling",
158 .mask = FIO_OPT_G_LATPROF,
161 .name = "RBD I/O engine", /* rbd */
162 .mask = FIO_OPT_G_RBD,
165 .name = "GlusterFS I/O engine", /* gfapi,gfapi_async */
166 .mask = FIO_OPT_G_GFAPI,
169 .name = "MTD I/O engine", /* mtd */
170 .mask = FIO_OPT_G_MTD,
173 .name = "libhdfs I/O engine", /* libhdfs */
174 .mask = FIO_OPT_G_HDFS,
177 .name = "NBD I/O engine", /* NBD */
178 .mask = FIO_OPT_G_NBD,
181 .name = "libcufile I/O engine", /* libcufile */
182 .mask = FIO_OPT_G_LIBCUFILE,
185 .name = "DAOS File System (dfs) I/O engine", /* dfs */
186 .mask = FIO_OPT_G_DFS,
189 .name = "NFS I/O engine", /* nfs */
190 .mask = FIO_OPT_G_NFS,
197 static const struct opt_group *group_from_mask(const struct opt_group *ogs,
203 if (*mask == inv_mask || !*mask)
206 for (i = 0; ogs[i].name; i++) {
207 const struct opt_group *og = &ogs[i];
209 if (*mask & og->mask) {
210 *mask &= ~(og->mask);
218 const struct opt_group *opt_group_from_mask(uint64_t *mask)
220 return group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
223 const struct opt_group *opt_group_cat_from_mask(uint64_t *mask)
225 compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t),
228 return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);