Documentation ¶
Index ¶
- Constants
- func GetSignalClass(name string) *reflect.Type
- func RegisterKnownSignals()
- func RegisterSignalClass(name string, value interface{})
- type Action
- func NewEventAcceptanceAction(event Event) (Action, error)
- func NewFilesystemFaultAction(event Event) (Action, error)
- func NewNopAction(entityID string, event Event) (Action, error)
- func NewPacketFaultAction(event Event) (Action, error)
- func NewProcSetSchedAction(event Event, attrs map[string]linuxsched.SchedAttr) (Action, error)
- func NewShellAction(command string, comments map[string]interface{}) (Action, error)
- type ArrivalSignal
- type BasicAction
- type BasicEvent
- func (this *BasicEvent) DefaultAction() (Action, error)
- func (this *BasicEvent) DefaultFaultAction() (Action, error)
- func (this *BasicEvent) Deferred() bool
- func (this *BasicEvent) Equals(o Event) bool
- func (this *BasicEvent) ReplayHint() string
- func (this *BasicEvent) SetDeferred(deferred bool)
- func (this *BasicEvent) SetReplayHint(hint string)
- type BasicPBAction
- type BasicSignal
- func (this *BasicSignal) ArrivedTime() time.Time
- func (this *BasicSignal) Class() string
- func (this *BasicSignal) EntityID() string
- func (this *BasicSignal) EqualsSignal(o Signal) bool
- func (this *BasicSignal) Get(k string) interface{}
- func (this *BasicSignal) ID() string
- func (this *BasicSignal) InitSignal()
- func (this *BasicSignal) JSONMap() map[string]interface{}
- func (this *BasicSignal) LoadJSONMap(m map[string]interface{}) error
- func (this *BasicSignal) Option() map[string]interface{}
- func (this *BasicSignal) Set(k string, v interface{})
- func (this *BasicSignal) SetArrivedTime(t time.Time)
- func (this *BasicSignal) SetClass(s string)
- func (this *BasicSignal) SetEntityID(s string)
- func (this *BasicSignal) SetID(s string)
- func (this *BasicSignal) SetOption(m map[string]interface{})
- func (this *BasicSignal) SetType(s string) error
- func (this *BasicSignal) String() string
- func (this *BasicSignal) Type() string
- type CFunctionEvent
- type Event
- func NewFilesystemEvent(entityID string, op FilesystemOp, path string, m map[string]interface{}) (Event, error)
- func NewJavaFunctionEventFromPB(msg pb.InspectorMsgReq, arrivedTime time.Time) (Event, error)
- func NewNopEvent(entityID string, m map[string]interface{}) (Event, error)
- func NewPacketEvent(entityID, srcEntityID, dstEntityID string, m map[string]interface{}) (Event, error)
- func NewProcSetEvent(entityID string, procs []string, m map[string]interface{}) (Event, error)
- type EventAcceptanceAction
- type Event_JavaSpecific_Param
- type Event_JavaSpecific_StackTraceElement
- type FilesystemEvent
- type FilesystemFaultAction
- type FilesystemOp
- type FunctionEventType
- type JavaFunctionEvent
- type LogEvent
- type NopAction
- type NopEvent
- type OrchestratorSideAction
- type PBAction
- type PBEvent
- type PacketEvent
- type PacketFaultAction
- type ProcSetEvent
- type ProcSetSchedAction
- type ShellAction
- type Signal
Constants ¶
const ( // read-only ops use posthooks PostRead = "post-read" PostOpenDir = "post-opendir" // write ops use prehooks PreWrite = "pre-write" PreMkdir = "pre-mkdir" PreRmdir = "pre-rmdir" PreFsync = "pre-fsync" )
Variables ¶
This section is empty.
Functions ¶
func RegisterKnownSignals ¶
func RegisterKnownSignals()
func RegisterSignalClass ¶
func RegisterSignalClass(name string, value interface{})
Register an event class so that it can be serialized/deserialized
name is a REST JSON class name
Types ¶
type Action ¶
type Action interface { // these fields are same as in Signal ID() string EntityID() string ArrivedTime() time.Time JSONMap() map[string]interface{} String() string // comparator, excluding uuid Equals(o Action) bool // triggered time (only orchestrator should call this) TriggeredTime() time.Time // set triggered time (only orchestrator should call this) SetTriggeredTime(time.Time) // in fault actions, can be nil (but not always) Event() Event }
Action signal interface (orchestrator->inspector)
func NewPacketFaultAction ¶
func NewProcSetSchedAction ¶
func NewShellAction ¶
Execute a shell command (blocking). The action is not expected to be tied with any event.
command: shell command string
comments: arbitrary info for user-written exploration policy (not passed to the command itself). e.g., - entity_id(string): entity if that will be killed or shut down
- expected(bool): true for expected shutdown, false for unexpected kill
type ArrivalSignal ¶
type BasicAction ¶
type BasicAction struct { BasicSignal // capitalized for encoding/gob Triggered time.Time CauseEvent Event }
func (*BasicAction) Event ¶
func (this *BasicAction) Event() Event
implements Action
if only event_uuid is known, return a dummy empty event (NopEvent). this case happens when called from inspector
func (*BasicAction) SetTriggeredTime ¶
func (this *BasicAction) SetTriggeredTime(triggeredTime time.Time)
implements Action
func (*BasicAction) TriggeredTime ¶
func (this *BasicAction) TriggeredTime() time.Time
implements Action
type BasicEvent ¶
type BasicEvent struct {
BasicSignal
}
func (*BasicEvent) DefaultAction ¶
func (this *BasicEvent) DefaultAction() (Action, error)
implements Event
func (*BasicEvent) DefaultFaultAction ¶
func (this *BasicEvent) DefaultFaultAction() (Action, error)
implements Event
func (*BasicEvent) SetDeferred ¶
func (this *BasicEvent) SetDeferred(deferred bool)
func (*BasicEvent) SetReplayHint ¶
func (this *BasicEvent) SetReplayHint(hint string)
type BasicPBAction ¶
type BasicPBAction struct {
BasicAction
}
for ProtocolBuffers actions
implements Action, PBAction
func (*BasicPBAction) PBResponseMessage ¶
func (this *BasicPBAction) PBResponseMessage() *pb.InspectorMsgRsp
implements PBAction
type BasicSignal ¶
Map-based Signal interface implementation
Don't use pointer receiver for this type: https://github.com/golang/go/wiki/CodeReviewComments#receiver-type
func (*BasicSignal) ArrivedTime ¶
func (this *BasicSignal) ArrivedTime() time.Time
implements Signal
func (*BasicSignal) Class ¶
func (this *BasicSignal) Class() string
func (*BasicSignal) EqualsSignal ¶
func (this *BasicSignal) EqualsSignal(o Signal) bool
implements Signal
func (*BasicSignal) InitSignal ¶
func (this *BasicSignal) InitSignal()
func (*BasicSignal) JSONMap ¶
func (this *BasicSignal) JSONMap() map[string]interface{}
implements Signal
func (*BasicSignal) LoadJSONMap ¶
func (this *BasicSignal) LoadJSONMap(m map[string]interface{}) error
func (*BasicSignal) Option ¶
func (this *BasicSignal) Option() map[string]interface{}
func (*BasicSignal) Set ¶
func (this *BasicSignal) Set(k string, v interface{})
for non-basic fields
func (*BasicSignal) SetArrivedTime ¶
func (this *BasicSignal) SetArrivedTime(t time.Time)
func (*BasicSignal) SetClass ¶
func (this *BasicSignal) SetClass(s string)
func (*BasicSignal) SetEntityID ¶
func (this *BasicSignal) SetEntityID(s string)
func (*BasicSignal) SetID ¶
func (this *BasicSignal) SetID(s string)
func (*BasicSignal) SetOption ¶
func (this *BasicSignal) SetOption(m map[string]interface{})
func (*BasicSignal) SetType ¶
func (this *BasicSignal) SetType(s string) error
must be event or signal
type CFunctionEvent ¶
type CFunctionEvent struct { FunctionName string FunctionEventType FunctionEventType // contains filtered or unexported fields }
implements Event
not implemented yet
func (*CFunctionEvent) DefaultAction ¶
implements Event NOTE: this method should also put pb{Req,Rsp} to action.Event().
func (*CFunctionEvent) PBRequestMessage ¶
func (this *CFunctionEvent) PBRequestMessage() *pb.InspectorMsgReq
implements PBEvent
type Event ¶
type Event interface { // these fields are same as in Signal ID() string EntityID() string ArrivedTime() time.Time JSONMap() map[string]interface{} String() string // comparator, excluding uuid Equals(o Event) bool // if deferred, the inspector is waiting for an action from the orchestrator. // // json name: "deferred" Deferred() bool // explore policy can use this hash string as a hint for semi-deterministic replaying. // The hint should not contain time-dependent or random things for better determinism. // Note that we will not support fully deterministic replaying. // // The hint can contain any character. // // json name: "replay_hint" ReplayHint() string // default positive action. can be NopAction, but cannot be nil. // (NopAction is used for history storage) DefaultAction() (Action, error) // default negative action. can be nil. DefaultFaultAction() (Action, error) }
Event signal interface (inspector->orchestrator)
func NewFilesystemEvent ¶
func NewPacketEvent ¶
type EventAcceptanceAction ¶
type EventAcceptanceAction struct {
BasicPBAction
}
implements Action, PBAction
type Event_JavaSpecific_Param ¶
for Java
type Event_JavaSpecific_StackTraceElement ¶
type Event_JavaSpecific_StackTraceElement struct { LineNumber int ClassName string MethodName string FileName string }
for Java
type FilesystemEvent ¶
type FilesystemEvent struct {
BasicEvent
}
implements Event
func (*FilesystemEvent) DefaultFaultAction ¶
func (this *FilesystemEvent) DefaultFaultAction() (Action, error)
implements Event
type FilesystemOp ¶
type FilesystemOp string
type FunctionEventType ¶
type FunctionEventType int
const ( NilFunctionEventType FunctionEventType = iota FunctionCall FunctionReturn )
type JavaFunctionEvent ¶
type JavaFunctionEvent struct { FunctionName string FunctionEventType FunctionEventType ThreadName string StackTraceElements []Event_JavaSpecific_StackTraceElement Params []Event_JavaSpecific_Param // contains filtered or unexported fields }
implements Event
func (*JavaFunctionEvent) DefaultAction ¶
implements Event NOTE: this method should also put pb{Req,Rsp} to action.Event().
func (*JavaFunctionEvent) PBRequestMessage ¶
func (this *JavaFunctionEvent) PBRequestMessage() *pb.InspectorMsgReq
implements PBEvent
type NopAction ¶
type NopAction struct {
BasicAction
}
implements Action, OrchestratorSideAction
func (*NopAction) ExecuteOnOrchestrator ¶
implements OrchestratorSideAction
func (*NopAction) OrchestratorSideOnly ¶
implements OrchestratorSideAction
type OrchestratorSideAction ¶
type PBAction ¶
type PBAction interface { // can be nil, if Action.Event() does not implement PBEvent interface. PBResponseMessage() *pb.InspectorMsgRsp }
Action for inspectors that *may* use ProtocolBuffers
type PBEvent ¶
type PBEvent interface {
PBRequestMessage() *pb.InspectorMsgReq
}
Event for inspectors that *may* use ProtocolBuffers
type PacketEvent ¶
type PacketEvent struct {
BasicEvent
}
implements Event
func (*PacketEvent) DefaultFaultAction ¶
func (this *PacketEvent) DefaultFaultAction() (Action, error)
implements Event
type ProcSetEvent ¶
type ProcSetEvent struct {
BasicEvent
}
Note: DefaultAction() is NopAction, not ProcSetSchedAction implements Event
type ShellAction ¶
type ShellAction struct {
BasicAction
}
implements Action, OrchestratorSideAction
func (*ShellAction) ExecuteOnOrchestrator ¶
func (this *ShellAction) ExecuteOnOrchestrator() error
implements OrchestratorSideAction
func (*ShellAction) OrchestratorSideOnly ¶
func (this *ShellAction) OrchestratorSideOnly() bool
implements OrchestratorSideAction
type Signal ¶
type Signal interface { // RFC 4122 UUID // // json name: "uuid" ID() string // Entity ID string (e.g. "zksrv1") // // json name: "entity" EntityID() string // arrived time // // for event, only orchestrator should call this. // for action, only inspector should call this. ArrivedTime() time.Time // JSON map. PBEvent also implements this method, mainly for MongoDB storage. JSONMap() map[string]interface{} // debug string String() string }
you don't have to take care of this interface, see Event and Action