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

Method threadMapValuer

pkg/filter/ql/function.go:506–526  ·  view source on GitHub ↗

threadMapValuer returns the map valuer with thread information.

(segments []*BoundSegmentLiteral, thread pstypes.Thread)

Source from the content-addressed store, hash-verified

504
505// threadMapValuer returns the map valuer with thread information.
506func (f *Foreach) threadMapValuer(segments []*BoundSegmentLiteral, thread pstypes.Thread) MapValuer {
507 var valuer = MapValuer{}
508 for _, seg := range segments {
509 key := seg.Value
510 switch seg.Segment {
511 case fields.TidSegment:
512 valuer[key] = thread.Tid
513 case fields.StartAddressSegment:
514 valuer[key] = thread.StartAddress.String()
515 case fields.UserStackBaseSegment:
516 valuer[key] = thread.UstackBase.String()
517 case fields.UserStackLimitSegment:
518 valuer[key] = thread.UstackLimit.String()
519 case fields.KernelStackBaseSegment:
520 valuer[key] = thread.KstackBase.String()
521 case fields.KernelStackLimitSegment:
522 valuer[key] = thread.KstackLimit.String()
523 }
524 }
525 return valuer
526}
527
528// mmapMapValuer returns map valuer with memory mapping details.
529func (f *Foreach) mmapMapValuer(segments []*BoundSegmentLiteral, mmap pstypes.Mmap) MapValuer {

Callers 1

CallMethod · 0.95

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected