MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / getPid

Method getPid

pkg/event/param.go:290–303  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

288}
289
290func (pars Params) getPid(name string) (uint32, error) {
291 par, err := pars.findParam(name)
292 if err != nil {
293 return uint32(0), err
294 }
295 if par.Type != params.PID {
296 return uint32(0), fmt.Errorf("%q parameter is not a PID", name)
297 }
298 v, ok := par.Value.(uint32)
299 if !ok {
300 return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from pid", name)
301 }
302 return v, nil
303}
304
305// GetTid returns the thread id from the parameter.
306func (pars Params) GetTid() (uint32, error) {

Callers 2

GetPidMethod · 0.95
GetPpidMethod · 0.95

Calls 1

findParamMethod · 0.95

Tested by

no test coverage detected