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