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 | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 13 | int (*fill_io_u_off)(struct thread_data *, struct io_u *); |
| 14 | int (*fill_io_u_size)(struct thread_data *, struct io_u *); |
| 15 | struct fio_file *(*get_next_file)(struct thread_data *); |
| 16 | }; |
| 17 | |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 18 | struct profile_ops { |
| 19 | struct flist_head list; |
| 20 | char name[32]; |
Jens Axboe | e58eb86 | 2010-03-05 09:56:32 +0100 | [diff] [blame] | 21 | char desc[64]; |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 22 | int flags; |
| 23 | |
Jens Axboe | 2363d8d | 2010-03-04 14:30:02 +0100 | [diff] [blame] | 24 | /* |
| 25 | * Profile specific options |
| 26 | */ |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 27 | struct fio_option *options; |
Jens Axboe | 2363d8d | 2010-03-04 14:30:02 +0100 | [diff] [blame] | 28 | |
| 29 | /* |
| 30 | * Called after parsing options, to prepare 'cmdline' |
| 31 | */ |
| 32 | void (*prep_cmd)(void); |
| 33 | |
| 34 | /* |
| 35 | * The complete command line |
| 36 | */ |
| 37 | const char **cmdline; |
Jens Axboe | 15dc193 | 2010-03-05 10:59:06 +0100 | [diff] [blame] | 38 | |
Jens Axboe | 7eb3657 | 2010-03-08 13:58:49 +0100 | [diff] [blame] | 39 | struct prof_io_ops *io_ops; |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 40 | }; |
| 41 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 42 | int register_profile(struct profile_ops *); |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 43 | void unregister_profile(struct profile_ops *); |
| 44 | int load_profile(const char *); |
Jens Axboe | 15dc193 | 2010-03-05 10:59:06 +0100 | [diff] [blame] | 45 | struct profile_ops *find_profile(const char *); |
| 46 | void profile_add_hooks(struct thread_data *); |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 47 | |
Jens Axboe | 58c55ba | 2010-03-09 12:20:08 +0100 | [diff] [blame] | 48 | int profile_td_init(struct thread_data *); |
| 49 | void profile_td_exit(struct thread_data *); |
| 50 | |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 51 | #endif |