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