Merge lp:~erwan-t/sysbench/sysbench into lp:sysbench

Proposed by Erwan Velu
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 123
Merged at revision: 123
Proposed branch: lp:~erwan-t/sysbench/sysbench
Merge into: lp:sysbench
Diff against target: 24 lines (+2/-2)
1 file modified
sysbench/tests/memory/sb_memory.c (+2/-2)
To merge this branch: bzr merge lp:~erwan-t/sysbench/sysbench
Reviewer Review Type Date Requested Status
Alexey Kopytov Approve
Review via email: mp+234668@code.launchpad.net

Description of the change

This patch insure that no code that could consume CPU is between the LOG_EVENT_START and the working loop.

In the current code, a random calculation was done after the LOG_EVENT_START was setup. If for any reason this random thing is taking some time, then the complete result will be inaccurate.

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Thank you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sysbench/tests/memory/sb_memory.c'
--- sysbench/tests/memory/sb_memory.c 2011-09-26 13:54:56 +0000
+++ sysbench/tests/memory/sb_memory.c 2014-09-15 11:18:34 +0000
@@ -261,11 +261,10 @@
261 buf = buffers[thread_id];261 buf = buffers[thread_id];
262 end = (int *)((char *)buf + memory_block_size);262 end = (int *)((char *)buf + memory_block_size);
263263
264 LOG_EVENT_START(msg, thread_id);
265
266 if (memory_access_rnd)264 if (memory_access_rnd)
267 {265 {
268 rand = sb_rnd();266 rand = sb_rnd();
267 LOG_EVENT_START(msg, thread_id);
269 switch (mem_req->type) {268 switch (mem_req->type) {
270 case SB_MEM_OP_WRITE:269 case SB_MEM_OP_WRITE:
271 for (i = 0; i < memory_block_size; i++)270 for (i = 0; i < memory_block_size; i++)
@@ -291,6 +290,7 @@
291 }290 }
292 else291 else
293 {292 {
293 LOG_EVENT_START(msg, thread_id);
294 switch (mem_req->type) {294 switch (mem_req->type) {
295 case SB_MEM_OP_NONE:295 case SB_MEM_OP_NONE:
296 for (; buf < end; buf++)296 for (; buf < end; buf++)

Subscribers

People subscribed via source and target branches

to status/vote changes: