diff -uprN a/bindings.c b/bindings.c --- a/bindings.c 2019-01-07 16:13:51.465457433 +0800 +++ b/bindings.c 2019-01-07 16:15:37.926452242 +0800 @@ -3747,10 +3747,12 @@ static int proc_stat_read(char *buf, siz struct fuse_context *fc = fuse_get_context(); struct file_info *d = (struct file_info *)fi->fh; char *cg = NULL; + char *ccg = NULL; char *cpuset = NULL; char *line = NULL; size_t linelen = 0, total_len = 0, rv = 0; int curcpu = -1; /* cpu numbering starts at 0 */ + long total_cpus = -1; unsigned long user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0, steal = 0, guest = 0, guest_nice = 0; unsigned long user_sum = 0, nice_sum = 0, system_sum = 0, idle_sum = 0, iowait_sum = 0, irq_sum = 0, softirq_sum = 0, steal_sum = 0, guest_sum = 0, guest_nice_sum = 0; @@ -3783,6 +3785,12 @@ static int proc_stat_read(char *buf, siz if (!cpuset) goto err; + ccg = get_pid_cgroup(initpid, "cpu"); + if (ccg) { + prune_init_slice(ccg); + total_cpus = get_cpu_count(ccg); + } + f = fopen("/proc/stat", "r"); if (!f) goto err; @@ -3820,6 +3828,9 @@ static int proc_stat_read(char *buf, siz continue; } + if (total_cpus > 0 && curcpu >= (total_cpus-1)) { + continue; + } if (sscanf(cpu_char, "%d", &cpu) != 1) continue; if (!cpu_in_cpuset(cpu, cpuset))