| Add 'numthreads' field in proc/<pid>/stat that available since Linux 2.6.0-test8 |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-10.3-src/usr/src/sys/compat/linprocfs/linprocfs.c freebsd-10.3/usr/src/sys/compat/linprocfs/linprocfs.c |
| --- /var/tmp/freebsd-10.3-src/usr/src/sys/compat/linprocfs/linprocfs.c 2016-03-25 09:09:43.000000000 +0800 |
| +++ freebsd-10.3/usr/src/sys/compat/linprocfs/linprocfs.c 2019-03-12 14:14:06.090279460 +0800 |
| @@ -661,7 +667,7 @@ |
| PS_ADD("cstime", "%ld", TV2J(&kp.ki_rusage_ch.ru_stime)); |
| PS_ADD("priority", "%d", kp.ki_pri.pri_user); |
| PS_ADD("nice", "%d", kp.ki_nice); /* 19 (nicest) to -19 */ |
| - PS_ADD("0", "%d", 0); /* removed field */ |
| + PS_ADD("numthreads", "%d", kp.ki_numthreads); /* >= 2.6 */ |
| PS_ADD("itrealvalue", "%d", 0); /* XXX */ |
| PS_ADD("starttime", "%lu", TV2J(&kp.ki_start) - TV2J(&boottime)); |
| PS_ADD("vsize", "%ju", P2K((uintmax_t)kp.ki_size)); |