Skip to content

Commit 0672607

Browse files
kknjhaloktiwa
authored andcommitted
ring-buffer: Fix bytes_dropped calculation issue
[ Upstream commit c73f0b69648501978e8b3e8fa7eef7f4197d0481 ] 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]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 4a760b682ecb73bc9a09debb58580b0fc81f58f3) Signed-off-by: Alok Tiwari <[email protected]>
1 parent b9124af commit 0672607

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
@@ -5141,9 +5141,9 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested)
51415141
/* Ignore dropped events before test starts. */
51425142
if (started) {
51435143
if (nested)
5144-
data->bytes_dropped += len;
5145-
else
51465144
data->bytes_dropped_nested += len;
5145+
else
5146+
data->bytes_dropped += len;
51475147
}
51485148
return len;
51495149
}

0 commit comments

Comments
 (0)