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

Method moduleMapValuer

pkg/filter/ql/function.go:448–466  ·  view source on GitHub ↗

moduleMapValuer returns the map valuer with process module attributes.

(segments []*BoundSegmentLiteral, mod pstypes.Module)

Source from the content-addressed store, hash-verified

446
447// moduleMapValuer returns the map valuer with process module attributes.
448func (f *Foreach) moduleMapValuer(segments []*BoundSegmentLiteral, mod pstypes.Module) MapValuer {
449 var valuer = MapValuer{}
450 for _, seg := range segments {
451 key := seg.Value
452 switch seg.Segment {
453 case fields.PathSegment:
454 valuer[key] = mod.Name
455 case fields.NameSegment:
456 valuer[key] = filepath.Base(mod.Name)
457 case fields.AddressSegment:
458 valuer[key] = mod.BaseAddress.String()
459 case fields.SizeSegment:
460 valuer[key] = mod.Size
461 case fields.ChecksumSegment:
462 valuer[key] = mod.Checksum
463 }
464 }
465 return valuer
466}
467
468// procMapValuer returns the map valuer with process attributes.
469func (f *Foreach) procMapValuer(segments []*BoundSegmentLiteral, proc *pstypes.PS) MapValuer {

Callers 1

CallMethod · 0.95

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected