1 #ifndef FIO_VERIFY_STATE_H
2 #define FIO_VERIFY_STATE_H
6 struct thread_rand32_state {
10 struct thread_rand64_state {
14 struct thread_rand_state {
17 struct thread_rand32_state state32;
18 struct thread_rand64_state state64;
23 * For dumping current write state
25 struct thread_io_list {
30 struct thread_rand_state rand;
35 struct thread_io_list_v1 {
40 struct thread_rand32_state rand;
47 struct thread_io_list state[0];
50 #define VSTATE_HDR_VERSION_V1 0x01
51 #define VSTATE_HDR_VERSION 0x02
53 struct verify_state_hdr {
59 #define IO_LIST_ALL 0xffffffff
62 extern struct all_io_list *get_all_io_list(int, size_t *);
63 extern void __verify_save_state(struct all_io_list *, const char *);
64 extern void verify_save_state(int mask);
65 extern int verify_load_state(struct thread_data *, const char *);
66 extern void verify_free_state(struct thread_data *);
67 extern int verify_state_should_stop(struct thread_data *, struct io_u *);
68 extern void verify_convert_assign_state(struct thread_data *, void *, int);
69 extern int verify_state_hdr(struct verify_state_hdr *, struct thread_io_list *,
72 static inline size_t __thread_io_list_sz(uint64_t depth)
74 return sizeof(struct thread_io_list) + depth * sizeof(uint64_t);
77 static inline size_t thread_io_list_sz(struct thread_io_list *s)
79 return __thread_io_list_sz(le64_to_cpu(s->depth));
82 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
84 return (void *) s + thread_io_list_sz(s);
87 static inline void verify_state_gen_name(char *out, size_t size,
88 const char *name, const char *prefix,
91 snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);