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
1=== modified file 'sysbench/tests/memory/sb_memory.c'
2--- sysbench/tests/memory/sb_memory.c 2011-09-26 13:54:56 +0000
3+++ sysbench/tests/memory/sb_memory.c 2014-09-15 11:18:34 +0000
4@@ -261,11 +261,10 @@
5 buf = buffers[thread_id];
6 end = (int *)((char *)buf + memory_block_size);
7
8- LOG_EVENT_START(msg, thread_id);
9-
10 if (memory_access_rnd)
11 {
12 rand = sb_rnd();
13+ LOG_EVENT_START(msg, thread_id);
14 switch (mem_req->type) {
15 case SB_MEM_OP_WRITE:
16 for (i = 0; i < memory_block_size; i++)
17@@ -291,6 +290,7 @@
18 }
19 else
20 {
21+ LOG_EVENT_START(msg, thread_id);
22 switch (mem_req->type) {
23 case SB_MEM_OP_NONE:
24 for (; buf < end; buf++)

Subscribers

People subscribed via source and target branches

to status/vote changes: