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

Method mmapMapValuer

pkg/filter/ql/function.go:529–547  ·  view source on GitHub ↗

mmapMapValuer returns map valuer with memory mapping details.

(segments []*BoundSegmentLiteral, mmap pstypes.Mmap)

Source from the content-addressed store, hash-verified

527
528// mmapMapValuer returns map valuer with memory mapping details.
529func (f *Foreach) mmapMapValuer(segments []*BoundSegmentLiteral, mmap pstypes.Mmap) MapValuer {
530 var valuer = MapValuer{}
531 for _, seg := range segments {
532 key := seg.Value
533 switch seg.Segment {
534 case fields.AddressSegment:
535 valuer[key] = mmap.BaseAddress.String()
536 case fields.SizeSegment:
537 valuer[key] = mmap.Size
538 case fields.ProtectionSegment:
539 valuer[key] = mmap.ProtectMask()
540 case fields.TypeSegment:
541 valuer[key] = mmap.Type
542 case fields.PathSegment:
543 valuer[key] = mmap.File
544 }
545 }
546 return valuer
547}
548
549// callstackMapValuer returns map valuer with thread stack frame data.
550func (f *Foreach) callstackMapValuer(segments []*BoundSegmentLiteral, frame callstack.Frame, proc windows.Handle) MapValuer {

Callers 1

CallMethod · 0.95

Calls 2

StringMethod · 0.65
ProtectMaskMethod · 0.45

Tested by

no test coverage detected