Documentation ¶
Index ¶
- Constants
- func GetDumpStats(dir string) (*stats.DumpStatsEntry, error)
- func GetRestoreStats(dir string) (*stats.RestoreStatsEntry, error)
- func ReadMagic(f *os.File) (string, error)
- type Critter
- type CriuEntry
- type CriuImage
- type Fd
- type File
- type Mem
- type MemMap
- type MemoryReader
- func (mr *MemoryReader) GetMemPages(start, end uint64) (*bytes.Buffer, error)
- func (mr *MemoryReader) GetPagemapEntries() []*pagemap.PagemapEntry
- func (mr *MemoryReader) GetPagesID() uint32
- func (mr *MemoryReader) GetPsArgs() (*bytes.Buffer, error)
- func (mr *MemoryReader) GetPsEnvVars() (*bytes.Buffer, error)
- func (mr *MemoryReader) GetShmemSize() (int64, error)
- type PsTree
- type Rss
- type RssMap
- type Sk
- type Socket
- type Vma
Constants ¶
const ( StatsDump = "stats-dump" StatsRestore = "stats-restore" )
Variables ¶
This section is empty.
Functions ¶
func GetDumpStats ¶
func GetDumpStats(dir string) (*stats.DumpStatsEntry, error)
GetDumpStats returns the dump statistics of a checkpoint. dir is the path to the directory with the checkpoint images.
func GetRestoreStats ¶
func GetRestoreStats(dir string) (*stats.RestoreStatsEntry, error)
GetRestoreStats returns the restore statistics of a checkpoint. dir is the path to the directory with the checkpoint images.
Types ¶
type Critter ¶
type Critter interface { // Read binary image file into Go struct (decode.go) Decode(proto.Message) (*CriuImage, error) // Read only counts of image file entries into Go struct Info() (*CriuImage, error) // Read JSON into Go struct Parse(proto.Message) (*CriuImage, error) // Write JSON to binary image file (encode.go) Encode(*CriuImage) error // Explore process information (explore.go) ExplorePs() (*PsTree, error) ExploreFds() ([]*Fd, error) ExploreMems() ([]*MemMap, error) ExploreRss() ([]*RssMap, error) ExploreSk() ([]*Sk, error) }
Critter is the interface that wraps all CRIT operations. To create a CRIT service instance, use New().
type CriuEntry ¶
CriuEntry represents a single entry in an image
func (*CriuEntry) MarshalJSON ¶
MarshalJSON is the marshaler for CriuEntry. This is required as protojson.Marshal is used for the proto.Message, and any extra data is manually appended to the entry
type CriuImage ¶
type CriuImage struct { Magic string `json:"magic"` Entries []*CriuEntry `json:"entries"` EntryType proto.Message `json:"-"` }
CriuImage represents a CRIU binary image file
func (*CriuImage) UnmarshalJSON ¶
UnmarshalJSON is the unmarshaler for CriuImage. This is required as the object must be checked for any extra data, which must be removed from the JSON byte stream before unmarshaling the remaining bytes into a proto.Message object
type File ¶
type File struct { Fd string `json:"fd"` Type string `json:"type,omitempty"` Path string `json:"path"` }
File represents a single opened file
type Mem ¶
type Mem struct { Start string `json:"start"` End string `json:"end"` Protection string `json:"protection"` Resource string `json:"resource,omitempty"` }
Mem represents the memory mapping of a single file
type MemMap ¶
type MemMap struct { PId uint32 `json:"pid"` Exe string `json:"exe"` Mems []*Mem `json:"mems,omitempty"` }
MemMap represents the memory mapping of a single process
type MemoryReader ¶
type MemoryReader struct {
// contains filtered or unexported fields
}
MemoryReader is a struct used to retrieve the content of memory associated with a specific process ID (pid). New instances should be created with NewMemoryReader()
func NewMemoryReader ¶
func NewMemoryReader(checkpointDir string, pid uint32, pageSize int) (*MemoryReader, error)
NewMemoryReader creates a new instance of MemoryReader with all the fields populated
func (*MemoryReader) GetMemPages ¶
func (mr *MemoryReader) GetMemPages(start, end uint64) (*bytes.Buffer, error)
GetMemPages retrieves the content of memory pages associated with a given process ID (pid). It retrieves the memory content within the specified range defined by the start and end addresses.
func (*MemoryReader) GetPagemapEntries ¶
func (mr *MemoryReader) GetPagemapEntries() []*pagemap.PagemapEntry
func (*MemoryReader) GetPagesID ¶
func (mr *MemoryReader) GetPagesID() uint32
func (*MemoryReader) GetPsArgs ¶
func (mr *MemoryReader) GetPsArgs() (*bytes.Buffer, error)
GetPsArgs retrieves process arguments from memory pages
func (*MemoryReader) GetPsEnvVars ¶
func (mr *MemoryReader) GetPsEnvVars() (*bytes.Buffer, error)
GetPsArgs retrieves process environment variables from memory pages.
func (*MemoryReader) GetShmemSize ¶
func (mr *MemoryReader) GetShmemSize() (int64, error)
GetShmemSize calculates and returns the size of shared memory used by the process.
type PsTree ¶
type PsTree struct { PID uint32 `json:"pid"` PgID uint32 `json:"pgid"` SID uint32 `json:"sid"` Comm string `json:"comm"` Process *pstree.PstreeEntry `json:"-"` Core *criu_core.CoreEntry `json:"-"` Children []*PsTree `json:"children,omitempty"` }
PsTree represents the process tree
type Rss ¶
type Rss struct { PhyAddr string `json:"phy_addr,omitempty"` PhyPages int64 `json:"phy_pages,omitempty"` Vmas []*Vma `json:"vmas,omitempty"` Resource string `json:"resource,omitempty"` }
Rss represents a single resident set size mapping
type RssMap ¶
type RssMap struct { PId uint32 `json:"pid"` /* walrus -> walruses radius -> radii If you code without breaks, rss -> rsi :P */ Rsses []*Rss `json:"rss,omitempty"` }
RssMap represents the resident set size mapping of a single process
type Socket ¶
type Socket struct { Fd uint32 `json:"fd"` FdType string `json:"fd_type"` Family string `json:"family,omitempty"` Protocol string `json:"protocol,omitempty"` Type string `json:"type,omitempty"` State string `json:"state,omitempty"` SrcAddr string `json:"src_addr,omitempty"` SrcPort uint32 `json:"src_port,omitempty"` DestAddr string `json:"dest_addr,omitempty"` DestPort uint32 `json:"dest_port,omitempty"` SendBuf string `json:"send_buf,omitempty"` RecvBuf string `json:"recv_buf,omitempty"` }
Socket represents a single socket