shirou / gopsutil

psutil for golang
Other
10.47k stars 1.58k forks source link

Process information not reported for FreeBSD ARM64 #1533

Closed sdalu closed 5 months ago

sdalu commented 11 months ago

Describe the bug Missing (nil) processes information reported on FreeBSD ARM64 system (RPI4)

To Reproduce

package main

import (
    "fmt"
    "os"

    "github.com/shirou/gopsutil/process"
)

func main() {
    currentPid := os.Getpid()
    myself, err := process.NewProcess(int32(currentPid))
    if err != nil {
        panic(err)
    }
    fmt.Println(myself.Name())
    fmt.Println(myself.String())
    fmt.Println(myself.NumThreads())
    fmt.Println(myself.RlimitUsage(true))
    fmt.Println(myself.Status())
}

Obtained results

 <nil>
{"pid":96242}
0 <nil>
[] not implemented yet
 <nil>

Expected behavior non nil information

Environment (please complete the following information):

Additional context Initially reported in https://github.com/influxdata/telegraf/issues/13933

danawoodman commented 7 months ago

We're also facing this issue on a Pi 4 device, is there a know workaround available?

shirou commented 6 months ago

@sdalu @danawoodman I have opened #1609 which re-generate struct definition. Could you try it?