blob: 3c8d61f10bd0a582c3728b831b6cfc6f603fbb2e [file] [log] [blame]
Jens Axboe79d16312010-03-04 12:43:20 +01001#ifndef FIO_PROFILE_H
2#define FIO_PROFILE_H
3
4#include "flist.h"
5
Jens Axboe7eb36572010-03-08 13:58:49 +01006/*
7 * Functions for overriding internal fio io_u functions
8 */
9struct prof_io_ops {
Jens Axboe58c55ba2010-03-09 12:20:08 +010010 int (*td_init)(struct thread_data *);
11 void (*td_exit)(struct thread_data *);
12
Jens Axboe7eb36572010-03-08 13:58:49 +010013 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 *);
Jens Axboed4afedf2013-05-22 22:21:29 +020016
17 int (*io_u_lat)(struct thread_data *, uint64_t);
Jens Axboe7eb36572010-03-08 13:58:49 +010018};
19
Jens Axboe79d16312010-03-04 12:43:20 +010020struct profile_ops {
21 struct flist_head list;
22 char name[32];
Jens Axboee58eb862010-03-05 09:56:32 +010023 char desc[64];
Jens Axboe79d16312010-03-04 12:43:20 +010024 int flags;
25
Jens Axboe2363d8d2010-03-04 14:30:02 +010026 /*
27 * Profile specific options
28 */
Jens Axboee2de69d2010-03-04 14:05:48 +010029 struct fio_option *options;
Jens Axboe2363d8d2010-03-04 14:30:02 +010030
31 /*
32 * Called after parsing options, to prepare 'cmdline'
33 */
Jens Axboed4afedf2013-05-22 22:21:29 +020034 int (*prep_cmd)(void);
Jens Axboe2363d8d2010-03-04 14:30:02 +010035
36 /*
37 * The complete command line
38 */
39 const char **cmdline;
Jens Axboe15dc1932010-03-05 10:59:06 +010040
Jens Axboe7eb36572010-03-08 13:58:49 +010041 struct prof_io_ops *io_ops;
Jens Axboe79d16312010-03-04 12:43:20 +010042};
43
Jens Axboe07b32322010-03-05 09:48:44 +010044int register_profile(struct profile_ops *);
Jens Axboe79d16312010-03-04 12:43:20 +010045void unregister_profile(struct profile_ops *);
46int load_profile(const char *);
Jens Axboe15dc1932010-03-05 10:59:06 +010047struct profile_ops *find_profile(const char *);
48void profile_add_hooks(struct thread_data *);
Jens Axboe79d16312010-03-04 12:43:20 +010049
Jens Axboe58c55ba2010-03-09 12:20:08 +010050int profile_td_init(struct thread_data *);
51void profile_td_exit(struct thread_data *);
52
Jens Axboe79d16312010-03-04 12:43:20 +010053#endif