summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7eb3657)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Can be overloaded by profiles
*/
struct prof_io_ops prof_io_ops;
* Can be overloaded by profiles
*/
struct prof_io_ops prof_io_ops;
{
if (td == &def_thread)
return;
{
if (td == &def_thread)
return;
if (td->error)
log_info("fio: %s\n", td->verror);
if (td->error)
log_info("fio: %s\n", td->verror);
+ if (profile_td_init(td))
+ return 1;
+
engine = get_engine_name(td->o.ioengine);
td->io_ops = load_ioengine(td, engine);
if (!td->io_ops) {
engine = get_engine_name(td->o.ioengine);
td->io_ops = load_ioengine(td, engine);
if (!td->io_ops) {
if (ops->io_ops)
td->prof_io_ops = *ops->io_ops;
}
if (ops->io_ops)
td->prof_io_ops = *ops->io_ops;
}
+
+int profile_td_init(struct thread_data *td)
+{
+ struct prof_io_ops *ops = &td->prof_io_ops;
+
+ if (ops->td_init)
+ return ops->td_init(td);
+
+ return 0;
+}
+
+void profile_td_exit(struct thread_data *td)
+{
+ struct prof_io_ops *ops = &td->prof_io_ops;
+
+ if (ops->td_exit)
+ ops->td_exit(td);
+}
* Functions for overriding internal fio io_u functions
*/
struct prof_io_ops {
* Functions for overriding internal fio io_u functions
*/
struct prof_io_ops {
+ int (*td_init)(struct thread_data *);
+ void (*td_exit)(struct thread_data *);
+
int (*fill_io_u_off)(struct thread_data *, struct io_u *);
int (*fill_io_u_size)(struct thread_data *, struct io_u *);
struct fio_file *(*get_next_file)(struct thread_data *);
int (*fill_io_u_off)(struct thread_data *, struct io_u *);
int (*fill_io_u_size)(struct thread_data *, struct io_u *);
struct fio_file *(*get_next_file)(struct thread_data *);
struct profile_ops *find_profile(const char *);
void profile_add_hooks(struct thread_data *);
struct profile_ops *find_profile(const char *);
void profile_add_hooks(struct thread_data *);
+int profile_td_init(struct thread_data *);
+void profile_td_exit(struct thread_data *);
+