Andrey Ryabinin <arbn@xxxxxxxxxxxxxxx> writes: > static int cpuacct_stats_show(struct seq_file *sf, void *v) > { ... > for_each_possible_cpu(cpu) { > u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat; > > - val[CPUACCT_STAT_USER] += cpustat[CPUTIME_USER]; > - val[CPUACCT_STAT_USER] += cpustat[CPUTIME_NICE]; > - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_SYSTEM]; > - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_IRQ]; > - val[CPUACCT_STAT_SYSTEM] += cpustat[CPUTIME_SOFTIRQ]; > + cputime.utime += cpustat[CPUTIME_USER]; > + cputime.utime += cpustat[CPUTIME_NICE]; > + cputime.stime += cpustat[CPUTIME_SYSTEM]; > + cputime.stime += cpustat[CPUTIME_IRQ]; > + cputime.stime += cpustat[CPUTIME_SOFTIRQ]; > + > + cputime.sum_exec_runtime += this_cpu_read(*ca->cpuusage); > } cputime.sum_exec_runtime += *per_cpu_ptr(ca->cpuusage, cpu); Or the stats can all be 0...