package crit
import "github.com/checkpoint-restore/go-criu/v6/crit"
Index ¶
- Constants
- func GetDumpStats(dir string) (*images.DumpStatsEntry, error)
- func GetRestoreStats(dir string) (*images.RestoreStatsEntry, error)
- type CritSvc
- func New( inputFilePath, outputFilePath, inputDirPath string, pretty, noPayload bool, ) CritSvc
- func NewCli( inputFilePath, outputFilePath, inputDirPath string, pretty, noPayload bool, ) CritSvc
- type CriuEntry
- type CriuImage
- type Fd
- type File
- type Mem
- type MemMap
- type PsTree
- type Rss
- type RssMap
- type Vma
Constants ¶
const ( StatsDump = "stats-dump" StatsRestore = "stats-restore" )
Functions ¶
func GetDumpStats ¶
func GetDumpStats(dir string) (*images.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) (*images.RestoreStatsEntry, error)
GetRestoreStats returns the restore statistics of a checkpoint. dir is the path to the directory with the checkpoint images.
Types ¶
type CritSvc ¶
type CritSvc interface { // Read binary image file into Go struct (decode.go) Decode() (*CriuImage, error) // Read only counts of image file entries into Go struct Info() (*CriuImage, error) // Read JSON into Go struct Parse() (*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) }
CritSvc is the interface that wraps all CRIT operations. To create a CRIT service instance, use New().
func New ¶
New creates a CRIT service to use in a Go program
func NewCli ¶
NewCli creates a CRIT service to use in a CLI app. All functions called by this service will wait for input from stdin if an input path is not provided.
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 ¶
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 Fd ¶
Fd represents the file descriptors opened in a single process
type File ¶
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 PsTree ¶
type PsTree struct { PId uint32 `json:"pId"` PgId uint32 `json:"pgId"` SId uint32 `json:"sId"` Comm string `json:"comm"` Process *images.PstreeEntry `json:"-"` Core *images.CoreEntry `json:"-"` Children []*PsTree `json:"children,omitempty"` }
PsTree represents the process tree
type Rss ¶
type Rss struct { PhyAddr string `json:"phyAddr,omitempty"` PhyPages int64 `json:"phyPages,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 Vma ¶
Vma represents a single virtual memory area
Source Files ¶
crit.go decode-extra.go decode.go encode-extra.go encode.go explore.go image.go stats.go utils.go
Directories ¶
Path | Synopsis |
---|---|
crit/cmd | |
crit/images |
- Version
- v6.3.0 (latest)
- Published
- Oct 11, 2022
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 6 days ago –
Tools for package owners.