| 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 (*io_u_lat)(struct thread_data *, uint64_t); |
| 14 | }; |
| 15 | |
| 16 | struct profile_ops { |
| 17 | struct flist_head list; |
| 18 | char name[32]; |
| 19 | char desc[64]; |
| 20 | int flags; |
| 21 | |
| 22 | /* |
| 23 | * Profile specific options |
| 24 | */ |
| 25 | struct fio_option *options; |
| 26 | void *opt_data; |
| 27 | |
| 28 | /* |
| 29 | * Called after parsing options, to prepare 'cmdline' |
| 30 | */ |
| 31 | int (*prep_cmd)(void); |
| 32 | |
| 33 | /* |
| 34 | * The complete command line |
| 35 | */ |
| 36 | const char **cmdline; |
| 37 | |
| 38 | struct prof_io_ops *io_ops; |
| 39 | }; |
| 40 | |
| 41 | int register_profile(struct profile_ops *); |
| 42 | void unregister_profile(struct profile_ops *); |
| 43 | int load_profile(const char *); |
| 44 | struct profile_ops *find_profile(const char *); |
| 45 | void profile_add_hooks(struct thread_data *); |
| 46 | |
| 47 | int profile_td_init(struct thread_data *); |
| 48 | void profile_td_exit(struct thread_data *); |
| 49 | |
| 50 | #endif |