()
return fields
Return a namedtuple of variable fields depending on the
    CPU times available on this Linux kernel version which may be:
    (user, nice, system, idle, iowait, irq, softirq, [steal, [guest,
     [guest_nice]]])
Return a namedtuple of variable fields depending on the
    CPU times available on this Linux kernel version which may be:
    (user, nice, system, idle, iowait, irq, softirq, [steal, [guest,
     [guest_nice]]])
Return a namedtuple of variable fields depending on the CPU times available on this Linux kernel version which may be : ( user nice system idle iowait irq softirq [ steal [ guest [ guest_nice ]]] )
def _get_cputimes_fields():
    """Return a namedtuple of variable fields depending on the
    CPU times available on this Linux kernel version which may be:
    (user, nice, system, idle, iowait, irq, softirq, [steal, [guest,
     [guest_nice]]])
    """
    with open('/proc/stat', 'rb') as f:
        values = f.readline().split()[1:]
    fields = ['user', 'nice', 'system', 'idle', 'iowait', 'irq', 'softirq']
    vlen = len(values)
    if vlen >= 8:
        # Linux >= 2.6.11
        fields.append('steal')
    if vlen >= 9:
        # Linux >= 2.6.24
        fields.append('guest')
    if vlen >= 10:
        # Linux >= 3.2.0
        fields.append('guest_nice')
    return fields
def _get_cputimes_fields ( ) : with open ( '/proc/stat' , 'rb' ) as f : values = f . readline ( ) . split ( ) [ 1 : ] fields = [ 'user' , 'nice' , 'system' , 'idle' , 'iowait' , 'irq' , 'softirq' ] vlen = len ( values ) if vlen >= 8 : # Linux >= 2.6.11 fields . append ( 'steal' ) if vlen >= 9 : # Linux >= 2.6.24 fields . append ( 'guest' ) if vlen >= 10 : # Linux >= 3.2.0 fields . append ( 'guest_nice' ) return fields