1 #ifndef FIO_VERIFY_STATE_H
2 #define FIO_VERIFY_STATE_H
7 struct thread_rand32_state {
11 struct thread_rand64_state {
15 struct thread_rand_state {
18 struct thread_rand32_state state32;
19 struct thread_rand64_state state64;
24 * For dumping current write state
31 struct thread_io_list {
37 struct thread_rand_state rand;
39 struct file_comp comps[0];
44 struct thread_io_list state[0];
47 #define VSTATE_HDR_VERSION 0x03
49 struct verify_state_hdr {
55 #define IO_LIST_ALL 0xffffffff
58 extern struct all_io_list *get_all_io_list(int, size_t *);
59 extern void __verify_save_state(struct all_io_list *, const char *);
60 extern void verify_save_state(int mask);
61 extern int verify_load_state(struct thread_data *, const char *);
62 extern void verify_free_state(struct thread_data *);
63 extern int verify_state_should_stop(struct thread_data *, struct io_u *);
64 extern void verify_assign_state(struct thread_data *, void *);
65 extern int verify_state_hdr(struct verify_state_hdr *, struct thread_io_list *);
67 static inline size_t __thread_io_list_sz(uint32_t depth, uint32_t nofiles)
69 return sizeof(struct thread_io_list) + depth * nofiles * sizeof(struct file_comp);
72 static inline size_t thread_io_list_sz(struct thread_io_list *s)
74 return __thread_io_list_sz(le32_to_cpu(s->depth), le32_to_cpu(s->nofiles));
77 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
79 return (void *) s + thread_io_list_sz(s);
82 static inline void verify_state_gen_name(char *out, size_t size,
83 const char *name, const char *prefix,
90 * Escape '/', just turn them into '.'
103 snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num);
104 out[size - 1] = '\0';