Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 1 | #ifndef FIO_PROFILE_H |
| 2 | #define FIO_PROFILE_H |
| 3 | |
| 4 | #include "flist.h" |
| 5 | |
Jens Axboe | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 6 | /* |
| 7 | * Functions for overriding internal fio io_u functions |
| 8 | */ |
| 9 | struct prof_io_ops { |
Jens Axboe | 58c55ba | 2010-03-09 12:20:08 +0100 | [diff] [blame] | 10 | int (*td_init)(struct thread_data *); |
| 11 | void (*td_exit)(struct thread_data *); |
| 12 | |
Jens Axboe | 6aca9b3 | 2013-07-25 12:45:26 -0600 | [diff] [blame] | 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); |
Jens Axboe | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 15 | struct fio_file *(*get_next_file)(struct thread_data *); |
Jens Axboe | d4afedf | 2013-05-22 22:21:29 +0200 | [diff] [blame] | 16 | |
| 17 | int (*io_u_lat)(struct thread_data *, uint64_t); |
Jens Axboe | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 18 | }; |
| 19 | |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 20 | struct profile_ops { |
| 21 | struct flist_head list; |
| 22 | char name[32]; |
Jens Axboe | e58eb86 | 2010-03-05 09:56:32 +0100 | [diff] [blame] | 23 | char desc[64]; |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 24 | int flags; |
| 25 | |
Jens Axboe | 2363d8d | 2010-03-04 14:30:02 +0100 | [diff] [blame] | 26 | /* |
| 27 | * Profile specific options |
| 28 | */ |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 29 | struct fio_option *options; |
Jens Axboe | 7b504ed | 2014-02-11 14:19:38 -0700 | [diff] [blame] | 30 | void *opt_data; |
Jens Axboe | 2363d8d | 2010-03-04 14:30:02 +0100 | [diff] [blame] | 31 | |
| 32 | /* |
| 33 | * Called after parsing options, to prepare 'cmdline' |
| 34 | */ |
Jens Axboe | d4afedf | 2013-05-22 22:21:29 +0200 | [diff] [blame] | 35 | int (*prep_cmd)(void); |
Jens Axboe | 2363d8d | 2010-03-04 14:30:02 +0100 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * The complete command line |
| 39 | */ |
| 40 | const char **cmdline; |
Jens Axboe | 15dc193 | 2010-03-05 10:59:06 +0100 | [diff] [blame] | 41 | |
Jens Axboe | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 42 | struct prof_io_ops *io_ops; |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 43 | }; |
| 44 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 45 | int register_profile(struct profile_ops *); |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 46 | void unregister_profile(struct profile_ops *); |
| 47 | int load_profile(const char *); |
Jens Axboe | 15dc193 | 2010-03-05 10:59:06 +0100 | [diff] [blame] | 48 | struct profile_ops *find_profile(const char *); |
| 49 | void profile_add_hooks(struct thread_data *); |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 50 | |
Jens Axboe | 58c55ba | 2010-03-09 12:20:08 +0100 | [diff] [blame] | 51 | int profile_td_init(struct thread_data *); |
| 52 | void profile_td_exit(struct thread_data *); |
| 53 | |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 54 | #endif |