Allow profiles to override internal io_u functions
[fio.git] / profile.h
1 #ifndef FIO_PROFILE_H
2 #define FIO_PROFILE_H
3
4 #include "flist.h"
5
6 struct profile_ops {
7         struct flist_head list;
8         char name[32];
9         char desc[64];
10         int flags;
11
12         /*
13          * Profile specific options
14          */
15         struct fio_option *options;
16
17         /*
18          * Called after parsing options, to prepare 'cmdline'
19          */
20         void (*prep_cmd)(void);
21
22         /*
23          * The complete command line
24          */
25         const char **cmdline;
26
27         /*
28          * Functions for overriding internal fio io_u functions
29          */
30         int (*fill_io_u_off)(struct thread_data *, struct io_u *);
31         int (*fill_io_u_size)(struct thread_data *, struct io_u *);
32 };
33
34 int register_profile(struct profile_ops *);
35 void unregister_profile(struct profile_ops *);
36 int load_profile(const char *);
37 struct profile_ops *find_profile(const char *);
38 void profile_add_hooks(struct thread_data *);
39
40 #endif