server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \
gettime-thread.c helpers.c json.c idletime.c td_error.c \
profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
- workqueue.c rate-submit.c
+ workqueue.c rate-submit.c optgroup.c
ifdef CONFIG_LIBHDFS
HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
*
*/
#include "../fio.h"
+#include "../optgroup.h"
struct cpu_options {
void *pad;
#include <fcntl.h>
#include "../fio.h"
+#include "../optgroup.h"
#ifndef EXT4_IOC_MOVE_EXT
#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
*/
#include "gfapi.h"
+#include "../optgroup.h"
struct fio_option gfapi_options[] = {
{
#include "../fio.h"
#include "../lib/pow2.h"
+#include "../optgroup.h"
static int fio_libaio_commit(struct thread_data *td);
#include <hdfs.h>
#include "../fio.h"
-
+#include "../optgroup.h"
#define CHUNCK_NAME_LENGTH_MAX 80
#define CHUNCK_CREATION_BUFFER_SIZE 65536
#include "../fio.h"
#include "../verify.h"
+#include "../optgroup.h"
struct netio_data {
int listenfd;
#include <rbd/librbd.h>
#include "../fio.h"
+#include "../optgroup.h"
struct fio_rbd_iou {
struct io_u *io_u;
#include "../fio.h"
#include "../hash.h"
+#include "../optgroup.h"
#include <rdma/rdma_cma.h>
#include <infiniband/arch.h>
#include "ghelpers.h"
#include "gerror.h"
#include "parse.h"
+#include "optgroup.h"
struct gopt {
GtkWidget *box;
GtkWidget *box, uint64_t groupmask)
{
uint64_t mask, group;
- struct opt_group *og;
+ const struct opt_group *og;
GtkWidget *frame, *hbox;
struct gopt_frame_widget *gfw;
for (i = 0; fio_options[i].name; i++) {
struct fio_option *o = &fio_options[i];
uint64_t mask = o->category;
- struct opt_group *og;
+ const struct opt_group *og;
while ((og = opt_group_from_mask(&mask)) != NULL) {
GtkWidget *vbox = gjv->vboxes[ffz64(~og->mask)];
return vbox;
}
-static GtkWidget *gopt_add_group_tab(GtkWidget *notebook, struct opt_group *og)
+static GtkWidget *gopt_add_group_tab(GtkWidget *notebook,
+ const struct opt_group *og)
{
return gopt_add_tab(notebook, og->name);
}
static void gopt_add_group_tabs(GtkWidget *notebook, struct gopt_job_view *gjv)
{
- struct opt_group *og;
+ const struct opt_group *og;
unsigned int i;
i = 0;
--- /dev/null
+#include <stdio.h>
+#include <inttypes.h>
+#include "optgroup.h"
+
+/*
+ * Option grouping
+ */
+static const struct opt_group fio_opt_groups[] = {
+ {
+ .name = "General",
+ .mask = FIO_OPT_C_GENERAL,
+ },
+ {
+ .name = "I/O",
+ .mask = FIO_OPT_C_IO,
+ },
+ {
+ .name = "File",
+ .mask = FIO_OPT_C_FILE,
+ },
+ {
+ .name = "Statistics",
+ .mask = FIO_OPT_C_STAT,
+ },
+ {
+ .name = "Logging",
+ .mask = FIO_OPT_C_LOG,
+ },
+ {
+ .name = "Profiles",
+ .mask = FIO_OPT_C_PROFILE,
+ },
+ {
+ .name = NULL,
+ },
+};
+
+static const struct opt_group fio_opt_cat_groups[] = {
+ {
+ .name = "Latency profiling",
+ .mask = FIO_OPT_G_LATPROF,
+ },
+ {
+ .name = "Rate",
+ .mask = FIO_OPT_G_RATE,
+ },
+ {
+ .name = "Zone",
+ .mask = FIO_OPT_G_ZONE,
+ },
+ {
+ .name = "Read/write mix",
+ .mask = FIO_OPT_G_RWMIX,
+ },
+ {
+ .name = "Verify",
+ .mask = FIO_OPT_G_VERIFY,
+ },
+ {
+ .name = "Trim",
+ .mask = FIO_OPT_G_TRIM,
+ },
+ {
+ .name = "I/O Logging",
+ .mask = FIO_OPT_G_IOLOG,
+ },
+ {
+ .name = "I/O Depth",
+ .mask = FIO_OPT_G_IO_DEPTH,
+ },
+ {
+ .name = "I/O Flow",
+ .mask = FIO_OPT_G_IO_FLOW,
+ },
+ {
+ .name = "Description",
+ .mask = FIO_OPT_G_DESC,
+ },
+ {
+ .name = "Filename",
+ .mask = FIO_OPT_G_FILENAME,
+ },
+ {
+ .name = "General I/O",
+ .mask = FIO_OPT_G_IO_BASIC,
+ },
+ {
+ .name = "Cgroups",
+ .mask = FIO_OPT_G_CGROUP,
+ },
+ {
+ .name = "Runtime",
+ .mask = FIO_OPT_G_RUNTIME,
+ },
+ {
+ .name = "Process",
+ .mask = FIO_OPT_G_PROCESS,
+ },
+ {
+ .name = "Job credentials / priority",
+ .mask = FIO_OPT_G_CRED,
+ },
+ {
+ .name = "Clock settings",
+ .mask = FIO_OPT_G_CLOCK,
+ },
+ {
+ .name = "I/O Type",
+ .mask = FIO_OPT_G_IO_TYPE,
+ },
+ {
+ .name = "I/O Thinktime",
+ .mask = FIO_OPT_G_THINKTIME,
+ },
+ {
+ .name = "Randomizations",
+ .mask = FIO_OPT_G_RANDOM,
+ },
+ {
+ .name = "I/O buffers",
+ .mask = FIO_OPT_G_IO_BUF,
+ },
+ {
+ .name = "Tiobench profile",
+ .mask = FIO_OPT_G_TIOBENCH,
+ },
+ {
+ .name = "MTD",
+ .mask = FIO_OPT_G_MTD,
+ },
+
+ {
+ .name = NULL,
+ }
+};
+
+static const struct opt_group *group_from_mask(const struct opt_group *ogs,
+ uint64_t *mask,
+ uint64_t inv_mask)
+{
+ int i;
+
+ if (*mask == inv_mask || !*mask)
+ return NULL;
+
+ for (i = 0; ogs[i].name; i++) {
+ const struct opt_group *og = &ogs[i];
+
+ if (*mask & og->mask) {
+ *mask &= ~(og->mask);
+ return og;
+ }
+ }
+
+ return NULL;
+}
+
+const struct opt_group *opt_group_from_mask(uint64_t *mask)
+{
+ return group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
+}
+
+const struct opt_group *opt_group_cat_from_mask(uint64_t *mask)
+{
+ return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
+}
--- /dev/null
+#ifndef FIO_OPT_GROUP_H
+#define FIO_OPT_GROUP_H
+
+struct opt_group {
+ const char *name;
+ uint64_t mask;
+};
+
+enum opt_category {
+ __FIO_OPT_C_GENERAL = 0,
+ __FIO_OPT_C_IO,
+ __FIO_OPT_C_FILE,
+ __FIO_OPT_C_STAT,
+ __FIO_OPT_C_LOG,
+ __FIO_OPT_C_PROFILE,
+ __FIO_OPT_C_ENGINE,
+ __FIO_OPT_C_NR,
+
+ FIO_OPT_C_GENERAL = (1ULL << __FIO_OPT_C_GENERAL),
+ FIO_OPT_C_IO = (1ULL << __FIO_OPT_C_IO),
+ FIO_OPT_C_FILE = (1ULL << __FIO_OPT_C_FILE),
+ FIO_OPT_C_STAT = (1ULL << __FIO_OPT_C_STAT),
+ FIO_OPT_C_LOG = (1ULL << __FIO_OPT_C_LOG),
+ FIO_OPT_C_PROFILE = (1ULL << __FIO_OPT_C_PROFILE),
+ FIO_OPT_C_ENGINE = (1ULL << __FIO_OPT_C_ENGINE),
+ FIO_OPT_C_INVALID = (1ULL << __FIO_OPT_C_NR),
+};
+
+enum opt_category_group {
+ __FIO_OPT_G_RATE = 0,
+ __FIO_OPT_G_ZONE,
+ __FIO_OPT_G_RWMIX,
+ __FIO_OPT_G_VERIFY,
+ __FIO_OPT_G_TRIM,
+ __FIO_OPT_G_IOLOG,
+ __FIO_OPT_G_IO_DEPTH,
+ __FIO_OPT_G_IO_FLOW,
+ __FIO_OPT_G_DESC,
+ __FIO_OPT_G_FILENAME,
+ __FIO_OPT_G_IO_BASIC,
+ __FIO_OPT_G_CGROUP,
+ __FIO_OPT_G_RUNTIME,
+ __FIO_OPT_G_PROCESS,
+ __FIO_OPT_G_CRED,
+ __FIO_OPT_G_CLOCK,
+ __FIO_OPT_G_IO_TYPE,
+ __FIO_OPT_G_THINKTIME,
+ __FIO_OPT_G_RANDOM,
+ __FIO_OPT_G_IO_BUF,
+ __FIO_OPT_G_TIOBENCH,
+ __FIO_OPT_G_ERR,
+ __FIO_OPT_G_E4DEFRAG,
+ __FIO_OPT_G_NETIO,
+ __FIO_OPT_G_RDMA,
+ __FIO_OPT_G_LIBAIO,
+ __FIO_OPT_G_ACT,
+ __FIO_OPT_G_LATPROF,
+ __FIO_OPT_G_RBD,
+ __FIO_OPT_G_GFAPI,
+ __FIO_OPT_G_MTD,
+ __FIO_OPT_G_HDFS,
+ __FIO_OPT_G_NR,
+
+ FIO_OPT_G_RATE = (1ULL << __FIO_OPT_G_RATE),
+ FIO_OPT_G_ZONE = (1ULL << __FIO_OPT_G_ZONE),
+ FIO_OPT_G_RWMIX = (1ULL << __FIO_OPT_G_RWMIX),
+ FIO_OPT_G_VERIFY = (1ULL << __FIO_OPT_G_VERIFY),
+ FIO_OPT_G_TRIM = (1ULL << __FIO_OPT_G_TRIM),
+ FIO_OPT_G_IOLOG = (1ULL << __FIO_OPT_G_IOLOG),
+ FIO_OPT_G_IO_DEPTH = (1ULL << __FIO_OPT_G_IO_DEPTH),
+ FIO_OPT_G_IO_FLOW = (1ULL << __FIO_OPT_G_IO_FLOW),
+ FIO_OPT_G_DESC = (1ULL << __FIO_OPT_G_DESC),
+ FIO_OPT_G_FILENAME = (1ULL << __FIO_OPT_G_FILENAME),
+ FIO_OPT_G_IO_BASIC = (1ULL << __FIO_OPT_G_IO_BASIC),
+ FIO_OPT_G_CGROUP = (1ULL << __FIO_OPT_G_CGROUP),
+ FIO_OPT_G_RUNTIME = (1ULL << __FIO_OPT_G_RUNTIME),
+ FIO_OPT_G_PROCESS = (1ULL << __FIO_OPT_G_PROCESS),
+ FIO_OPT_G_CRED = (1ULL << __FIO_OPT_G_CRED),
+ FIO_OPT_G_CLOCK = (1ULL << __FIO_OPT_G_CLOCK),
+ FIO_OPT_G_IO_TYPE = (1ULL << __FIO_OPT_G_IO_TYPE),
+ FIO_OPT_G_THINKTIME = (1ULL << __FIO_OPT_G_THINKTIME),
+ FIO_OPT_G_RANDOM = (1ULL << __FIO_OPT_G_RANDOM),
+ FIO_OPT_G_IO_BUF = (1ULL << __FIO_OPT_G_IO_BUF),
+ FIO_OPT_G_TIOBENCH = (1ULL << __FIO_OPT_G_TIOBENCH),
+ FIO_OPT_G_ERR = (1ULL << __FIO_OPT_G_ERR),
+ FIO_OPT_G_E4DEFRAG = (1ULL << __FIO_OPT_G_E4DEFRAG),
+ FIO_OPT_G_NETIO = (1ULL << __FIO_OPT_G_NETIO),
+ FIO_OPT_G_RDMA = (1ULL << __FIO_OPT_G_RDMA),
+ FIO_OPT_G_LIBAIO = (1ULL << __FIO_OPT_G_LIBAIO),
+ FIO_OPT_G_ACT = (1ULL << __FIO_OPT_G_ACT),
+ FIO_OPT_G_LATPROF = (1ULL << __FIO_OPT_G_LATPROF),
+ FIO_OPT_G_RBD = (1ULL << __FIO_OPT_G_RBD),
+ FIO_OPT_G_GFAPI = (1ULL << __FIO_OPT_G_GFAPI),
+ FIO_OPT_G_MTD = (1ULL << __FIO_OPT_G_MTD),
+ FIO_OPT_G_HDFS = (1ULL << __FIO_OPT_G_HDFS),
+ FIO_OPT_G_INVALID = (1ULL << __FIO_OPT_G_NR),
+};
+
+extern const struct opt_group *opt_group_from_mask(uint64_t *mask);
+extern const struct opt_group *opt_group_cat_from_mask(uint64_t *mask);
+
+#endif
#include "lib/fls.h"
#include "lib/pattern.h"
#include "options.h"
+#include "optgroup.h"
#include "crc/crc32c.h"
return 0;
}
-/*
- * Option grouping
- */
-static const struct opt_group fio_opt_groups[] = {
- {
- .name = "General",
- .mask = FIO_OPT_C_GENERAL,
- },
- {
- .name = "I/O",
- .mask = FIO_OPT_C_IO,
- },
- {
- .name = "File",
- .mask = FIO_OPT_C_FILE,
- },
- {
- .name = "Statistics",
- .mask = FIO_OPT_C_STAT,
- },
- {
- .name = "Logging",
- .mask = FIO_OPT_C_LOG,
- },
- {
- .name = "Profiles",
- .mask = FIO_OPT_C_PROFILE,
- },
- {
- .name = NULL,
- },
-};
-
-static const struct opt_group *group_from_mask(const struct opt_group *ogs,
- uint64_t *mask,
- uint64_t inv_mask)
-{
- int i;
-
- if (*mask == inv_mask || !*mask)
- return NULL;
-
- for (i = 0; ogs[i].name; i++) {
- const struct opt_group *og = &ogs[i];
-
- if (*mask & og->mask) {
- *mask &= ~(og->mask);
- return og;
- }
- }
-
- return NULL;
-}
-
-const struct opt_group *opt_group_from_mask(uint64_t *mask)
-{
- return group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
-}
-
-static const struct opt_group fio_opt_cat_groups[] = {
- {
- .name = "Latency profiling",
- .mask = FIO_OPT_G_LATPROF,
- },
- {
- .name = "Rate",
- .mask = FIO_OPT_G_RATE,
- },
- {
- .name = "Zone",
- .mask = FIO_OPT_G_ZONE,
- },
- {
- .name = "Read/write mix",
- .mask = FIO_OPT_G_RWMIX,
- },
- {
- .name = "Verify",
- .mask = FIO_OPT_G_VERIFY,
- },
- {
- .name = "Trim",
- .mask = FIO_OPT_G_TRIM,
- },
- {
- .name = "I/O Logging",
- .mask = FIO_OPT_G_IOLOG,
- },
- {
- .name = "I/O Depth",
- .mask = FIO_OPT_G_IO_DEPTH,
- },
- {
- .name = "I/O Flow",
- .mask = FIO_OPT_G_IO_FLOW,
- },
- {
- .name = "Description",
- .mask = FIO_OPT_G_DESC,
- },
- {
- .name = "Filename",
- .mask = FIO_OPT_G_FILENAME,
- },
- {
- .name = "General I/O",
- .mask = FIO_OPT_G_IO_BASIC,
- },
- {
- .name = "Cgroups",
- .mask = FIO_OPT_G_CGROUP,
- },
- {
- .name = "Runtime",
- .mask = FIO_OPT_G_RUNTIME,
- },
- {
- .name = "Process",
- .mask = FIO_OPT_G_PROCESS,
- },
- {
- .name = "Job credentials / priority",
- .mask = FIO_OPT_G_CRED,
- },
- {
- .name = "Clock settings",
- .mask = FIO_OPT_G_CLOCK,
- },
- {
- .name = "I/O Type",
- .mask = FIO_OPT_G_IO_TYPE,
- },
- {
- .name = "I/O Thinktime",
- .mask = FIO_OPT_G_THINKTIME,
- },
- {
- .name = "Randomizations",
- .mask = FIO_OPT_G_RANDOM,
- },
- {
- .name = "I/O buffers",
- .mask = FIO_OPT_G_IO_BUF,
- },
- {
- .name = "Tiobench profile",
- .mask = FIO_OPT_G_TIOBENCH,
- },
- {
- .name = "MTD",
- .mask = FIO_OPT_G_MTD,
- },
-
- {
- .name = NULL,
- }
-};
-
-const struct opt_group *opt_group_cat_from_mask(uint64_t *mask)
-{
- return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
-}
-
/*
* Map of job/command line options
*/
return NULL;
}
-struct opt_group {
- const char *name;
- uint64_t mask;
-};
-
-enum opt_category {
- __FIO_OPT_C_GENERAL = 0,
- __FIO_OPT_C_IO,
- __FIO_OPT_C_FILE,
- __FIO_OPT_C_STAT,
- __FIO_OPT_C_LOG,
- __FIO_OPT_C_PROFILE,
- __FIO_OPT_C_ENGINE,
- __FIO_OPT_C_NR,
-
- FIO_OPT_C_GENERAL = (1ULL << __FIO_OPT_C_GENERAL),
- FIO_OPT_C_IO = (1ULL << __FIO_OPT_C_IO),
- FIO_OPT_C_FILE = (1ULL << __FIO_OPT_C_FILE),
- FIO_OPT_C_STAT = (1ULL << __FIO_OPT_C_STAT),
- FIO_OPT_C_LOG = (1ULL << __FIO_OPT_C_LOG),
- FIO_OPT_C_PROFILE = (1ULL << __FIO_OPT_C_PROFILE),
- FIO_OPT_C_ENGINE = (1ULL << __FIO_OPT_C_ENGINE),
- FIO_OPT_C_INVALID = (1ULL << __FIO_OPT_C_NR),
-};
-
-enum opt_category_group {
- __FIO_OPT_G_RATE = 0,
- __FIO_OPT_G_ZONE,
- __FIO_OPT_G_RWMIX,
- __FIO_OPT_G_VERIFY,
- __FIO_OPT_G_TRIM,
- __FIO_OPT_G_IOLOG,
- __FIO_OPT_G_IO_DEPTH,
- __FIO_OPT_G_IO_FLOW,
- __FIO_OPT_G_DESC,
- __FIO_OPT_G_FILENAME,
- __FIO_OPT_G_IO_BASIC,
- __FIO_OPT_G_CGROUP,
- __FIO_OPT_G_RUNTIME,
- __FIO_OPT_G_PROCESS,
- __FIO_OPT_G_CRED,
- __FIO_OPT_G_CLOCK,
- __FIO_OPT_G_IO_TYPE,
- __FIO_OPT_G_THINKTIME,
- __FIO_OPT_G_RANDOM,
- __FIO_OPT_G_IO_BUF,
- __FIO_OPT_G_TIOBENCH,
- __FIO_OPT_G_ERR,
- __FIO_OPT_G_E4DEFRAG,
- __FIO_OPT_G_NETIO,
- __FIO_OPT_G_RDMA,
- __FIO_OPT_G_LIBAIO,
- __FIO_OPT_G_ACT,
- __FIO_OPT_G_LATPROF,
- __FIO_OPT_G_RBD,
- __FIO_OPT_G_GFAPI,
- __FIO_OPT_G_MTD,
- __FIO_OPT_G_HDFS,
- __FIO_OPT_G_NR,
-
- FIO_OPT_G_RATE = (1ULL << __FIO_OPT_G_RATE),
- FIO_OPT_G_ZONE = (1ULL << __FIO_OPT_G_ZONE),
- FIO_OPT_G_RWMIX = (1ULL << __FIO_OPT_G_RWMIX),
- FIO_OPT_G_VERIFY = (1ULL << __FIO_OPT_G_VERIFY),
- FIO_OPT_G_TRIM = (1ULL << __FIO_OPT_G_TRIM),
- FIO_OPT_G_IOLOG = (1ULL << __FIO_OPT_G_IOLOG),
- FIO_OPT_G_IO_DEPTH = (1ULL << __FIO_OPT_G_IO_DEPTH),
- FIO_OPT_G_IO_FLOW = (1ULL << __FIO_OPT_G_IO_FLOW),
- FIO_OPT_G_DESC = (1ULL << __FIO_OPT_G_DESC),
- FIO_OPT_G_FILENAME = (1ULL << __FIO_OPT_G_FILENAME),
- FIO_OPT_G_IO_BASIC = (1ULL << __FIO_OPT_G_IO_BASIC),
- FIO_OPT_G_CGROUP = (1ULL << __FIO_OPT_G_CGROUP),
- FIO_OPT_G_RUNTIME = (1ULL << __FIO_OPT_G_RUNTIME),
- FIO_OPT_G_PROCESS = (1ULL << __FIO_OPT_G_PROCESS),
- FIO_OPT_G_CRED = (1ULL << __FIO_OPT_G_CRED),
- FIO_OPT_G_CLOCK = (1ULL << __FIO_OPT_G_CLOCK),
- FIO_OPT_G_IO_TYPE = (1ULL << __FIO_OPT_G_IO_TYPE),
- FIO_OPT_G_THINKTIME = (1ULL << __FIO_OPT_G_THINKTIME),
- FIO_OPT_G_RANDOM = (1ULL << __FIO_OPT_G_RANDOM),
- FIO_OPT_G_IO_BUF = (1ULL << __FIO_OPT_G_IO_BUF),
- FIO_OPT_G_TIOBENCH = (1ULL << __FIO_OPT_G_TIOBENCH),
- FIO_OPT_G_ERR = (1ULL << __FIO_OPT_G_ERR),
- FIO_OPT_G_E4DEFRAG = (1ULL << __FIO_OPT_G_E4DEFRAG),
- FIO_OPT_G_NETIO = (1ULL << __FIO_OPT_G_NETIO),
- FIO_OPT_G_RDMA = (1ULL << __FIO_OPT_G_RDMA),
- FIO_OPT_G_LIBAIO = (1ULL << __FIO_OPT_G_LIBAIO),
- FIO_OPT_G_ACT = (1ULL << __FIO_OPT_G_ACT),
- FIO_OPT_G_LATPROF = (1ULL << __FIO_OPT_G_LATPROF),
- FIO_OPT_G_RBD = (1ULL << __FIO_OPT_G_RBD),
- FIO_OPT_G_GFAPI = (1ULL << __FIO_OPT_G_GFAPI),
- FIO_OPT_G_MTD = (1ULL << __FIO_OPT_G_MTD),
- FIO_OPT_G_HDFS = (1ULL << __FIO_OPT_G_HDFS),
- FIO_OPT_G_INVALID = (1ULL << __FIO_OPT_G_NR),
-};
-
-extern const struct opt_group *opt_group_from_mask(uint64_t *mask);
-extern const struct opt_group *opt_group_cat_from_mask(uint64_t *mask);
extern struct fio_option *fio_option_find(const char *name);
extern unsigned int fio_get_kb_base(void *);
#include "parse.h"
#include "debug.h"
#include "options.h"
+#include "optgroup.h"
#include "minmax.h"
#include "lib/ieee754.h"
#include "lib/pow2.h"
#include "../fio.h"
#include "../profile.h"
#include "../parse.h"
+#include "../optgroup.h"
/*
* 1x loads
#include "../fio.h"
#include "../profile.h"
#include "../parse.h"
+#include "../optgroup.h"
static unsigned long long size;
static unsigned int loops = 1;