blob: 673c5c457096fec566d08e720fa81788075dbb43 [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 *);
16};
17
Jens Axboe79d16312010-03-04 12:43:20 +010018struct profile_ops {
19 struct flist_head list;
20 char name[32];
Jens Axboee58eb862010-03-05 09:56:32 +010021 char desc[64];
Jens Axboe79d16312010-03-04 12:43:20 +010022 int flags;
23
Jens Axboe2363d8d2010-03-04 14:30:02 +010024 /*
25 * Profile specific options
26 */
Jens Axboee2de69d2010-03-04 14:05:48 +010027 struct fio_option *options;
Jens Axboe2363d8d2010-03-04 14:30:02 +010028
29 /*
30 * Called after parsing options, to prepare 'cmdline'
31 */
32 void (*prep_cmd)(void);
33
34 /*
35 * The complete command line
36 */
37 const char **cmdline;
Jens Axboe15dc1932010-03-05 10:59:06 +010038
Jens Axboe7eb36572010-03-08 13:58:49 +010039 struct prof_io_ops *io_ops;
Jens Axboe79d16312010-03-04 12:43:20 +010040};
41
Jens Axboe07b32322010-03-05 09:48:44 +010042int register_profile(struct profile_ops *);
Jens Axboe79d16312010-03-04 12:43:20 +010043void unregister_profile(struct profile_ops *);
44int load_profile(const char *);
Jens Axboe15dc1932010-03-05 10:59:06 +010045struct profile_ops *find_profile(const char *);
46void profile_add_hooks(struct thread_data *);
Jens Axboe79d16312010-03-04 12:43:20 +010047
Jens Axboe58c55ba2010-03-09 12:20:08 +010048int profile_td_init(struct thread_data *);
49void profile_td_exit(struct thread_data *);
50
Jens Axboe79d16312010-03-04 12:43:20 +010051#endif