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

Method MustGetTid

pkg/event/param.go:322–335  ·  view source on GitHub ↗

MustGetTid returns the thread id from the parameter or panics if an error occurs.

()

Source from the content-addressed store, hash-verified

320
321// MustGetTid returns the thread id from the parameter or panics if an error occurs.
322func (pars Params) MustGetTid() uint32 {
323 par, err := pars.findParam(params.ThreadID)
324 if err != nil {
325 panic(err)
326 }
327 if par.Type != params.TID {
328 panic(fmt.Errorf("%q parameter is not a TID", params.ThreadID))
329 }
330 v, ok := par.Value.(uint32)
331 if !ok {
332 panic(fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID))
333 }
334 return v
335}
336
337// GetUint8 returns the underlying uint8 value from the parameter.
338func (pars Params) GetUint8(name string) (uint8, error) {

Callers 3

TestAddThreadFunction · 0.80
updateSnapshottersMethod · 0.80
pushMethod · 0.80

Calls 1

findParamMethod · 0.95

Tested by 1

TestAddThreadFunction · 0.64