Fio 3.5
[fio.git] / options.h
... / ...
CommitLineData
1#ifndef FIO_OPTION_H
2#define FIO_OPTION_H
3
4#define FIO_MAX_OPTS 512
5
6#include <string.h>
7#include <inttypes.h>
8#include "parse.h"
9#include "flist.h"
10#include "lib/types.h"
11
12int add_option(struct fio_option *);
13void invalidate_profile_options(const char *);
14extern char *exec_profile;
15
16void add_opt_posval(const char *, const char *, const char *);
17void del_opt_posval(const char *, const char *);
18struct thread_data;
19void fio_options_free(struct thread_data *);
20int set_name_idx(char *, size_t, char *, int, bool);
21
22extern char client_sockaddr_str[]; /* used with --client option */
23
24extern struct fio_option fio_options[FIO_MAX_OPTS];
25
26extern bool __fio_option_is_set(struct thread_options *, unsigned int off);
27
28#define fio_option_is_set(__td, name) \
29({ \
30 const unsigned int off = offsetof(struct thread_options, name); \
31 bool __r = __fio_option_is_set((__td), off); \
32 __r; \
33})
34
35extern void fio_option_mark_set(struct thread_options *, struct fio_option *);
36
37static inline bool o_match(struct fio_option *o, const char *opt)
38{
39 if (!strcmp(o->name, opt))
40 return true;
41 else if (o->alias && !strcmp(o->alias, opt))
42 return true;
43
44 return false;
45}
46
47extern struct fio_option *find_option(struct fio_option *, const char *);
48extern struct fio_option *fio_option_find(const char *);
49extern unsigned int fio_get_kb_base(void *);
50
51#endif