HomeFreeBSD

Fix output of linprocfs stat entry

Description

Fix output of linprocfs stat entry

The Linux /proc/stat entry has grown over time

v2.5.41 <

user, nice, system, idle

v2.5.41

user, nice, system, idle, iowait, irq

v2.6.11

user, nice, system, idle, iowait, irq, softirq, steal

v2.6.24

user, nice, system, idle, iowait, irq, softirq, steal, guest

v2.6.32 >

user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice

Some applications (e.g. nodejs) depend on the correct number of entries
and will abort otherwise.

Fix is to print the correct number of entries based on the value of
osrelease set either in sysctl or the jail settings. Change is similar
to approach used by illumos.

Reviewed by: emaste, imp (mentor)
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15858

Details

Provenance
chuckAuthored on
Reviewer
emaste
Differential Revision
D15858: Fix output of linprocfs stat entry
Parents
rS335515: Fix the Linux kernel version number calculation
Branches
Unknown
Tags
Unknown