reap

package
v0.0.0-...-6d47f5a Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activate

func Activate(req *http.Request, id string) error

func AlignedBlock

func AlignedBlock(blockSize int) []byte

AlignedBlock returns []byte of size BlockSize aligned to a multiple of alignSize in memory (must be power of two)

func ClearCache

func ClearCache(ctx context.Context, ssId string) error

func Deactivate

func Deactivate(id string) ([]uint64, error)

func RandStringRunes

func RandStringRunes(n int) string

func Register

func Register(ctx context.Context, ssId string, baseDir string, vmmStatePath string, guestMemPath string, memSize int, wsFileDirectIO, wsSingleRead bool) (string, error)

func Setup

func Setup()

Types

type MemoryManager

type MemoryManager struct {
	sync.Mutex
	MemoryManagerCfg
	// contains filtered or unexported fields
}

MemoryManager Serves page faults coming from VMs

func NewMemoryManager

func NewMemoryManager(cfg MemoryManagerCfg) *MemoryManager

NewMemoryManager Initializes a new memory manager

func (*MemoryManager) Activate

func (m *MemoryManager) Activate(ctx context.Context, vmID string) error

Activate Creates an epoller to serve page faults for the VM

func (*MemoryManager) ClearCache

func (m *MemoryManager) ClearCache(ssId string) error

func (*MemoryManager) Deactivate

func (m *MemoryManager) Deactivate(vmID string) ([]uint64, error)

Deactivate Removes the epoller which serves page faults for the VM

func (*MemoryManager) DeregisterVM

func (m *MemoryManager) DeregisterVM(vmID string) error

DeregisterVM Deregisters a VM from the memory manager

func (*MemoryManager) DumpUPFLatencyStats

func (m *MemoryManager) DumpUPFLatencyStats(vmID, functionName, latencyOutFilePath string) error

DumpUPFLatencyStats Dumps latency stats collected for the VM

func (*MemoryManager) DumpUPFPageStats

func (m *MemoryManager) DumpUPFPageStats(vmID, functionName, metricsOutFilePath string) error

DumpUPFPageStats Saves the per VM stats

func (*MemoryManager) FetchState

func (m *MemoryManager) FetchState(ctx context.Context, vmID string) error

FetchState Fetches the working set file (or the whole guest memory) and the VMM state file

func (*MemoryManager) GetUPFLatencyStats

func (m *MemoryManager) GetUPFLatencyStats(vmID string) ([]*metrics.Metric, error)

GetUPFLatencyStats Returns the gathered metrics for the VM

func (*MemoryManager) RegisterVM

func (m *MemoryManager) RegisterVM(ssId, vmmStatePath, guestMemPath, baseDir string, memSize int, wsFileDirectIO bool, wsSingleRead bool) (string, error)

RegisterVM Registers a VM within the memory manager

type MemoryManagerCfg

type MemoryManagerCfg struct {
	MetricsModeOn bool
}

MemoryManagerCfg Global config of the manager

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record A tuple with an address

type SnapshotState

type SnapshotState struct {
	SnapshotStateCfg
	// contains filtered or unexported fields
}

SnapshotState Stores the state of the snapshot of the VM.

func NewSnapshotState

func NewSnapshotState(cfg SnapshotStateCfg) *SnapshotState

NewSnapshotState Initializes a snapshot state

type SnapshotStateCfg

type SnapshotStateCfg struct {
	VMID string

	VMMStatePath, GuestMemPath, WorkingSetPath string

	InstanceSockAddr string
	BaseDir          string // base directory for the instance
	MetricsPath      string // path to csv file where the metrics should be stored
	IsLazyMode       bool
	GuestMemSize     int

	WSFileDirectIO bool
	WSSingleRead   bool
	// contains filtered or unexported fields
}

SnapshotStateCfg Config to initialize SnapshotState

type Trace

type Trace struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Trace Contains records

func (*Trace) AppendRecord

func (t *Trace) AppendRecord(r Record)

AppendRecord Appends a record to the trace

func (*Trace) ProcessRecord

func (t *Trace) ProcessRecord(GuestMemPath, WorkingSetPath string)

ProcessRecord Prepares the trace, the regions map, and the working set file for replay Must be called when record is done (i.e., it is not concurrency-safe vs. AppendRecord)

func (*Trace) WriteTrace

func (t *Trace) WriteTrace()

WriteTrace Writes all the records to a file

Jump to

Keyboard shortcuts

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