blob: 8d1f757dd558a68d4bb28e5d0b9d6a6abf1f8710 [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 Axboe6aca9b32013-07-25 12:45:26 -060013 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 Axboe7eb36572010-03-08 13:58:49 +010015 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 Axboe7b504ed2014-02-11 14:19:38 -070030 void *opt_data;
Jens Axboe2363d8d2010-03-04 14:30:02 +010031
32 /*
33 * Called after parsing options, to prepare 'cmdline'
34 */
Jens Axboed4afedf2013-05-22 22:21:29 +020035 int (*prep_cmd)(void);
Jens Axboe2363d8d2010-03-04 14:30:02 +010036
37 /*
38 * The complete command line
39 */
40 const char **cmdline;
Jens Axboe15dc1932010-03-05 10:59:06 +010041
Jens Axboe7eb36572010-03-08 13:58:49 +010042 struct prof_io_ops *io_ops;
Jens Axboe79d16312010-03-04 12:43:20 +010043};
44
Jens Axboe07b32322010-03-05 09:48:44 +010045int register_profile(struct profile_ops *);
Jens Axboe79d16312010-03-04 12:43:20 +010046void unregister_profile(struct profile_ops *);
47int load_profile(const char *);
Jens Axboe15dc1932010-03-05 10:59:06 +010048struct profile_ops *find_profile(const char *);
49void profile_add_hooks(struct thread_data *);
Jens Axboe79d16312010-03-04 12:43:20 +010050
Jens Axboe58c55ba2010-03-09 12:20:08 +010051int profile_td_init(struct thread_data *);
52void profile_td_exit(struct thread_data *);
53
Jens Axboe79d16312010-03-04 12:43:20 +010054#endif