ftrace

package
v0.1908240011.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadEvent error = errors.New("Bad event name")
View Source
var BadEventData error = errors.New("Bad event data")
View Source
var BadFtraceFileName error = errors.New("Bad file name")
View Source
var BadPageHeader = errors.New("Bad page header")
View Source
var BadProcFileName error = errors.New("Bad file name")

Functions

func NewRecordingFileProvider

func NewRecordingFileProvider(fp FileProvider) *recordingFileProvider

func SafeFtracePath

func SafeFtracePath(path string) bool

Utility functions

func SafeProcPath

func SafeProcPath(path string) bool

Types

type BadEventHeader

type BadEventHeader struct {
	What   string
	Page   []byte
	Offset int
}

func (BadEventHeader) Error

func (e BadEventHeader) Error() string

type Event

type Event struct {
	Cpu     int
	When    uint64
	Pid     int
	Flags   uint
	Preempt int
	// contains filtered or unexported fields
}

func (Event) Contents

func (e Event) Contents() []byte

func (Event) Etype

func (e Event) Etype() *EventType

func (Event) FlagChars

func (e Event) FlagChars() string

func (Event) GetCpu added in v0.1908162349.0

func (e Event) GetCpu() uint64

func (Event) GetField

func (e Event) GetField(name string) interface{}

func (Event) GetName added in v0.1908162349.0

func (e Event) GetName() string

func (Event) GetPid added in v0.1908162349.0

func (e Event) GetPid() uint64

GetPid actually returns the tgid, an atsu-specific field

func (Event) GetWhen added in v0.1908162349.0

func (e Event) GetWhen() uint64

func (Event) Microseconds

func (e Event) Microseconds() int

func (Event) ProcessName

func (e Event) ProcessName() string

func (Event) Seconds

func (e Event) Seconds() int

func (*Event) SetFtrace

func (e *Event) SetFtrace(f *Ftrace)

func (Event) String

func (e Event) String() string

type EventType

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

func NewHeaderType

func NewHeaderType(fp FileProvider, path string) (*EventType, error)

func (*EventType) DecodeEvent

func (etype *EventType) DecodeEvent(data []byte, cpu int, when uint64) (*Event, error)

func (*EventType) Disable

func (etype *EventType) Disable() error

func (*EventType) Enable

func (etype *EventType) Enable() error

func (*EventType) Format

func (etype *EventType) Format(e Event) string

func (EventType) GetFunction

func (etype EventType) GetFunction(name string) cparse.Function

func (EventType) GetType

func (etype EventType) GetType(name string) string

func (EventType) GetVariable

func (etype EventType) GetVariable(name string) cparse.Variable

func (*EventType) Id

func (etype *EventType) Id() int

func (*EventType) Name

func (etype *EventType) Name() string

type Events

type Events []*Event

func (Events) HasEventType

func (e Events) HasEventType(etype *EventType) bool

func (Events) Len

func (e Events) Len() int

func (Events) Swap

func (e Events) Swap(i, j int)

type EventsByTime

type EventsByTime struct{ Events }

func (EventsByTime) Less

func (e EventsByTime) Less(i, j int) bool

type FileProvider

type FileProvider interface {
	ReadFtraceFile(string) ([]byte, error)
	WriteFtraceFile(string, []byte) error
	ReadProcFile(string) ([]byte, error)
	OpenFtrace(string) (io.ReadCloser, error)
}

func NewLocalFileProvider

func NewLocalFileProvider() FileProvider

func NewTestFileProvider

func NewTestFileProvider(files map[string]string) FileProvider

type Ftrace

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

func New

func New(fp FileProvider) (*Ftrace, error)

func (*Ftrace) Capture

func (f *Ftrace) Capture(callback func(Events))

func (*Ftrace) Clear

func (f *Ftrace) Clear() error

func (*Ftrace) Disable

func (f *Ftrace) Disable() error

func (*Ftrace) Enable

func (f *Ftrace) Enable() error

func (*Ftrace) NewEventType

func (f *Ftrace) NewEventType(name string, path string) (*EventType, error)

func (*Ftrace) PrepareCapture

func (f *Ftrace) PrepareCapture(cpus int, doneCh <-chan bool) error

func (*Ftrace) ReadKernelTrace

func (f *Ftrace) ReadKernelTrace() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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