On 08/09, Andrii Nakryiko wrote:
>
> @@ -815,13 +824,21 @@ static int probes_profile_seq_show(struct seq_file *m,
> void *v)
> {
> struct dyn_event *ev = v;
> struct trace_uprobe *tu;
> + unsigned long nhits;
> + int cpu;
>
> if (!is_trace_uprobe(ev))
> return 0;
>
> tu = to_trace_uprobe(ev);
> +
> + nhits = 0;
> + for_each_possible_cpu(cpu) {
> + nhits += READ_ONCE(*per_cpu_ptr(tu->nhits, cpu));
why not
nhits += per_cpu(*tu->nhits, cpu);
?
See for example per_cpu_sum() or nr_processes(), per_cpu() should work just
fine...
Other than that
Reviewed-by: Oleg Nesterov <[email protected]>