Skip to content

Commit c73f0b6

Browse files
kknjhrostedt
authored andcommitted
ring-buffer: Fix bytes_dropped calculation issue
The calculation of bytes-dropped and bytes_dropped_nested is reversed. Although it does not affect the final calculation of total_dropped, it should still be modified. Link: https://lore.kernel.org/[email protected] Fixes: 6c43e55 ("ring-buffer: Add ring buffer startup selftest") Signed-off-by: Feng Yang <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent d082ecb commit c73f0b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/ring_buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7411,9 +7411,9 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested)
74117411
/* Ignore dropped events before test starts. */
74127412
if (started) {
74137413
if (nested)
7414-
data->bytes_dropped += len;
7415-
else
74167414
data->bytes_dropped_nested += len;
7415+
else
7416+
data->bytes_dropped += len;
74177417
}
74187418
return len;
74197419
}

0 commit comments

Comments
 (0)