github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/asm/func.go (about) 1 package asm 2 3 //go:generate go run golang.org/x/tools/cmd/stringer@latest -output func_string.go -type=BuiltinFunc 4 5 // BuiltinFunc is a built-in eBPF function. 6 type BuiltinFunc int32 7 8 func (_ BuiltinFunc) Max() BuiltinFunc { 9 return maxBuiltinFunc - 1 10 } 11 12 // eBPF built-in functions 13 // 14 // You can regenerate this list using the following gawk script: 15 // 16 // /FN\(.+\),/ { 17 // match($1, /\(([a-z_0-9]+),/, r) 18 // split(r[1], p, "_") 19 // printf "Fn" 20 // for (i in p) { 21 // printf "%s%s", toupper(substr(p[i], 1, 1)), substr(p[i], 2) 22 // } 23 // print "" 24 // } 25 // 26 // The script expects include/uapi/linux/bpf.h as it's input. 27 const ( 28 FnUnspec BuiltinFunc = iota 29 FnMapLookupElem 30 FnMapUpdateElem 31 FnMapDeleteElem 32 FnProbeRead 33 FnKtimeGetNs 34 FnTracePrintk 35 FnGetPrandomU32 36 FnGetSmpProcessorId 37 FnSkbStoreBytes 38 FnL3CsumReplace 39 FnL4CsumReplace 40 FnTailCall 41 FnCloneRedirect 42 FnGetCurrentPidTgid 43 FnGetCurrentUidGid 44 FnGetCurrentComm 45 FnGetCgroupClassid 46 FnSkbVlanPush 47 FnSkbVlanPop 48 FnSkbGetTunnelKey 49 FnSkbSetTunnelKey 50 FnPerfEventRead 51 FnRedirect 52 FnGetRouteRealm 53 FnPerfEventOutput 54 FnSkbLoadBytes 55 FnGetStackid 56 FnCsumDiff 57 FnSkbGetTunnelOpt 58 FnSkbSetTunnelOpt 59 FnSkbChangeProto 60 FnSkbChangeType 61 FnSkbUnderCgroup 62 FnGetHashRecalc 63 FnGetCurrentTask 64 FnProbeWriteUser 65 FnCurrentTaskUnderCgroup 66 FnSkbChangeTail 67 FnSkbPullData 68 FnCsumUpdate 69 FnSetHashInvalid 70 FnGetNumaNodeId 71 FnSkbChangeHead 72 FnXdpAdjustHead 73 FnProbeReadStr 74 FnGetSocketCookie 75 FnGetSocketUid 76 FnSetHash 77 FnSetsockopt 78 FnSkbAdjustRoom 79 FnRedirectMap 80 FnSkRedirectMap 81 FnSockMapUpdate 82 FnXdpAdjustMeta 83 FnPerfEventReadValue 84 FnPerfProgReadValue 85 FnGetsockopt 86 FnOverrideReturn 87 FnSockOpsCbFlagsSet 88 FnMsgRedirectMap 89 FnMsgApplyBytes 90 FnMsgCorkBytes 91 FnMsgPullData 92 FnBind 93 FnXdpAdjustTail 94 FnSkbGetXfrmState 95 FnGetStack 96 FnSkbLoadBytesRelative 97 FnFibLookup 98 FnSockHashUpdate 99 FnMsgRedirectHash 100 FnSkRedirectHash 101 FnLwtPushEncap 102 FnLwtSeg6StoreBytes 103 FnLwtSeg6AdjustSrh 104 FnLwtSeg6Action 105 FnRcRepeat 106 FnRcKeydown 107 FnSkbCgroupId 108 FnGetCurrentCgroupId 109 FnGetLocalStorage 110 FnSkSelectReuseport 111 FnSkbAncestorCgroupId 112 FnSkLookupTcp 113 FnSkLookupUdp 114 FnSkRelease 115 FnMapPushElem 116 FnMapPopElem 117 FnMapPeekElem 118 FnMsgPushData 119 FnMsgPopData 120 FnRcPointerRel 121 FnSpinLock 122 FnSpinUnlock 123 FnSkFullsock 124 FnTcpSock 125 FnSkbEcnSetCe 126 FnGetListenerSock 127 FnSkcLookupTcp 128 FnTcpCheckSyncookie 129 FnSysctlGetName 130 FnSysctlGetCurrentValue 131 FnSysctlGetNewValue 132 FnSysctlSetNewValue 133 FnStrtol 134 FnStrtoul 135 FnSkStorageGet 136 FnSkStorageDelete 137 FnSendSignal 138 FnTcpGenSyncookie 139 FnSkbOutput 140 FnProbeReadUser 141 FnProbeReadKernel 142 FnProbeReadUserStr 143 FnProbeReadKernelStr 144 FnTcpSendAck 145 FnSendSignalThread 146 FnJiffies64 147 FnReadBranchRecords 148 FnGetNsCurrentPidTgid 149 FnXdpOutput 150 FnGetNetnsCookie 151 FnGetCurrentAncestorCgroupId 152 FnSkAssign 153 FnKtimeGetBootNs 154 FnSeqPrintf 155 FnSeqWrite 156 FnSkCgroupId 157 FnSkAncestorCgroupId 158 FnRingbufOutput 159 FnRingbufReserve 160 FnRingbufSubmit 161 FnRingbufDiscard 162 FnRingbufQuery 163 FnCsumLevel 164 FnSkcToTcp6Sock 165 FnSkcToTcpSock 166 FnSkcToTcpTimewaitSock 167 FnSkcToTcpRequestSock 168 FnSkcToUdp6Sock 169 FnGetTaskStack 170 FnLoadHdrOpt 171 FnStoreHdrOpt 172 FnReserveHdrOpt 173 FnInodeStorageGet 174 FnInodeStorageDelete 175 FnDPath 176 FnCopyFromUser 177 FnSnprintfBtf 178 FnSeqPrintfBtf 179 FnSkbCgroupClassid 180 FnRedirectNeigh 181 FnPerCpuPtr 182 FnThisCpuPtr 183 FnRedirectPeer 184 FnTaskStorageGet 185 FnTaskStorageDelete 186 FnGetCurrentTaskBtf 187 FnBprmOptsSet 188 FnKtimeGetCoarseNs 189 FnImaInodeHash 190 FnSockFromFile 191 FnCheckMtu 192 FnForEachMapElem 193 FnSnprintf 194 FnSysBpf 195 FnBtfFindByNameKind 196 FnSysClose 197 FnTimerInit 198 FnTimerSetCallback 199 FnTimerStart 200 FnTimerCancel 201 FnGetFuncIp 202 FnGetAttachCookie 203 FnTaskPtRegs 204 FnGetBranchSnapshot 205 FnTraceVprintk 206 FnSkcToUnixSock 207 FnKallsymsLookupName 208 FnFindVma 209 FnLoop 210 FnStrncmp 211 FnGetFuncArg 212 FnGetFuncRet 213 FnGetFuncArgCnt 214 FnGetRetval 215 FnSetRetval 216 FnXdpGetBuffLen 217 FnXdpLoadBytes 218 FnXdpStoreBytes 219 FnCopyFromUserTask 220 FnSkbSetTstamp 221 FnImaFileHash 222 FnKptrXchg 223 FnMapLookupPercpuElem 224 FnSkcToMptcpSock 225 FnDynptrFromMem 226 FnRingbufReserveDynptr 227 FnRingbufSubmitDynptr 228 FnRingbufDiscardDynptr 229 FnDynptrRead 230 FnDynptrWrite 231 FnDynptrData 232 FnTcpRawGenSyncookieIpv4 233 FnTcpRawGenSyncookieIpv6 234 FnTcpRawCheckSyncookieIpv4 235 FnTcpRawCheckSyncookieIpv6 236 FnKtimeGetTaiNs 237 FnUserRingbufDrain 238 FnCgrpStorageGet 239 FnCgrpStorageDelete 240 241 maxBuiltinFunc 242 ) 243 244 // Call emits a function call. 245 func (fn BuiltinFunc) Call() Instruction { 246 return Instruction{ 247 OpCode: OpCode(JumpClass).SetJumpOp(Call), 248 Constant: int64(fn), 249 } 250 }