Documentation ¶
Index ¶
Constants ¶
const ( TrampolineJumpIfDesc = "/* TRAMPOLINE_JUMP_IF */" TrampolineJumpIfDescRegexp = "/\\* TRAMPOLINE_JUMP_IF \\*/" TrampolineNoNewlinePlaceholder = "/* NO_NEWWLINE_PLACEHOLDER */" TrampolineNoNewlinePlaceholderRegexp = "/\\* NO_NEWWLINE_PLACEHOLDER \\*/\n" TrampolineSemicolonPlaceholder = "/* SEMICOLON_PLACEHOLDER */" TrampolineSemicolonPlaceholderRegexp = "/\\* SEMICOLON_PLACEHOLDER \\*/\n" )
const ( OtelAPIFile = "otel_api.go" OtelTrampolineFile = "otel_trampoline.go" )
const ( TrampolineSetParamName = "SetParam" TrampolineGetParamName = "GetParam" TrampolineSetReturnValName = "SetReturnVal" TrampolineGetReturnValName = "GetReturnVal" TrampolineValIdentifier = "val" TrampolineCtxIdentifier = "c" TrampolineParamsIdentifier = "Params" TrampolineReturnValsIdentifier = "ReturnVals" TrampolineSkipName = "skip" TrampolineCallContextName = "callContext" TrampolineCallContextType = "CallContext" TrampolineCallContextImplType = "CallContextImpl" TrampolineOnEnterName = "OtelOnEnterTrampoline" TrampolineOnExitName = "OtelOnExitTrampoline" TrampolineOnEnterNamePlaceholder = "\"OtelOnEnterNamePlaceholder\"" TrampolineOnExitNamePlaceholder = "\"OtelOnExitNamePlaceholder\"" )
----------------------------------------------------------------------------- Trampoline Jump
We distinguish between three types of functions: RawFunc, TrampolineFunc, and HookFunc. RawFunc is the original function that needs to be instrumented. TrampolineFunc is the function that is generated to call the onEnter and onExit hooks, it serves as a trampoline to the original function. HookFunc is the function that is called at entrypoint and exitpoint of the RawFunc. The so-called "Trampoline Jump" snippet is inserted at start of raw func, it is guaranteed to be generated within one line to avoid confusing debugging, as its name suggests, it jumps to the trampoline function from raw function.
Variables ¶
This section is empty.
Functions ¶
func Instrument ¶
func Instrument() error
Types ¶
type ParamTrait ¶
type RuleProcessor ¶
type RuleProcessor struct {
// contains filtered or unexported fields
}