Versions in this module Expand all Collapse all v0 v0.10.1 Jun 27, 2023 v0.10.0 Jun 26, 2023 Changes in this version + const InstructionSize + const PseudoCall + const PseudoFunc + const PseudoKfuncCall + const PseudoMapFD + const PseudoMapValue + var ErrUnreferencedSymbol = errors.New("unreferenced symbol") + var ErrUnsatisfiedMapReference = errors.New("unsatisfied map reference") + var ErrUnsatisfiedProgramReference = errors.New("unsatisfied program reference") + func IsUnreferencedSymbol(err error) bool + type ALUOp uint8 + const Add + const And + const ArSh + const Div + const InvalidALUOp + const LSh + const Mod + const Mov + const Mul + const Neg + const Or + const RSh + const Sub + const Swap + const Xor + func (i ALUOp) String() string + func (op ALUOp) Imm(dst Register, value int32) Instruction + func (op ALUOp) Imm32(dst Register, value int32) Instruction + func (op ALUOp) Op(source Source) OpCode + func (op ALUOp) Op32(source Source) OpCode + func (op ALUOp) Reg(dst, src Register) Instruction + func (op ALUOp) Reg32(dst, src Register) Instruction + type BuiltinFunc int32 + const FnBind + const FnBprmOptsSet + const FnBtfFindByNameKind + const FnCgrpStorageDelete + const FnCgrpStorageGet + const FnCheckMtu + const FnCloneRedirect + const FnCopyFromUser + const FnCopyFromUserTask + const FnCsumDiff + const FnCsumLevel + const FnCsumUpdate + const FnCurrentTaskUnderCgroup + const FnDPath + const FnDynptrData + const FnDynptrFromMem + const FnDynptrRead + const FnDynptrWrite + const FnFibLookup + const FnFindVma + const FnForEachMapElem + const FnGetAttachCookie + const FnGetBranchSnapshot + const FnGetCgroupClassid + const FnGetCurrentAncestorCgroupId + const FnGetCurrentCgroupId + const FnGetCurrentComm + const FnGetCurrentPidTgid + const FnGetCurrentTask + const FnGetCurrentTaskBtf + const FnGetCurrentUidGid + const FnGetFuncArg + const FnGetFuncArgCnt + const FnGetFuncIp + const FnGetFuncRet + const FnGetHashRecalc + const FnGetListenerSock + const FnGetLocalStorage + const FnGetNetnsCookie + const FnGetNsCurrentPidTgid + const FnGetNumaNodeId + const FnGetPrandomU32 + const FnGetRetval + const FnGetRouteRealm + const FnGetSmpProcessorId + const FnGetSocketCookie + const FnGetSocketUid + const FnGetStack + const FnGetStackid + const FnGetTaskStack + const FnGetsockopt + const FnImaFileHash + const FnImaInodeHash + const FnInodeStorageDelete + const FnInodeStorageGet + const FnJiffies64 + const FnKallsymsLookupName + const FnKptrXchg + const FnKtimeGetBootNs + const FnKtimeGetCoarseNs + const FnKtimeGetNs + const FnKtimeGetTaiNs + const FnL3CsumReplace + const FnL4CsumReplace + const FnLoadHdrOpt + const FnLoop + const FnLwtPushEncap + const FnLwtSeg6Action + const FnLwtSeg6AdjustSrh + const FnLwtSeg6StoreBytes + const FnMapDeleteElem + const FnMapLookupElem + const FnMapLookupPercpuElem + const FnMapPeekElem + const FnMapPopElem + const FnMapPushElem + const FnMapUpdateElem + const FnMsgApplyBytes + const FnMsgCorkBytes + const FnMsgPopData + const FnMsgPullData + const FnMsgPushData + const FnMsgRedirectHash + const FnMsgRedirectMap + const FnOverrideReturn + const FnPerCpuPtr + const FnPerfEventOutput + const FnPerfEventRead + const FnPerfEventReadValue + const FnPerfProgReadValue + const FnProbeRead + const FnProbeReadKernel + const FnProbeReadKernelStr + const FnProbeReadStr + const FnProbeReadUser + const FnProbeReadUserStr + const FnProbeWriteUser + const FnRcKeydown + const FnRcPointerRel + const FnRcRepeat + const FnReadBranchRecords + const FnRedirect + const FnRedirectMap + const FnRedirectNeigh + const FnRedirectPeer + const FnReserveHdrOpt + const FnRingbufDiscard + const FnRingbufDiscardDynptr + const FnRingbufOutput + const FnRingbufQuery + const FnRingbufReserve + const FnRingbufReserveDynptr + const FnRingbufSubmit + const FnRingbufSubmitDynptr + const FnSendSignal + const FnSendSignalThread + const FnSeqPrintf + const FnSeqPrintfBtf + const FnSeqWrite + const FnSetHash + const FnSetHashInvalid + const FnSetRetval + const FnSetsockopt + const FnSkAncestorCgroupId + const FnSkAssign + const FnSkCgroupId + const FnSkFullsock + const FnSkLookupTcp + const FnSkLookupUdp + const FnSkRedirectHash + const FnSkRedirectMap + const FnSkRelease + const FnSkSelectReuseport + const FnSkStorageDelete + const FnSkStorageGet + const FnSkbAdjustRoom + const FnSkbAncestorCgroupId + const FnSkbCgroupClassid + const FnSkbCgroupId + const FnSkbChangeHead + const FnSkbChangeProto + const FnSkbChangeTail + const FnSkbChangeType + const FnSkbEcnSetCe + const FnSkbGetTunnelKey + const FnSkbGetTunnelOpt + const FnSkbGetXfrmState + const FnSkbLoadBytes + const FnSkbLoadBytesRelative + const FnSkbOutput + const FnSkbPullData + const FnSkbSetTstamp + const FnSkbSetTunnelKey + const FnSkbSetTunnelOpt + const FnSkbStoreBytes + const FnSkbUnderCgroup + const FnSkbVlanPop + const FnSkbVlanPush + const FnSkcLookupTcp + const FnSkcToMptcpSock + const FnSkcToTcp6Sock + const FnSkcToTcpRequestSock + const FnSkcToTcpSock + const FnSkcToTcpTimewaitSock + const FnSkcToUdp6Sock + const FnSkcToUnixSock + const FnSnprintf + const FnSnprintfBtf + const FnSockFromFile + const FnSockHashUpdate + const FnSockMapUpdate + const FnSockOpsCbFlagsSet + const FnSpinLock + const FnSpinUnlock + const FnStoreHdrOpt + const FnStrncmp + const FnStrtol + const FnStrtoul + const FnSysBpf + const FnSysClose + const FnSysctlGetCurrentValue + const FnSysctlGetName + const FnSysctlGetNewValue + const FnSysctlSetNewValue + const FnTailCall + const FnTaskPtRegs + const FnTaskStorageDelete + const FnTaskStorageGet + const FnTcpCheckSyncookie + const FnTcpGenSyncookie + const FnTcpRawCheckSyncookieIpv4 + const FnTcpRawCheckSyncookieIpv6 + const FnTcpRawGenSyncookieIpv4 + const FnTcpRawGenSyncookieIpv6 + const FnTcpSendAck + const FnTcpSock + const FnThisCpuPtr + const FnTimerCancel + const FnTimerInit + const FnTimerSetCallback + const FnTimerStart + const FnTracePrintk + const FnTraceVprintk + const FnUnspec + const FnUserRingbufDrain + const FnXdpAdjustHead + const FnXdpAdjustMeta + const FnXdpAdjustTail + const FnXdpGetBuffLen + const FnXdpLoadBytes + const FnXdpOutput + const FnXdpStoreBytes + func (_ BuiltinFunc) Max() BuiltinFunc + func (fn BuiltinFunc) Call() Instruction + func (i BuiltinFunc) String() string + type Class uint8 + const ALU64Class + const ALUClass + const Jump32Class + const JumpClass + const LdClass + const LdXClass + const StClass + const StXClass + func (cls Class) IsALU() bool + func (cls Class) IsJump() bool + func (cls Class) IsLoad() bool + func (cls Class) IsStore() bool + func (i Class) String() string + type Comment string + func (s Comment) String() string + type Endianness uint8 + const BE + const InvalidEndian + const LE + func (i Endianness) String() string + type FDer interface + FD func() int + type Instruction struct + Constant int64 + Dst Register + Metadata Metadata + Offset int16 + OpCode OpCode + Src Register + func HostTo(endian Endianness, dst Register, size Size) Instruction + func LoadAbs(offset int32, size Size) Instruction + func LoadImm(dst Register, value int64, size Size) Instruction + func LoadInd(dst, src Register, offset int32, size Size) Instruction + func LoadMapPtr(dst Register, fd int) Instruction + func LoadMapValue(dst Register, fd int, offset uint32) Instruction + func LoadMem(dst, src Register, offset int16, size Size) Instruction + func Return() Instruction + func StoreImm(dst Register, offset int16, value int64, size Size) Instruction + func StoreMem(dst Register, offset int16, src Register, size Size) Instruction + func StoreXAdd(dst, src Register, size Size) Instruction + func (ins *Instruction) AssociateMap(m FDer) error + func (ins *Instruction) IsBuiltinCall() bool + func (ins *Instruction) IsConstantLoad(size Size) bool + func (ins *Instruction) IsFunctionCall() bool + func (ins *Instruction) IsFunctionReference() bool + func (ins *Instruction) IsKfuncCall() bool + func (ins *Instruction) IsLoadFromMap() bool + func (ins *Instruction) IsLoadOfFunctionPointer() bool + func (ins *Instruction) MapPtr() int + func (ins *Instruction) RewriteMapOffset(offset uint32) error + func (ins *Instruction) RewriteMapPtr(fd int) error + func (ins *Instruction) Unmarshal(r io.Reader, bo binary.ByteOrder) (uint64, error) + func (ins Instruction) Format(f fmt.State, c rune) + func (ins Instruction) Map() FDer + func (ins Instruction) Marshal(w io.Writer, bo binary.ByteOrder) (uint64, error) + func (ins Instruction) Reference() string + func (ins Instruction) Size() uint64 + func (ins Instruction) Source() fmt.Stringer + func (ins Instruction) Sym(name string) Instruction + func (ins Instruction) Symbol() string + func (ins Instruction) WithMetadata(meta Metadata) Instruction + func (ins Instruction) WithReference(ref string) Instruction + func (ins Instruction) WithSource(src fmt.Stringer) Instruction + func (ins Instruction) WithSymbol(name string) Instruction + type InstructionIterator struct + Index int + Ins *Instruction + Offset RawInstructionOffset + func (iter *InstructionIterator) Next() bool + type Instructions []Instruction + func (insns *Instructions) Unmarshal(r io.Reader, bo binary.ByteOrder) error + func (insns Instructions) AssociateMap(symbol string, m FDer) error + func (insns Instructions) Format(f fmt.State, c rune) + func (insns Instructions) FunctionReferences() []string + func (insns Instructions) Iterate() *InstructionIterator + func (insns Instructions) Marshal(w io.Writer, bo binary.ByteOrder) error + func (insns Instructions) Name() string + func (insns Instructions) ReferenceOffsets() map[string][]int + func (insns Instructions) RewriteMapPtr(symbol string, fd int) error + func (insns Instructions) Size() uint64 + func (insns Instructions) String() string + func (insns Instructions) SymbolOffsets() (map[string]int, error) + func (insns Instructions) Tag(bo binary.ByteOrder) (string, error) + type JumpOp uint8 + const Call + const Exit + const InvalidJumpOp + const JEq + const JGE + const JGT + const JLE + const JLT + const JNE + const JSGE + const JSGT + const JSLE + const JSLT + const JSet + const Ja + func (i JumpOp) String() string + func (op JumpOp) Imm(dst Register, value int32, label string) Instruction + func (op JumpOp) Imm32(dst Register, value int32, label string) Instruction + func (op JumpOp) Label(label string) Instruction + func (op JumpOp) Op(source Source) OpCode + func (op JumpOp) Reg(dst, src Register, label string) Instruction + func (op JumpOp) Reg32(dst, src Register, label string) Instruction + type Metadata struct + func (m *Metadata) Get(key interface{}) interface{} + func (m *Metadata) Set(key, value interface{}) + type Mode uint8 + const AbsMode + const ImmMode + const IndMode + const InvalidMode + const MemMode + const XAddMode + func (i Mode) String() string + type OpCode uint8 + const InvalidOpCode + func LoadAbsOp(size Size) OpCode + func LoadImmOp(size Size) OpCode + func LoadIndOp(size Size) OpCode + func LoadMemOp(size Size) OpCode + func StoreImmOp(size Size) OpCode + func StoreMemOp(size Size) OpCode + func StoreXAddOp(size Size) OpCode + func (op OpCode) ALUOp() ALUOp + func (op OpCode) Class() Class + func (op OpCode) Endianness() Endianness + func (op OpCode) IsDWordLoad() bool + func (op OpCode) JumpOp() JumpOp + func (op OpCode) Mode() Mode + func (op OpCode) SetALUOp(alu ALUOp) OpCode + func (op OpCode) SetJumpOp(jump JumpOp) OpCode + func (op OpCode) SetMode(mode Mode) OpCode + func (op OpCode) SetSize(size Size) OpCode + func (op OpCode) SetSource(source Source) OpCode + func (op OpCode) Size() Size + func (op OpCode) Source() Source + func (op OpCode) String() string + type RawInstructionOffset uint64 + func (rio RawInstructionOffset) Bytes() uint64 + type Register uint8 + const R0 + const R1 + const R10 + const R2 + const R3 + const R4 + const R5 + const R6 + const R7 + const R8 + const R9 + const RFP + func (r Register) String() string + type Size uint8 + const Byte + const DWord + const Half + const InvalidSize + const Word + func (i Size) String() string + func (s Size) Sizeof() int + type Source uint8 + const ImmSource + const InvalidSource + const RegSource + func (i Source) String() string