MCPcopy Create free account
hub / github.com/prometheus/procfs / CmdLine

Method CmdLine

proc.go:130–141  ·  view source on GitHub ↗

CmdLine returns the command line of a process.

()

Source from the content-addressed store, hash-verified

128
129// CmdLine returns the command line of a process.
130func (p Proc) CmdLine() ([]string, error) {
131 data, err := util.ReadFileNoStat(p.path("cmdline"))
132 if err != nil {
133 return nil, err
134 }
135
136 if len(data) < 1 {
137 return []string{}, nil
138 }
139
140 return strings.Split(string(bytes.TrimRight(data, "\x00")), "\x00"), nil
141}
142
143// Wchan returns the wchan (wait channel) of a process.
144func (p Proc) Wchan() (string, error) {

Callers 1

TestCmdLineFunction · 0.45

Calls 2

pathMethod · 0.95
ReadFileNoStatFunction · 0.92

Tested by 1

TestCmdLineFunction · 0.36