diff options
Diffstat (limited to 'kernel/trace/ring_buffer_benchmark.c')
-rw-r--r-- | kernel/trace/ring_buffer_benchmark.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c index 573d3cc762c3..70df73e4ff21 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c | |||
@@ -35,6 +35,10 @@ static int disable_reader; | |||
35 | module_param(disable_reader, uint, 0644); | 35 | module_param(disable_reader, uint, 0644); |
36 | MODULE_PARM_DESC(disable_reader, "only run producer"); | 36 | MODULE_PARM_DESC(disable_reader, "only run producer"); |
37 | 37 | ||
38 | static int write_iteration = 50; | ||
39 | module_param(write_iteration, uint, 0644); | ||
40 | MODULE_PARM_DESC(write_iteration, "# of writes between timestamp readings"); | ||
41 | |||
38 | static int read_events; | 42 | static int read_events; |
39 | 43 | ||
40 | static int kill_test; | 44 | static int kill_test; |
@@ -208,15 +212,18 @@ static void ring_buffer_producer(void) | |||
208 | do { | 212 | do { |
209 | struct ring_buffer_event *event; | 213 | struct ring_buffer_event *event; |
210 | int *entry; | 214 | int *entry; |
211 | 215 | int i; | |
212 | event = ring_buffer_lock_reserve(buffer, 10); | 216 | |
213 | if (!event) { | 217 | for (i = 0; i < write_iteration; i++) { |
214 | missed++; | 218 | event = ring_buffer_lock_reserve(buffer, 10); |
215 | } else { | 219 | if (!event) { |
216 | hit++; | 220 | missed++; |
217 | entry = ring_buffer_event_data(event); | 221 | } else { |
218 | *entry = smp_processor_id(); | 222 | hit++; |
219 | ring_buffer_unlock_commit(buffer, event); | 223 | entry = ring_buffer_event_data(event); |
224 | *entry = smp_processor_id(); | ||
225 | ring_buffer_unlock_commit(buffer, event); | ||
226 | } | ||
220 | } | 227 | } |
221 | do_gettimeofday(&end_tv); | 228 | do_gettimeofday(&end_tv); |
222 | 229 | ||