86 #include <sys/types.h> 105 int block_count,
int idx_op);
142 res = (val_h << 32) | val_l;
158 op_context =
op->op_datum;
159 if (op_context !=
NULL) {
179 op_context =
op->op_datum;
182 if (op_context !=
NULL) {
221 for (
i = 0;
i < nr_ops;
i++) {
239 for (
i = 0;
i < nr_ops;
i++)
252 uint64_t bitmap_index;
253 uint64_t nr_segments;
254 uint64_t start_offset;
255 uint64_t op_start_offset = 0;
264 index_vec =
m0_alloc(
sizeof *index_vec);
278 nr_segments = io_size/cwi->
cwi_bs + 1;
284 op_start_offset = op_index * cwi->
cwi_bs *
315 index_vec->iv_index[
i] = start_offset +
offset;
317 index_vec->iv_index[
i] =
offset;
319 index_vec->iv_vec.v_count[
i] = cwi->
cwi_bs;
330 if (index_vec !=
NULL)
469 rc = spec_op(cwi, cti, op_ctx,
obj, idx, obj_idx,
i);
517 op_code ==
CR_OPEN ?
"Opening" :
"Deleting");
532 spec_op(cwi, cti, op_ctx, &cti->
cti_objs[
i], idx, 0,
i);
579 op_code ==
CR_OPEN ?
"Open" :
"Deletion");
604 op_code ==
CR_WRITE ?
"Writing" :
"Reading");
630 op_code ==
CR_WRITE ?
"Write" :
"Read");
749 memset(mthread, 0,
sizeof(
struct m0_thread));
799 for (
i = 0;
i < nr_objs;
i++) {
803 ids[
i].u_hi =
ids[
i].u_hi & ~(0xFFUL << 56);
812 M0_DEFAULT_BUF_SHIFT);
814 M0_DEFAULT_BUF_SHIFT);
852 M0_DEFAULT_BUF_SHIFT) ?:
856 M0_DEFAULT_BUF_SHIFT);
958 for (
i = 0;
i < nr_tasks;
i++) {
967 (*cti)->cti_task_idx =
i;
980 for (
i = 0;
i < nr_tasks;
i++) {
struct m0_task_io * coc_task
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_bitmap_init(struct m0_bitmap *map, size_t nr)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
int cr_buffer_read(char *buffer, const char *filename, uint64_t size)
uint64_t cwi_ops_done[CR_OPS_NR]
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
bool cr_time_not_expired(struct workload *w)
M0_INTERNAL void m0_bitmap_fini(struct m0_bitmap *map)
struct m0_semaphore cti_max_ops_sem
int cr_op_io(struct m0_workload_io *cwi, struct m0_task_io *cti, enum m0_operations op_code)
void list_index_return(struct workload *w)
M0_INTERNAL bool entity_id_is_valid(const struct m0_uint128 *id)
const m0_time_t M0_TIME_NEVER
void m0_op_fini(struct m0_op *op)
void cr_cti_report(struct m0_task_io *cti, enum m0_operations op_code)
void m0_op_run(struct workload *w, struct workload_task *task, const struct workload_op *op)
void(* oop_executed)(struct m0_op *op)
void run(struct workload *w, struct workload_task *tasks)
int cr_task_prep_one(struct m0_workload_io *cwi, struct m0_task_io **cti_out)
void cr_time_acc(m0_time_t *t1, m0_time_t t2)
uint64_t cti_start_offset
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static void cr_cti_cleanup(struct m0_task_io *cti, int nr_ops)
int cr_task_share_execute(struct m0_task_io *cti)
void cr_op_stable(struct m0_op *op)
int cr_tasks_prepare(struct workload *w, struct workload_task *tasks)
M0_INTERNAL int m0_thread_adopt(struct m0_thread *thread, struct m0 *instance)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
m0_time_t cwi_finish_time
int cr_task_execute(struct m0_task_io *cti)
void workload_start(struct workload *w, struct workload_task *task)
static int cr_adopt_motr_thread(struct m0_task_io *cti)
int cr_namei_open(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
int cr_free_op_idx(struct m0_task_io *cti, uint32_t nr_ops)
m0_time_t cwi_time[CR_OPS_NR]
int cr_execute_ops(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_obj *obj, struct m0_op_ops *cbs, enum m0_operations op_code, int obj_idx)
void cr_op_failed(struct m0_op *op)
const struct m0_uint128 M0_ID_APP
int m0_bufvec_alloc_aligned(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift)
M0_INTERNAL uint64_t m0_round_down(uint64_t val, uint64_t size)
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
int m0_obj_op(struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
struct m0_bufvec * coc_buf_vec
M0_INTERNAL struct m0_thread_tls * m0_thread_tls(void)
int cr_op_namei(struct m0_workload_io *cwi, struct m0_task_io *cti, enum m0_operations op_code)
m0_time_t cg_cwi_acc_time[CR_OPS_NR]
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
void cr_task_io_cleanup(struct m0_task_io **cti_p)
uint32_t cwi_bcount_per_op
cr_operation_t opcode_operation_map[]
static struct m0_fid * check_fid(struct m0_fid *id)
return M0_ERR(-EOPNOTSUPP)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
void workload_join(struct workload *w, struct workload_task *task)
void(* oop_stable)(struct m0_op *op)
int cr_io_read(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
m0_time_t cti_op_acc_time
struct m0_bufvec * cti_bufvec
union workload_task::@329 u
m0_time_t m0_time_now(void)
void m0_obj_fini(struct m0_obj *obj)
int cr_task_prep_bufs(struct m0_workload_io *cwi, struct m0_task_io *cti)
struct m0_uint128 * cti_ids
struct m0_indexvec * coc_index_vec
void cr_task_bufs_free(struct m0_task_io *cti, int idx)
void m0_op_launch(struct m0_op **op, uint32_t nr)
struct m0_workload_io * cti_cwi
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
void * m0_alloc(size_t size)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
int(* cr_operation_t)(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
int cr_namei_delete(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
void cr_get_oids(struct m0_uint128 *ids, uint32_t nr_objs)
M0_INTERNAL void m0_bitmap_set(struct m0_bitmap *map, size_t idx, bool val)
struct m0_fid cwi_pool_id
static void cti_cleanup_op(struct m0_task_io *cti, int i)
static m0_bindex_t offset
void(* oop_failed)(struct m0_op *op)
m0_time_t m0_time_add(const m0_time_t t1, const m0_time_t t2)
struct m0_addb2__id_intrp ids[]
M0_INTERNAL void m0_thread_shun(void)
M0_INTERNAL void m0_bufvec_free_aligned(struct m0_bufvec *bufvec, unsigned shift)
int m0_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
static uint64_t bw(uint64_t bytes, m0_time_t time)
struct m0_uint128 cwi_start_obj_id
static uint64_t nz_rand(void)
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
enum m0_operations coc_op_code
static int cr_release_motr_thread(struct m0_task_io *cti)
m0_time_t m0_time_sub(const m0_time_t t1, const m0_time_t t2)
void cr_log(enum cr_log_level lev, const char *fmt,...)
M0_INTERNAL bool m0_bitmap_get(const struct m0_bitmap *map, size_t idx)
static size_t cr_rand___range_l(size_t end)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
void m0_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
int cr_io_vector_prep(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, int obj_idx, int op_index)
int cr_io_write(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
void integrity(struct m0_uint128 object_id, unsigned char **md5toverify, int block_count, int idx_op)
struct m0_bufvec * coc_attr
int cr_tasks_release(struct workload *w, struct workload_task *tasks)
int m0_entity_delete(struct m0_entity *entity, struct m0_op **op)
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
struct m0_realm * crate_uber_realm()
void m0_op_free(struct m0_op *op)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
struct m0_bufvec * cti_rd_bufvec
int m0_entity_open(struct m0_entity *entity, struct m0_op **op)
struct m0_workload_io * coc_cwi
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
struct m0_thread * cti_mthread
int cr_namei_create(struct m0_workload_io *cwi, struct m0_task_io *cti, struct m0_op_context *op_ctx, struct m0_obj *obj, int free_slot, int obj_idx, int op_index)
m0_time_t cwi_execution_time
void m0_op_setup(struct m0_op *op, const struct m0_op_ops *cbs, m0_time_t linger)