Ejemplo n.º 1
0
Archivo: act.c Proyecto: aanguss/act
//------------------------------------------------
// Do one large block write operation and report.
//
static void write_and_report_large_block(device* p_device) {
	salter* p_salter;

	if (g_num_write_buffers > 1) {
		p_salter = &g_salters[rand_32() % g_num_write_buffers];

		pthread_mutex_lock(&p_salter->lock);
		*(uint32_t*)p_salter->p_buffer = p_salter->stamp++;
	}
	else {
		p_salter = &g_salters[0];
	}

	uint64_t offset = random_large_block_offset(p_device);
	uint64_t start_time = cf_getus();
	uint64_t stop_time = write_to_device(p_device, offset,
		g_large_block_ops_bytes, p_salter->p_buffer);

	if (g_num_write_buffers > 1) {
		pthread_mutex_unlock(&p_salter->lock);
	}

	if (stop_time != -1) {
		histogram_insert_data_point(g_p_large_block_write_histogram,
			safe_delta_us(start_time, stop_time));
	}
}
Ejemplo n.º 2
0
Archivo: act.c Proyecto: aanguss/act
//------------------------------------------------
// Do one large block read operation and report.
//
static void read_and_report_large_block(device* p_device) {
	uint64_t offset = random_large_block_offset(p_device);
	uint64_t start_time = cf_getus();
	uint64_t stop_time = read_from_device(p_device, offset,
		g_large_block_ops_bytes, p_device->p_large_block_read_buffer);

	if (stop_time != -1) {
		histogram_insert_data_point(g_p_large_block_read_histogram,
			safe_delta_us(start_time, stop_time));
	}
}
Ejemplo n.º 3
0
//------------------------------------------------
// Do one large block read operation and report.
//
static void
read_and_report_large_block(device* dev, uint8_t* buf)
{
	uint64_t offset = random_large_block_offset(dev);
	uint64_t start_time = get_ns();
	uint64_t stop_time = read_from_device(dev, offset,
			g_scfg.large_block_ops_bytes, buf);

	if (stop_time != -1) {
		histogram_insert_data_point(g_large_block_read_hist,
				safe_delta_ns(start_time, stop_time));
	}
}
Ejemplo n.º 4
0
//------------------------------------------------
// Do one large block write operation and report.
//
static void
write_and_report_large_block(device* dev, uint8_t* buf, uint64_t count)
{
	// Salt the block each time.
	rand_fill(buf, g_scfg.large_block_ops_bytes);

	uint64_t offset = random_large_block_offset(dev);
	uint64_t start_time = get_ns();
	uint64_t stop_time = write_to_device(dev, offset,
			g_scfg.large_block_ops_bytes, buf);

	if (stop_time != -1) {
		histogram_insert_data_point(g_large_block_write_hist,
				safe_delta_ns(start_time, stop_time));
	}
}