io_u_queue: convert rings to bool
[fio.git] / profile.h
1 #ifndef FIO_PROFILE_H
2 #define FIO_PROFILE_H
3
4 #include "flist.h"
5
6 /*
7  * Functions for overriding internal fio io_u functions
8  */
9 struct prof_io_ops {
10         int (*td_init)(struct thread_data *);
11         void (*td_exit)(struct thread_data *);
12
13         int (*fill_io_u_off)(struct thread_data *, struct io_u *, unsigned int *);
14         int (*fill_io_u_size)(struct thread_data *, struct io_u *, unsigned int);
15         struct fio_file *(*get_next_file)(struct thread_data *);
16
17         int (*io_u_lat)(struct thread_data *, uint64_t);
18 };
19
20 struct profile_ops {
21         struct flist_head list;
22         char name[32];
23         char desc[64];
24         int flags;
25
26         /*
27          * Profile specific options
28          */
29         struct fio_option *options;
30         void *opt_data;
31
32         /*
33          * Called after parsing options, to prepare 'cmdline'
34          */
35         int (*prep_cmd)(void);
36
37         /*
38          * The complete command line
39          */
40         const char **cmdline;
41
42         struct prof_io_ops *io_ops;
43 };
44
45 int register_profile(struct profile_ops *);
46 void unregister_profile(struct profile_ops *);
47 int load_profile(const char *);
48 struct profile_ops *find_profile(const char *);
49 void profile_add_hooks(struct thread_data *);
50
51 int profile_td_init(struct thread_data *);
52 void profile_td_exit(struct thread_data *);
53
54 #endif