mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
perf ftrace: Use atomic inc to update histogram in BPF
It should use an atomic instruction to update even if the histogram is keyed by delta as it's also used for stats. Cc: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kernel.org/r/20250227191223.1288473-3-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
79056b3fe8
commit
e1cde2d5e9
|
|
@ -142,7 +142,7 @@ int BPF_PROG(func_end)
|
|||
if (!hist)
|
||||
return 0;
|
||||
|
||||
*hist += 1;
|
||||
__sync_fetch_and_add(hist, 1);
|
||||
|
||||
__sync_fetch_and_add(&total, delta); // always in nsec
|
||||
__sync_fetch_and_add(&count, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user