Lines Matching refs:ft
23 void init_ffsb_thread(ffsb_thread_t * ft, struct ffsb_tg *tg, unsigned bufsize, in init_ffsb_thread() argument
26 memset(ft, 0, sizeof(ffsb_thread_t)); in init_ffsb_thread()
28 ft->tg = tg; in init_ffsb_thread()
29 ft->tg_num = tg_num; in init_ffsb_thread()
30 ft->thread_num = thread_num; in init_ffsb_thread()
33 ft_alter_bufsize(ft, bufsize); in init_ffsb_thread()
35 init_random(&ft->rd, MAX_RANDBUF_SIZE); in init_ffsb_thread()
38 void destroy_ffsb_thread(ffsb_thread_t * ft) in destroy_ffsb_thread() argument
40 free(ft->mallocbuf); in destroy_ffsb_thread()
41 destroy_random(&ft->rd); in destroy_ffsb_thread()
42 if (ft->fsd.config) in destroy_ffsb_thread()
43 ffsb_statsd_destroy(&ft->fsd); in destroy_ffsb_thread()
46 void ft_set_statsc(ffsb_thread_t * ft, ffsb_statsc_t * fsc) in ft_set_statsc() argument
48 ffsb_statsd_init(&ft->fsd, fsc); in ft_set_statsc()
53 ffsb_thread_t *ft = (ffsb_thread_t *) data; in ft_run() local
55 unsigned wait_time = tg_get_waittime(ft->tg); in ft_run()
56 int stopval = tg_get_stopval(ft->tg); in ft_run()
58 ffsb_barrier_wait(tg_get_start_barrier(ft->tg)); in ft_run()
60 while (tg_get_flagval(ft->tg) != stopval) { in ft_run()
61 tg_get_op(ft->tg, &ft->rd, ¶ms); in ft_run()
62 do_op(ft, params.fs, params.opnum); in ft_run()
68 void ft_alter_bufsize(ffsb_thread_t * ft, unsigned bufsize) in ft_alter_bufsize() argument
70 if (ft->mallocbuf != NULL) in ft_alter_bufsize()
71 free(ft->mallocbuf); in ft_alter_bufsize()
72 ft->mallocbuf = ffsb_malloc(bufsize + 4096); in ft_alter_bufsize()
73 ft->alignedbuf = ffsb_align_4k(ft->mallocbuf + (4096 - 1)); in ft_alter_bufsize()
76 char *ft_getbuf(ffsb_thread_t * ft) in ft_getbuf() argument
78 return ft->alignedbuf; in ft_getbuf()
81 int ft_get_read_random(ffsb_thread_t * ft) in ft_get_read_random() argument
83 return tg_get_read_random(ft->tg); in ft_get_read_random()
86 uint32_t ft_get_read_size(ffsb_thread_t * ft) in ft_get_read_size() argument
88 return tg_get_read_size(ft->tg); in ft_get_read_size()
91 uint32_t ft_get_read_blocksize(ffsb_thread_t * ft) in ft_get_read_blocksize() argument
93 return tg_get_read_blocksize(ft->tg); in ft_get_read_blocksize()
96 int ft_get_write_random(ffsb_thread_t * ft) in ft_get_write_random() argument
98 return tg_get_write_random(ft->tg); in ft_get_write_random()
101 uint32_t ft_get_write_size(ffsb_thread_t * ft) in ft_get_write_size() argument
103 return tg_get_write_size(ft->tg); in ft_get_write_size()
106 uint32_t ft_get_write_blocksize(ffsb_thread_t * ft) in ft_get_write_blocksize() argument
108 return tg_get_write_blocksize(ft->tg); in ft_get_write_blocksize()
111 int ft_get_fsync_file(ffsb_thread_t * ft) in ft_get_fsync_file() argument
113 return tg_get_fsync_file(ft->tg); in ft_get_fsync_file()
116 randdata_t *ft_get_randdata(ffsb_thread_t * ft) in ft_get_randdata() argument
118 return &ft->rd; in ft_get_randdata()
121 void ft_incr_op(ffsb_thread_t * ft, unsigned opnum, unsigned increment, in ft_incr_op() argument
124 ft->results.ops[opnum] += increment; in ft_incr_op()
125 ft->results.op_weight[opnum]++; in ft_incr_op()
126 ft->results.bytes[opnum] += bytes; in ft_incr_op()
129 void ft_add_readbytes(ffsb_thread_t * ft, uint32_t bytes) in ft_add_readbytes() argument
131 ft->results.read_bytes += bytes; in ft_add_readbytes()
134 void ft_add_writebytes(ffsb_thread_t * ft, uint32_t bytes) in ft_add_writebytes() argument
136 ft->results.write_bytes += bytes; in ft_add_writebytes()
139 ffsb_op_results_t *ft_get_results(ffsb_thread_t * ft) in ft_get_results() argument
141 return &ft->results; in ft_get_results()
144 int ft_get_read_skip(ffsb_thread_t * ft) in ft_get_read_skip() argument
146 return tg_get_read_skip(ft->tg); in ft_get_read_skip()
149 uint32_t ft_get_read_skipsize(ffsb_thread_t * ft) in ft_get_read_skipsize() argument
151 return tg_get_read_skipsize(ft->tg); in ft_get_read_skipsize()
154 int ft_needs_stats(ffsb_thread_t * ft, syscall_t sys) in ft_needs_stats() argument
157 if (ft && ft->fsd.config && !fsc_ignore_sys(ft->fsd.config, sys)) in ft_needs_stats()
162 void ft_add_stat(ffsb_thread_t * ft, syscall_t sys, uint32_t val) in ft_add_stat() argument
164 if (ft) in ft_add_stat()
165 ffsb_add_data(&ft->fsd, sys, val); in ft_add_stat()
168 ffsb_statsd_t *ft_get_stats_data(ffsb_thread_t * ft) in ft_get_stats_data() argument
170 return &ft->fsd; in ft_get_stats_data()