On 02/22/2019 03:36 PM, Alexei Starovoitov wrote:

>  
> +static void bpf_prog_get_stats(const struct bpf_prog *prog,
> +                            struct bpf_prog_stats *stats)
> +{
> +     u64 nsecs = 0, cnt = 0;
> +     int cpu;
> +
> +     for_each_possible_cpu(cpu) {
> +             nsecs += per_cpu(prog->aux->stats->nsecs, cpu);
> +             cnt += per_cpu(prog->aux->stats->cnt, cpu);

This does not work reliably for 32 bit kernels.

> +     }
> +     stats->nsecs = nsecs;
> +     stats->cnt = cnt;
> +}

Reply via email to