data

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalSize

func CanonicalSize(size uint64) string

CanonicalSize converts a number of Bytes into a human readable quantity (ie. 10M)

func ParseMap

func ParseMap(pid string, entries EntryMap)

ParseMap gets all of the entries for a specific map

Types

type EntryMap

type EntryMap map[string]*FileEntry

EntryMap maps unique IDs (DeviceID:Inode) to their respective FileEntry

func ParseMaps

func ParseMaps() EntryMap

ParseMaps gathers all of the file entries from every process

type FileEntry

type FileEntry struct {
	// Name is the complete filepath of this file
	Name string
	// Weight is a relative score for this File's usage and size
	Weight uint64
	// Total memory used by mapping this file
	Total uint64
	// Sizes is a mapping of memory permissions to SizeEntries
	Sizes map[string]*SizeEntry
}

FileEntry is a struct representing a single mapped file

func (*FileEntry) Increment

func (f *FileEntry) Increment(startAddress, endAddress, permissions string)

Increment entry by new address range

func (*FileEntry) Print

func (f *FileEntry) Print()

Print summarizes the stats related to a FileEntry

type SizeEntry

type SizeEntry struct {
	// Size is the memory allocated for this permission set
	Size uint64
	// Refs is a count of the number of processes with this range mapped
	Refs uint64
}

SizeEntry is a struct representing the size and frequency of use for a mapped region corresponding to FileEntry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL