Commit d511748b authored by Shirou WAKAYAMA's avatar Shirou WAKAYAMA

golint on Linux

parent 9a32bb9b
......@@ -13,7 +13,7 @@ import (
"strings"
)
// Read contents from file and split by new line.
// ReadLines read contents from file and split by new line.
func ReadLines(filename string) ([]string, error) {
f, err := os.Open(filename)
if err != nil {
......@@ -21,7 +21,7 @@ func ReadLines(filename string) ([]string, error) {
}
defer f.Close()
ret := make([]string, 0)
var ret []string
r := bufio.NewReader(f)
line, err := r.ReadString('\n')
......@@ -52,9 +52,8 @@ func byteToString(orig []byte) string {
}
if n == -1 {
return string(orig)
} else {
return string(orig[l:n])
}
return string(orig[l:n])
}
// Parse to int32 without error
......
......@@ -7,7 +7,7 @@ import (
"strings"
)
func do_sysctrl(mib string) ([]string, error) {
func doSysctrl(mib string) ([]string, error) {
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
if err != nil {
return []string{}, err
......
......@@ -5,20 +5,20 @@ import (
)
type CPUTimesStat struct {
Cpu string `json:"cpu"`
User float32 `json:"user"`
System float32 `json:"system"`
Idle float32 `json:"idle"`
Nice float32 `json:"nice"`
Iowait float32 `json:"iowait"`
Irq float32 `json:"irq"`
Softirq float32 `json:"softirq"`
Steal float32 `json:"steal"`
Guest float32 `json:"guest"`
Guest_nice float32 `json:"guest_nice"`
Stolen float32 `json:"stolen"`
CPU string `json:"cpu"`
User float32 `json:"user"`
System float32 `json:"system"`
Idle float32 `json:"idle"`
Nice float32 `json:"nice"`
Iowait float32 `json:"iowait"`
Irq float32 `json:"irq"`
Softirq float32 `json:"softirq"`
Steal float32 `json:"steal"`
Guest float32 `json:"guest"`
GuestNice float32 `json:"guest_nice"`
Stolen float32 `json:"stolen"`
}
func CpuCounts(logical bool) (int, error) {
func CPUCounts(logical bool) (int, error) {
return runtime.NumCPU(), nil
}
......@@ -23,20 +23,20 @@ const (
// TODO: get per cpus
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
ret := make([]CPU_TimesStat, 0)
var ret []CPU_TimesStat
cpu_time, err := do_sysctrl("kern.cp_time")
cpuTime, err := doSysctrl("kern.cp_time")
if err != nil {
return ret, err
}
user, _ := strconv.ParseFloat(cpu_time[CP_USER], 32)
nice, _ := strconv.ParseFloat(cpu_time[CP_NICE], 32)
sys, _ := strconv.ParseFloat(cpu_time[CP_SYS], 32)
idle, _ := strconv.ParseFloat(cpu_time[CP_IDLE], 32)
intr, _ := strconv.ParseFloat(cpu_time[CP_INTR], 32)
user, _ := strconv.ParseFloat(cpuTime[CP_USER], 32)
nice, _ := strconv.ParseFloat(cpuTime[CP_NICE], 32)
sys, _ := strconv.ParseFloat(cpuTime[CP_SYS], 32)
idle, _ := strconv.ParseFloat(cpuTime[CP_IDLE], 32)
intr, _ := strconv.ParseFloat(cpuTime[CP_INTR], 32)
c := CPU_TimesStat{
c := CPUTimesStat{
User: float32(user / CLOCKS_PER_SEC),
Nice: float32(nice / CLOCKS_PER_SEC),
System: float32(sys / CLOCKS_PER_SEC),
......
......@@ -8,8 +8,8 @@ import (
"strings"
)
func Cpu_times(percpu bool) ([]CPU_TimesStat, error) {
ret := make([]CPU_TimesStat, 0)
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
var ret []CPUTimesStat
filename := "/proc/stat"
lines, _ := ReadLines(filename)
......@@ -24,12 +24,12 @@ func Cpu_times(percpu bool) ([]CPU_TimesStat, error) {
return ret, nil
}
func parseStatLine(line string) (CPU_TimesStat, error) {
func parseStatLine(line string) (CPUTimesStat, error) {
fields := strings.Fields(line)
if strings.HasPrefix(fields[0], "cpu") == false {
// return CPU_TimesStat{}, e
return CPU_TimesStat{}, errors.New("not contain cpu")
// return CPUTimesStat{}, e
return CPUTimesStat{}, errors.New("not contain cpu")
}
cpu := fields[0]
......@@ -44,8 +44,8 @@ func parseStatLine(line string) (CPU_TimesStat, error) {
irq, _ := strconv.ParseFloat(fields[6], 32)
softirq, _ := strconv.ParseFloat(fields[7], 32)
stolen, _ := strconv.ParseFloat(fields[8], 32)
ct := CPU_TimesStat{
Cpu: cpu,
ct := CPUTimesStat{
CPU: cpu,
User: float32(user),
Nice: float32(nice),
System: float32(system),
......@@ -64,8 +64,8 @@ func parseStatLine(line string) (CPU_TimesStat, error) {
ct.Guest = float32(guest)
}
if len(fields) > 11 { // Linux >= 3.2.0
guest_nice, _ := strconv.ParseFloat(fields[11], 32)
ct.Guest_nice = float32(guest_nice)
guestNice, _ := strconv.ParseFloat(fields[11], 32)
ct.GuestNice = float32(guestNice)
}
return ct, nil
......
......@@ -21,7 +21,7 @@ func TestCpu_times(t *testing.T) {
}
func TestCpu_counts(t *testing.T) {
v, err := CpuCounts(true)
v, err := CPUCounts(true)
if err != nil {
t.Errorf("error %v", err)
}
......
......@@ -9,7 +9,7 @@ import (
)
func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
ret := make([]Disk_partitionStat, 0)
var ret []Disk_partitionStat
// get length
count, err := syscall.Getfsstat(nil, MNT_WAIT)
......@@ -72,8 +72,8 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
}
d := Disk_partitionStat{
Mountpoint: byteToString(stat.F_mntonname[:]),
Fstype: byteToString(stat.F_fstypename[:]),
Mountpoint: byteToString(stat.FMntonname[:]),
Fstype: byteToString(stat.FFstypename[:]),
Opts: opts,
}
ret = append(ret, d)
......@@ -83,7 +83,7 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
}
func DiskIOCounters() (map[string]DiskIOCountersStat, error) {
ret := make(map[string]Disk_IO_CountersStat, 0)
ret := make(map[string]DiskIOCountersStat, 0)
return ret, errors.New("not implemented yet")
}
......
......@@ -30,26 +30,26 @@ const (
)
type Statfs struct {
F_version uint32 /* structure version number */
F_type uint32 /* type of filesystem */
F_flags uint64 /* copy of mount exported flags */
F_bsize uint64 /* filesystem fragment size */
F_iosize uint64 /* optimal transfer block size */
F_blocks uint64 /* total data blocks in filesystem */
F_bfree uint64 /* free blocks in filesystem */
F_bavail int64 /* free blocks avail to non-superuser */
F_files uint64 /* total file nodes in filesystem */
F_ffree int64 /* free nodes avail to non-superuser */
F_syncwrites uint64 /* count of sync writes since mount */
F_asyncwrites uint64 /* count of async writes since mount */
F_syncreads uint64 /* count of sync reads since mount */
F_asyncreads uint64 /* count of async reads since mount */
F_spare [10]uint64 /* unused spare */
F_namemax uint32 /* maximum filename length */
F_owner uint32 /* user that mounted the filesystem */
F_fsid int32 /* filesystem id */
F_charspare [80]byte /* spare string space */
F_fstypename [MFSNAMELEN]byte /* filesystem type name */
F_mntfromname [MNAMELEN]byte /* mounted filesystem */
F_mntonname [MNAMELEN]byte /* directory on which mounted */
FVersion uint32 /* structure version number */
FType uint32 /* type of filesystem */
FFlags uint64 /* copy of mount exported flags */
FBsize uint64 /* filesystem fragment size */
FIosize uint64 /* optimal transfer block size */
FBlocks uint64 /* total data blocks in filesystem */
FBfree uint64 /* free blocks in filesystem */
FBavail int64 /* free blocks avail to non-superuser */
FFiles uint64 /* total file nodes in filesystem */
FFfree int64 /* free nodes avail to non-superuser */
FSyncwrites uint64 /* count of sync writes since mount */
FAsyncwrites uint64 /* count of async writes since mount */
FSyncreads uint64 /* count of sync reads since mount */
FAsyncreads uint64 /* count of async reads since mount */
FSpare [10]uint64 /* unused spare */
FNamemax uint32 /* maximum filename length */
FOwner uint32 /* user that mounted the filesystem */
FFsid int32 /* filesystem id */
FCharspare [80]byte /* spare string space */
FFstypename [MFSNAMELEN]byte /* filesystem type name */
FMntfromname [MNAMELEN]byte /* mounted filesystem */
FMntonname [MNAMELEN]byte /* directory on which mounted */
}
......@@ -14,7 +14,7 @@ const (
// Get disk partitions.
// should use setmntent(3) but this implement use /etc/mtab file
func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
ret := make([]Disk_partitionStat, 0)
var ret []DiskPartitionStat
filename := "/etc/mtab"
lines, err := ReadLines(filename)
......@@ -24,7 +24,7 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
for _, line := range lines {
fields := strings.Fields(line)
d := Disk_partitionStat{
d := DiskPartitionStat{
Mountpoint: fields[1],
Fstype: fields[2],
Opts: fields[3],
......@@ -36,7 +36,7 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
}
func DiskIOCounters() (map[string]DiskIOCountersStat, error) {
ret := make(map[string]Disk_IO_CountersStat, 0)
ret := make(map[string]DiskIOCountersStat, 0)
// determine partitions we want to look for
filename := "/proc/partitions"
......@@ -44,7 +44,7 @@ func DiskIOCounters() (map[string]DiskIOCountersStat, error) {
if err != nil {
return ret, err
}
partitions := make([]string, 0)
var partitions []string
for _, line := range lines[2:] {
fields := strings.Fields(line)
......@@ -76,7 +76,7 @@ func DiskIOCounters() (map[string]DiskIOCountersStat, error) {
wbytes := parseUint64(fields[9])
wtime := parseUint64(fields[10])
if stringContains(partitions, name) {
d := Disk_IO_CountersStat{
d := DiskIOCountersStat{
Name: name,
ReadBytes: rbytes * SECTOR_SIZE,
WriteBytes: wbytes * SECTOR_SIZE,
......
......@@ -8,12 +8,12 @@ func DiskUsage(path string) (DiskUsageStat, error) {
stat := syscall.Statfs_t{}
err := syscall.Statfs(path, &stat)
if err != nil {
return Disk_usageStat{Path: path}, err
return DiskUsageStat{Path: path}, err
}
bsize := stat.Bsize / 512
ret := Disk_usageStat{
ret := DiskUsageStat{
Path: path,
Total: (uint64(stat.Blocks) * uint64(bsize)) >> 1,
Free: (uint64(stat.Bfree) * uint64(bsize)) >> 1,
......
......@@ -46,7 +46,7 @@ func DiskUsage(path string) (DiskUsageStat, error) {
}
func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
ret := make([]DiskPartitionStat, 0)
var ret []DiskPartitionStat
lpBuffer := make([]byte, 254)
diskret, _, err := procGetLogicalDriveStringsW.Call(
uintptr(len(lpBuffer)),
......
......@@ -25,7 +25,7 @@ func HostInfo() (HostInfoStat, error) {
}
func BootTime() (int64, error) {
values, err := do_sysctrl("kern.boottime")
values, err := doSysctrl("kern.boottime")
if err != nil {
return 0, err
}
......@@ -42,7 +42,7 @@ func BootTime() (int64, error) {
func Users() ([]UserStat, error) {
utmpfile := "/var/run/utmp"
ret := make([]UserStat, 0)
var ret []UserStat
file, err := os.Open(utmpfile)
if err != nil {
......
......@@ -10,8 +10,8 @@ const (
)
type utmp struct {
Ut_line [UT_LINESIZE]byte
Ut_name [UT_NAMESIZE]byte
Ut_host [UT_HOSTSIZE]byte
Ut_time int32
UtLine [UT_LINESIZE]byte
UtName [UT_NAMESIZE]byte
UtHost [UT_HOSTSIZE]byte
UtTime int32
}
......@@ -23,7 +23,7 @@ func HostInfo() (HostInfoStat, error) {
return ret, nil
}
func Boot_time() (int64, error) {
func BootTime() (int64, error) {
sysinfo := &syscall.Sysinfo_t{}
if err := syscall.Sysinfo(sysinfo); err != nil {
return 0, err
......@@ -33,7 +33,7 @@ func Boot_time() (int64, error) {
func Users() ([]UserStat, error) {
utmpfile := "/var/run/utmp"
ret := make([]UserStat, 0)
var ret []UserStat
file, err := os.Open(utmpfile)
if err != nil {
......@@ -59,10 +59,10 @@ func Users() ([]UserStat, error) {
continue
}
user := UserStat{
User: byteToString(u.Ut_user[:]),
Terminal: byteToString(u.Ut_line[:]),
Host: byteToString(u.Ut_host[:]),
Started: int(u.Ut_tv.Tv_sec),
User: byteToString(u.UtUser[:]),
Terminal: byteToString(u.UtLine[:]),
Host: byteToString(u.UtHost[:]),
Started: int(u.UtTv.TvSec),
}
ret = append(ret, user)
}
......
......@@ -3,25 +3,25 @@
package gopsutil
type exit_status struct {
E_termination int16 // Process termination status.
E_exit int16 // Process exit status.
type exitStatus struct {
Etermination int16 // Process termination status.
Eexit int16 // Process exit status.
}
type timeval struct {
Tv_sec uint32 // Seconds.
Tv_usec uint32 // Microseconds.
TvSec uint32 // Seconds.
TvUsec uint32 // Microseconds.
}
type utmp struct {
Ut_type int16 // Type of login.
Ut_pid int32 // Process ID of login process.
Ut_line [32]byte // Devicename.
Ut_id [4]byte // Inittab ID.
Ut_user [32]byte // Username.
Ut_host [256]byte // Hostname for remote login.
Ut_exit exit_status // Exit status of a process marked
Ut_session int32 // Session ID, used for windowing.
Ut_tv timeval // Time entry was made.
Ut_addr_v6 [16]byte // Internet address of remote host.
Unused [20]byte // Reserved for future use. // original is 20
UtType int16 // Type of login.
UtPid int32 // Process ID of login process.
UtLine [32]byte // Devicename.
UtID [4]byte // Inittab ID.
UtUser [32]byte // Username.
UtHost [256]byte // Hostname for remote login.
UtExit exitStatus // Exit status of a process marked
UtSession int32 // Session ID, used for windowing.
UtTv timeval // Time entry was made.
UtAddrV6 [16]byte // Internet address of remote host.
Unused [20]byte // Reserved for future use. // original is 20
}
......@@ -7,7 +7,7 @@ import (
)
func LoadAvg() (LoadAvgStat, error) {
values, err := do_sysctrl("vm.loadavg")
values, err := doSysctrl("vm.loadavg")
if err != nil {
return LoadAvgStat{}, err
}
......
......@@ -7,7 +7,7 @@ import (
)
func VirtualMemory() (VirtualMemoryStat, error) {
ret := Virtual_memoryStat{}
ret := VirtualMemoryStat{}
sysinfo := &syscall.Sysinfo_t{}
if err := syscall.Sysinfo(sysinfo); err != nil {
......@@ -36,7 +36,7 @@ func VirtualMemory() (VirtualMemoryStat, error) {
}
func SwapMemory() (SwapMemoryStat, error) {
ret := Swap_memoryStat{}
ret := SwapMemoryStat{}
sysinfo := &syscall.Sysinfo_t{}
if err := syscall.Sysinfo(sysinfo); err != nil {
......
......@@ -13,7 +13,7 @@ type NetIOCountersStat struct {
}
type Addr struct {
Ip string `json:"ip""`
IP string `json:"ip""`
Port uint32 `json:"port""`
}
......
......@@ -10,27 +10,27 @@ func NetIOCounters() ([]NetIOCountersStat, error) {
filename := "/proc/net/dev"
lines, err := ReadLines(filename)
if err != nil {
return make([]Net_io_countersStat, 0), err
return make([]NetIOCountersStat, 0), err
}
statlen := len(lines) - 1
ret := make([]Net_io_countersStat, 0, statlen)
ret := make([]NetIOCountersStat, 0, statlen)
for _, line := range lines[2:] {
fields := strings.Fields(line)
if fields[0] == "" {
continue
}
nic := Net_io_countersStat{
Name: strings.Trim(fields[0], ":"),
Bytes_recv: parseUint64(fields[1]),
Errin: parseUint64(fields[2]),
Dropin: parseUint64(fields[3]),
Bytes_sent: parseUint64(fields[9]),
Packets_sent: parseUint64(fields[10]),
Errout: parseUint64(fields[11]),
Dropout: parseUint64(fields[12]),
nic := NetIOCountersStat{
Name: strings.Trim(fields[0], ":"),
BytesRecv: parseUint64(fields[1]),
Errin: parseUint64(fields[2]),
Dropin: parseUint64(fields[3]),
BytesSent: parseUint64(fields[9]),
PacketsSent: parseUint64(fields[10]),
Errout: parseUint64(fields[11]),
Dropout: parseUint64(fields[12]),
}
ret = append(ret, nic)
}
......
......@@ -20,7 +20,7 @@ type RlimitStat struct {
Hard int32 `json:"hard"`
}
type IoCountersStat struct {
type IOCountersStat struct {
ReadCount int32 `json:"read_count"`
WriteCount int32 `json:"write_count"`
ReadBytes int32 `json:"read_bytes"`
......
......@@ -70,7 +70,7 @@ func (p *Process) Terminal() (string, error) {
func (p *Process) Nice() (int32, error) {
return 0, errors.New("not implemented yet")
}
func (p *Process) Ionice() (int32, error) {
func (p *Process) IOnice() (int32, error) {
return 0, errors.New("not implemented yet")
}
func (p *Process) Rlimit() ([]RlimitStat, error) {
......
......@@ -13,84 +13,84 @@ const (
)
// copied from sys/user.h
type Kinfo_proc struct {
Ki_structsize int32
Ki_layout int32
Ki_args int64
Ki_paddr int64
Ki_addr int64
Ki_tracep int64
Ki_textvp int64
Ki_fd int64
Ki_vmspace int64
Ki_wchan int64
Ki_pid int32
Ki_ppid int32
Ki_pgid int32
Ki_tpgid int32
Ki_sid int32
Ki_tsid int32
Ki_jobc [2]byte
Ki_spare_short1 [2]byte
Ki_tdev int32
Ki_siglist [16]byte
Ki_sigmask [16]byte
Ki_sigignore [16]byte
Ki_sigcatch [16]byte
Ki_uid int32
Ki_ruid int32
Ki_svuid int32
Ki_rgid int32
Ki_svgid int32
Ki_ngroups [2]byte
Ki_spare_short2 [2]byte
Ki_groups [64]byte
Ki_size int64
Ki_rssize int64
Ki_swrss int64
Ki_tsize int64
Ki_dsize int64
Ki_ssize int64
Ki_xstat [2]byte
Ki_acflag [2]byte
Ki_pctcpu int32
Ki_estcpu int32
Ki_slptime int32
Ki_swtime int32
Ki_cow int32
Ki_runtime int64
Ki_start [16]byte
Ki_childtime [16]byte
Ki_flag int64
Ki_kiflag int64
Ki_traceflag int32
Ki_stat [1]byte
Ki_nice [1]byte
Ki_lock [1]byte
Ki_rqindex [1]byte
Ki_oncpu [1]byte
Ki_lastcpu [1]byte
Ki_ocomm [17]byte
Ki_wmesg [9]byte
Ki_login [18]byte
Ki_lockname [9]byte
Ki_comm [20]byte
Ki_emul [17]byte
Ki_sparestrings [68]byte
Ki_spareints [36]byte
Ki_cr_flags int32
Ki_jid int32
Ki_numthreads int32
Ki_tid int32
Ki_pri int32
Ki_rusage [144]byte
Ki_rusage_ch [144]byte
Ki_pcb int64
Ki_kstack int64
Ki_udata int64
Ki_tdaddr int64
Ki_spareptrs [48]byte
Ki_spareint64s [96]byte
Ki_sflag int64
Ki_tdflags int64
type KinfoProc struct {
KiStructsize int32
KiLayout int32
KiArgs int64
KiPaddr int64
KiAddr int64
KiTracep int64
KiTextvp int64
KiFd int64
KiVmspace int64
KiWchan int64
KiPid int32
KiPpid int32
KiPgid int32
KiTpgid int32
KiSid int32
KiTsid int32
KiJobc [2]byte
KiSpareShort1 [2]byte
KiTdev int32
KiSiglist [16]byte
KiSigmask [16]byte
KiSigignore [16]byte
KiSigcatch [16]byte
KiUID int32
KiRuid int32
KiSvuid int32
KiRgid int32
KiSvgid int32
KiNgroups [2]byte
KiSpareShort2 [2]byte
KiGroups [64]byte
KiSize int64
KiRssize int64
KiSwrss int64
KiTsize int64
KiDsize int64
KiSsize int64
KiXstat [2]byte
KiAcflag [2]byte
KiPctcpu int32
KiEstcpu int32
KiSlptime int32
KiSwtime int32
KiCow int32
KiRuntime int64
KiStart [16]byte
KiChildtime [16]byte
KiFlag int64
KiKflag int64
KiTraceflag int32
KiStat [1]byte
KiNice [1]byte
KiLock [1]byte
KiRqindex [1]byte
KiOncpu [1]byte
KiLastcpu [1]byte
KiOcomm [17]byte
KiWmesg [9]byte
KiLogin [18]byte
KiLockname [9]byte
KiComm [20]byte
KiEmul [17]byte
KiSparestrings [68]byte
KiSpareints [36]byte
KiCrFlags int32
KiJid int32
KiNumthreads int32
KiTid int32
KiPri int32
KiRusage [144]byte
KiRusageCh [144]byte
KiPcb int64
KiKstack int64
KiUdata int64
KiTdaddr int64
KiSpareptrs [48]byte
KiSpareint64s [96]byte
KiSflag int64
KiTdflags int64
}
......@@ -114,7 +114,7 @@ func (p *Process) Nice() (int32, error) {
}
return nice, nil
}
func (p *Process) Ionice() (int32, error) {
func (p *Process) IOnice() (int32, error) {
return 0, errors.New("not implemented yet")
}
func (p *Process) Rlimit() ([]RlimitStat, error) {
......@@ -179,7 +179,7 @@ func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
return nil, errors.New("not implemented yet")
}
func (p *Process) Connections() ([]Net_connectionStat, error) {
func (p *Process) Connections() ([]NetConnectionStat, error) {
return nil, errors.New("not implemented yet")
}
......@@ -258,7 +258,7 @@ func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
**/
// Get num_fds from /proc/(pid)/fd
func (p *Process) fillFromfd() (int32, []*Open_filesStat, error) {
func (p *Process) fillFromfd() (int32, []*OpenFilesStat, error) {
pid := p.Pid
statPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "fd")
d, err := os.Open(statPath)
......@@ -276,7 +276,7 @@ func (p *Process) fillFromfd() (int32, []*Open_filesStat, error) {
if err != nil {
continue
}
o := &Open_filesStat{
o := &OpenFilesStat{
Path: filepath,
Fd: parseUint64(fd),
}
......@@ -328,7 +328,7 @@ func (p *Process) fillFromCmdline() (string, error) {
}
// Get memory info from /proc/(pid)/statm
func (p *Process) fillFromStatm() (*Memory_infoStat, *Memory_info_exStat, error) {
func (p *Process) fillFromStatm() (*MemoryInfoStat, *MemoryInfoExStat, error) {
pid := p.Pid
memPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "statm")
contents, err := ioutil.ReadFile(memPath)
......@@ -421,7 +421,7 @@ func (p *Process) fillFromStat() (string, int32, *CPUTimesStat, int64, int32, er
stime, _ := strconv.ParseFloat(fields[14], 64)
cpuTimes := &CPUTimesStat{
Cpu: "cpu",
CPU: "cpu",