Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+1 -1
+1 -1
tools/perf/util/bpf_skel/func_latency.bpf.c
··· 142 142 if (!hist) 143 143 return 0; 144 144 145 - *hist += 1; 145 + __sync_fetch_and_add(hist, 1); 146 146 147 147 __sync_fetch_and_add(&total, delta); // always in nsec 148 148 __sync_fetch_and_add(&count, 1);