blob: a54f072455928713f9b6149ca13b461ae028be67 [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 {
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 Axboe79d16312010-03-04 12:43:20 +010015struct profile_ops {
16 struct flist_head list;
17 char name[32];
Jens Axboee58eb862010-03-05 09:56:32 +010018 char desc[64];
Jens Axboe79d16312010-03-04 12:43:20 +010019 int flags;
20
Jens Axboe2363d8d2010-03-04 14:30:02 +010021 /*
22 * Profile specific options
23 */
Jens Axboee2de69d2010-03-04 14:05:48 +010024 struct fio_option *options;
Jens Axboe2363d8d2010-03-04 14:30:02 +010025
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 Axboe15dc1932010-03-05 10:59:06 +010035
Jens Axboe7eb36572010-03-08 13:58:49 +010036 struct prof_io_ops *io_ops;
Jens Axboe79d16312010-03-04 12:43:20 +010037};
38
Jens Axboe07b32322010-03-05 09:48:44 +010039int register_profile(struct profile_ops *);
Jens Axboe79d16312010-03-04 12:43:20 +010040void unregister_profile(struct profile_ops *);
41int load_profile(const char *);
Jens Axboe15dc1932010-03-05 10:59:06 +010042struct profile_ops *find_profile(const char *);
43void profile_add_hooks(struct thread_data *);
Jens Axboe79d16312010-03-04 12:43:20 +010044
45#endif