Documentation ¶
Index ¶
- Variables
- type Attributes
- type Breakpoints
- func (b Breakpoints) Clear(addr uint64) error
- func (b Breakpoints) ClearAllByGoRoutineID(goRoutineID int64) error
- func (b Breakpoints) ClearConditional(addr uint64, goRoutineID int64) error
- func (b Breakpoints) Exist(addr uint64) bool
- func (b Breakpoints) Hit(addr uint64, goRoutineID int64) bool
- func (b Breakpoints) Set(addr uint64) error
- func (b Breakpoints) SetConditional(addr uint64, goRoutineID int64) error
- type Controller
- func (c *Controller) AddEndTracePoint(endAddr uint64) error
- func (c *Controller) AddStartTracePoint(startAddr uint64) error
- func (c *Controller) AttachTracee(pid int, attrs Attributes) error
- func (c *Controller) Interrupt()
- func (c *Controller) LaunchTracee(name string, arg []string, attrs Attributes) error
- func (c *Controller) MainLoop() error
- func (c *Controller) SetParseLevel(level int)
- func (c *Controller) SetTraceLevel(level int)
Constants ¶
This section is empty.
Variables ¶
var ErrInterrupted = errors.New("interrupted")
ErrInterrupted indicates the tracer is interrupted due to the Interrupt() call.
Functions ¶
This section is empty.
Types ¶
type Breakpoints ¶
type Breakpoints struct {
// contains filtered or unexported fields
}
Breakpoints manages the breakpoints. The breakpoint can be conditional, which means the breakpoint is considered as hit only when the specific conditions are met.
func NewBreakpoints ¶
func NewBreakpoints(setBreakpiont, clearBreakpiont func(addr uint64) error) Breakpoints
NewBreakpoints returns new Breakpoints. Pass the functions to actually set and clear breakpoints.
func (Breakpoints) Clear ¶
func (b Breakpoints) Clear(addr uint64) error
Clear clears the breakpoint at the specified address. Conditonal breakpoints for the same address are also cleared.
func (Breakpoints) ClearAllByGoRoutineID ¶
func (b Breakpoints) ClearAllByGoRoutineID(goRoutineID int64) error
ClearAllByGoRoutineID clears all the breakpoints associated with the specified go routine.
func (Breakpoints) ClearConditional ¶
func (b Breakpoints) ClearConditional(addr uint64, goRoutineID int64) error
ClearConditional clears the conditional breakpoint for the specified address and go routine. The physical breakpoint for the specified address may still exist if other conditional breakpoints specify to that address.
func (Breakpoints) Exist ¶
func (b Breakpoints) Exist(addr uint64) bool
Exist returns true if the breakpoint exists.
func (Breakpoints) Hit ¶
func (b Breakpoints) Hit(addr uint64, goRoutineID int64) bool
Hit returns true if the breakpoint is not conditional or the condtional breakpoint meets its condition.
func (Breakpoints) Set ¶
func (b Breakpoints) Set(addr uint64) error
Set sets the breakpoint at the specified address. If `SetConditional` is called before for the same address, the conditions are removed.
func (Breakpoints) SetConditional ¶
func (b Breakpoints) SetConditional(addr uint64, goRoutineID int64) error
SetConditional sets the conditional breakpoint which only the specified go routine is considered as hit. If `Set` is called before for the same address, this function is no-op.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller controls the associated tracee process.
func (*Controller) AddEndTracePoint ¶
func (c *Controller) AddEndTracePoint(endAddr uint64) error
AddEndTracePoint adds the ending point of the tracing. The tracing is disabled when any go routine executes any of these addresses.
func (*Controller) AddStartTracePoint ¶
func (c *Controller) AddStartTracePoint(startAddr uint64) error
AddStartTracePoint adds the starting point of the tracing. The go routines which executed one of these addresses start to be traced.
func (*Controller) AttachTracee ¶
func (c *Controller) AttachTracee(pid int, attrs Attributes) error
AttachTracee attaches to the existing process.
func (*Controller) LaunchTracee ¶
func (c *Controller) LaunchTracee(name string, arg []string, attrs Attributes) error
LaunchTracee launches the new tracee process to be controlled.
func (*Controller) MainLoop ¶
func (c *Controller) MainLoop() error
MainLoop repeatedly lets the tracee continue and then wait an event. It returns ErrInterrupted error if the trace ends due to the interrupt.
func (*Controller) SetParseLevel ¶
func (c *Controller) SetParseLevel(level int)
SetParseLevel sets the parsing level, which determines how deeply the parser parses the value of args.
func (*Controller) SetTraceLevel ¶
func (c *Controller) SetTraceLevel(level int)
SetTraceLevel set the tracing level, which determines whether to print the traced info of the functions. The traced info is printed if the function is (directly or indirectly) called by the trace point function AND the stack depth is within the `level`. The depth here is the relative value from the point the tracing starts.