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

Method GetTid

pkg/event/param.go:306–319  ·  view source on GitHub ↗

GetTid returns the thread id from the parameter.

()

Source from the content-addressed store, hash-verified

304
305// GetTid returns the thread id from the parameter.
306func (pars Params) GetTid() (uint32, error) {
307 par, err := pars.findParam(params.ThreadID)
308 if err != nil {
309 return uint32(0), err
310 }
311 if par.Type != params.TID {
312 return uint32(0), fmt.Errorf("%q parameter is not a TID", params.ThreadID)
313 }
314 v, ok := par.Value.(uint32)
315 if !ok {
316 return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID)
317 }
318 return v, nil
319}
320
321// MustGetTid returns the thread id from the parameter or panics if an error occurs.
322func (pars Params) MustGetTid() uint32 {

Callers 5

AddThreadMethod · 0.80
adjustPIDMethod · 0.80
RundownKeyMethod · 0.80
SummaryMethod · 0.80
ProcessEventMethod · 0.80

Calls 1

findParamMethod · 0.95

Tested by

no test coverage detected