Documentation ¶
Overview ¶
Package proc implements a partial in-memory file system for procfs.
Index ¶
- Constants
- func GetMetadata(ctx context.Context, mm *mm.MemoryManager, buf *bytes.Buffer, t MetadataType) error
- func ParseInt32Vec(ctx context.Context, src usermem.IOSequence, buf []int32) (int64, error)
- type ExtraInternalData
- type FilesystemType
- func (ft FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, ...) (*vfs.Filesystem, *vfs.Dentry, error)
- func (FilesystemType) Name() string
- func (FilesystemType) Release(ctx context.Context)
- func (ft *FilesystemType) StateFields() []string
- func (ft *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source)
- func (ft *FilesystemType) StateSave(stateSinkObject state.Sink)
- func (ft *FilesystemType) StateTypeName() string
- type InternalData
- type MetadataType
Constants ¶
const (
// Name is the default filesystem name.
Name = "proc"
)
Variables ¶
This section is empty.
Functions ¶
func GetMetadata ¶
func GetMetadata(ctx context.Context, mm *mm.MemoryManager, buf *bytes.Buffer, t MetadataType) error
GetMetadata fetches the process's metadata of type t and writes it into buf. The process is identified by mm.
func ParseInt32Vec ¶
ParseInt32Vec interprets src as string encoding slice of int32, and returns the parsed value and the number of bytes read.
The numbers of int32 will be populated even if an error is returned eventually.
Types ¶
type ExtraInternalData ¶
type ExtraInternalData struct{}
ExtraInternalData is an empty struct that could contain extra data for the procfs.
+stateify savable
func (*ExtraInternalData) StateFields ¶
func (e *ExtraInternalData) StateFields() []string
func (*ExtraInternalData) StateLoad ¶
func (e *ExtraInternalData) StateLoad(ctx context.Context, stateSourceObject state.Source)
+checklocksignore
func (*ExtraInternalData) StateSave ¶
func (e *ExtraInternalData) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*ExtraInternalData) StateTypeName ¶
func (e *ExtraInternalData) StateTypeName() string
type FilesystemType ¶
type FilesystemType struct{}
FilesystemType is the factory class for procfs.
+stateify savable
func (FilesystemType) GetFilesystem ¶
func (ft FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, source string, opts vfs.GetFilesystemOptions) (*vfs.Filesystem, *vfs.Dentry, error)
GetFilesystem implements vfs.FilesystemType.GetFilesystem.
func (FilesystemType) Name ¶
func (FilesystemType) Name() string
Name implements vfs.FilesystemType.Name.
func (FilesystemType) Release ¶
func (FilesystemType) Release(ctx context.Context)
Release implements vfs.FilesystemType.Release.
func (*FilesystemType) StateFields ¶
func (ft *FilesystemType) StateFields() []string
func (*FilesystemType) StateLoad ¶
func (ft *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source)
+checklocksignore
func (*FilesystemType) StateSave ¶
func (ft *FilesystemType) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FilesystemType) StateTypeName ¶
func (ft *FilesystemType) StateTypeName() string
type InternalData ¶
type InternalData struct { ExtraInternalData Cgroups map[string]string }
InternalData contains internal data passed in to the procfs mount via vfs.GetFilesystemOptions.InternalData.
+stateify savable
func (*InternalData) StateFields ¶
func (i *InternalData) StateFields() []string
func (*InternalData) StateLoad ¶
func (i *InternalData) StateLoad(ctx context.Context, stateSourceObject state.Source)
+checklocksignore
func (*InternalData) StateSave ¶
func (i *InternalData) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*InternalData) StateTypeName ¶
func (i *InternalData) StateTypeName() string
type MetadataType ¶
type MetadataType int
MetadataType enumerates the types of metadata that is exposed through proc.
const ( // Cmdline represents /proc/[pid]/cmdline. Cmdline MetadataType = iota // Environ represents /proc/[pid]/environ. Environ )
Source Files ¶
- dentries_mutex.go
- fd_dir_inode_refs.go
- fd_info_dir_inode_refs.go
- filesystem.go
- proc_impl.go
- proc_impl_state_autogen.go
- proc_state_autogen.go
- subtasks.go
- subtasks_inode_refs.go
- task.go
- task_fds.go
- task_files.go
- task_inode_refs.go
- task_net.go
- tasks.go
- tasks_files.go
- tasks_inode_refs.go
- tasks_sys.go
- yama.go