threadMapValuer returns the map valuer with thread information.
(segments []*BoundSegmentLiteral, thread pstypes.Thread)
| 504 | |
| 505 | // threadMapValuer returns the map valuer with thread information. |
| 506 | func (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. |
| 529 | func (f *Foreach) mmapMapValuer(segments []*BoundSegmentLiteral, mmap pstypes.Mmap) MapValuer { |