Make profile io op overrides a dedicated structure
[fio.git] / profile.h
... / ...
CommitLineData
1#ifndef FIO_PROFILE_H
2#define FIO_PROFILE_H
3
4#include "flist.h"
5
6/*
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
15struct profile_ops {
16 struct flist_head list;
17 char name[32];
18 char desc[64];
19 int flags;
20
21 /*
22 * Profile specific options
23 */
24 struct fio_option *options;
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;
35
36 struct prof_io_ops *io_ops;
37};
38
39int register_profile(struct profile_ops *);
40void unregister_profile(struct profile_ops *);
41int load_profile(const char *);
42struct profile_ops *find_profile(const char *);
43void profile_add_hooks(struct thread_data *);
44
45#endif