MCPcopy Create free account

hub / github.com/boratanrikulu/gobee / functions

Functions474 in github.com/boratanrikulu/gobee

↓ 37 callersMethodformatExpr
formatExpr returns the C representation of a Go expression as a string.
internal/transpile/emit.go:871
↓ 32 callersMethodwritef
(format string, args ...any)
internal/transpile/emit.go:80
↓ 30 callersMethodwriteln
(s string)
internal/transpile/emit.go:86
↓ 25 callersMethodLookup
(key *K)
bpf/maps.go:23
↓ 25 callersMethodemit
(pos token.Pos, format string, args ...any)
internal/transpile/validate.go:74
↓ 21 callersMethodContains
Contains reports whether `value` may be in the filter. False positives are possible (rate decided by MaxEntries and the kernel's hash count); false ne
bpf/maps.go:88
↓ 18 callersMethodwriteIndent
()
internal/transpile/emit.go:92
↓ 16 callersFunctionAtomicAdd64
AtomicAdd64 atomically adds delta to *addr. Transpiles to __sync_fetch_and_add(addr, delta) in BPF C.
bpf/helpers.go:7
↓ 15 callersMethodString
()
internal/transpile/validate.go:19
↓ 15 callersFunctiongoTypeToC
goTypeToC maps a resolved Go type to its emitted C representation. Pointer types render as `<C base type> *`; named bpf-package types map to their ker
internal/transpile/types.go:13
↓ 12 callersMethodError
()
internal/transpile/validate.go:20
↓ 12 callersMethodUpdate
(key *K, value *V)
bpf/maps.go:24
↓ 8 callersFunctionParseFile
ParseFile loads a single Go file, type-checks it, and returns the gobee IR. Diagnostics from the Go front-end are returned as errors with file:line:co
internal/transpile/parse.go:16
↓ 8 callersFunctionemit
(w *os.File, helpers []helper)
tools/genhelpers/main.go:295
↓ 7 callersFunctioncstr
(b []byte)
example/sysmon/main.go:209
↓ 7 callersFunctiondeclString
declString joins a C type and a variable name with libbpf-style spacing: pointer types attach the `*` to the variable (`struct xdp_md *ctx`).
internal/transpile/emit.go:116
↓ 7 callersMethodwriteBlock
(b *ast.BlockStmt)
internal/transpile/emit.go:523
↓ 6 callersMethodReserve
Reserve allocates space for one event in the ring. Returns (event, true) on success or (nil, false) if the ring is full. The bool is the recognized co
bpf/ringbuf.go:34
↓ 6 callersMethodSubmit
Submit publishes a previously reserved event so the userspace reader can see it.
bpf/ringbuf.go:38
↓ 6 callersFunctionValidate
Validate checks that every //bpf:section function in the program uses only the supported Go subset. Returns all findings sorted by source position.
internal/transpile/validate.go:47
↓ 5 callersFunctionEmit
Emit produces the BPF C source for a parsed program along with a sourcemap that lets `gobee diagnose` map verifier errors back to the originating Go s
internal/transpile/emit.go:21
↓ 5 callersFunctionKtimeGetNs
KtimeGetNs wraps the BPF helper `bpf_ktime_get_ns`. Return the time elapsed since system boot, in nanoseconds. Does not include time the system was
bpf/helpers_generated.go:1258
↓ 5 callersFunctionfillHeader
fillHeader sets every field of e that's the same for every kind of event: timestamp, pid, uid, comm, kind. Inlined into each section program by the BP
example/sysmon/bpf/src/sysmon.go:43
↓ 5 callersMethodrecordPos
recordPos pairs the current C line with a Go source position. Called at the top of each emit step (statement, map decl, program header, license) so th
internal/transpile/emit.go:104
↓ 4 callersFunctionGetCurrentPid
This file holds typed convenience wrappers over the auto-generated libbpf helpers. They exist purely so kernel-side Go code reads naturally; the gobee
bpf/sugar.go:11
↓ 4 callersFunctionParseSourceMap
ParseSourceMap reads a sourcemap as written by transpile.FormatSourceMap. Comment lines (`#...`) and blank lines are skipped.
diagnose/diagnose.go:60
↓ 4 callersFunctionparseDirective
parseDirective returns the parsed directive if the comment text starts with "//bpf:". Returns (nil, nil) for unrelated comments. Whitespace around fie
internal/transpile/directives.go:21
↓ 4 callersFunctionpascalCase
pascalCase upper-cases the first rune. Internal-only helper for translating ELF symbol names like `events` or `OnExec` into Go field names like `Event
internal/transpile/bindings.go:349
↓ 3 callersFunctionFormatSourceMap
FormatSourceMap renders mappings as a tab-separated text file: <c-line>\t<go-file>:<go-line>:<go-col> Lines are sorted by C line number. The format
internal/transpile/sourcemap.go:30
↓ 3 callersFunctionGetCurrentPidTgid
GetCurrentPidTgid wraps the BPF helper `bpf_get_current_pid_tgid`. Get the current pid and tgid. Returns A 64-bit integer containing the current
bpf/helpers_generated.go:680
↓ 3 callersMethodRedirect
Redirect hands the current packet to the interface stored at key. The return value is the XdpAction the BPF program should return (typically XDP_REDIR
bpf/maps.go:169
↓ 3 callersFunctionRewrite
Rewrite reads verifier output from r line by line and writes an annotated copy to w. Each line that contains a `<file>.bpf.c:<N>` reference is extende
diagnose/diagnose.go:93
↓ 3 callersFunctionRun
Run translates every kernel-side .go file in opts.InputDir into a sibling .bpf.c file. gobee stops here — the user owns clang invocation, .o embedding
internal/transpile/pipeline.go:47
↓ 3 callersFunctionbpfPackageTypeInfo
bpfPackageTypeInfo returns the bpfTypeInfo for a Named type if it's declared in the gobee bpf package; ok=false otherwise.
internal/transpile/types.go:97
↓ 3 callersFunctiondie
(err error)
tools/genhelpers/main.go:54
↓ 3 callersMethodresolveLHSName
resolveLHSName returns ident.Name unless it's the Go blank identifier, in which case it mints a unique synthetic C identifier. Two `_, ok := Map.Looku
internal/transpile/emit.go:72
↓ 3 callersFunctionvalidateSource
(t *testing.T, src string)
internal/transpile/validate_test.go:138
↓ 2 callersFunctionAnnotateLines
AnnotateLines walks each input line, extends any line that mentions a `<stem>.bpf.c:<N>` reference with the matching Go position from sm, and returns
diagnose/diagnose.go:50
↓ 2 callersFunctionGetCurrentUid
GetCurrentUid returns the calling task's effective UID (the lower 32 bits of bpf_get_current_uid_gid).
bpf/sugar.go:19
↓ 2 callersFunctionGetUserString
GetUserString copies a NUL-terminated string from the userspace pointer addr into buf, up to its length. Returns the number of bytes copied including
bpf/sugar.go:33
↓ 2 callersFunctionParseSourceMapBytes
ParseSourceMapBytes is the byte-slice convenience wrapper for callers that already have the sourcemap in memory (e.g. generated bindings that embed it
diagnose/diagnose.go:35
↓ 2 callersMethodPush
(value *T)
bpf/maps.go:108
↓ 2 callersFunctionannotateLine
annotateLine returns line with one trailing `(→ go-file:line:col)` per distinct C-line ref it contains. Unknown refs are left alone (no false rewrites
diagnose/diagnose.go:109
↓ 2 callersFunctionanyExampleMentions
(examples []string, needle string)
internal/transpile/coverage_test.go:85
↓ 2 callersFunctionbasicKind
(t types.Type)
internal/transpile/parse_test.go:53
↓ 2 callersFunctioncTypeToGo
cTypeToGo maps a single C type to its Go counterpart. - integer types map directly - char* / const char* are rejected (strings are not BPF-safe) - st
tools/genhelpers/main.go:249
↓ 2 callersMethodcheckFunc
(fd *ast.FuncDecl)
internal/transpile/validate.go:95
↓ 2 callersMethodformatForClause
(stmt ast.Stmt)
internal/transpile/emit.go:833
↓ 2 callersFunctiongoNameToBpfHelper
goNameToBpfHelper converts a `bpf` package Go function name back to its libbpf C helper name. Inverse of tools/genhelpers's goNameFor. MapLookupElem
internal/transpile/helpers.go:94
↓ 2 callersFunctionisKernelContextStruct
isKernelContextStruct reports whether the named type is one of the bpf-package kernel-context structs whose field reads should go through BPF_CORE_REA
internal/transpile/emit.go:1048
↓ 2 callersFunctionisRingBufNamed
(n *types.Named)
internal/transpile/emit.go:1231
↓ 2 callersMethodmapMethodCall
mapMethodCall recognizes any `<mapVar>.<Method>(...)` call where mapVar is a gobee map type (ArrayMap or HashMap). Returns the map identifier name, it
internal/transpile/emit.go:1657
↓ 2 callersFunctionparseBpfTag
(tag string)
internal/transpile/emit.go:1074
↓ 2 callersFunctionreadExampleSources
(t *testing.T)
internal/transpile/coverage_test.go:61
↓ 2 callersMethodstorageMapInfo
storageMapInfo extracts (mapName, valType, scopeKey) for a TaskStorage / SkStorage / InodeStorage method call. scopeKey is the storage Go type name ("
internal/transpile/emit.go:1539
↓ 1 callersMethodAdd
Add inserts an element. Always succeeds (a bloom filter never rejects).
bpf/maps.go:83
↓ 1 callersFunctionExecute
Execute runs the root command. Returns any error encountered so main.go can decide on the exit code.
cmd/gobee/app/root.go:31
↓ 1 callersMethodGet
(sk unsafe.Pointer)
bpf/maps.go:223
↓ 1 callersFunctionGetCurrentTaskBtf
GetCurrentTaskBtf wraps the BPF helper `bpf_get_current_task_btf`. Return a BTF pointer to the "current" task. This pointer can also be used in hel
bpf/helpers_generated.go:700
↓ 1 callersMethodGetOrCreate
(sk unsafe.Pointer, value *V)
bpf/maps.go:224
↓ 1 callersFunctionGetPrandomU32
GetPrandomU32 wraps the BPF helper `bpf_get_prandom_u32`. Get a pseudo-random number. From a security point of view, this helper uses its own pse
bpf/helpers_generated.go:869
↓ 1 callersFunctionGetSmpProcessorId
GetSmpProcessorId wraps the BPF helper `bpf_get_smp_processor_id`. Get the SMP (symmetric multiprocessing) processor id. Note that all programs run
bpf/helpers_generated.go:920
↓ 1 callersFunctionGetTaskComm
GetTaskComm fills buf with the calling task's command name (the kernel's TASK_COMM_LEN is 16, NUL-padded). Returns 0 on success, a negative errno on f
bpf/sugar.go:28
↓ 1 callersFunctionGetUserArgv
GetUserArgv reads up to 8 entries of the userspace argv array (a `char *const *`) into buf as 32-byte slots. Returns the number of bytes written.
bpf/sugar.go:38
↓ 1 callersFunctionNtohl
Byte-order helpers for reading network-endian fields like `bpf_sock_ops::remote_port` (a __be32 ABI). These are clang macros from <bpf/bpf_endian.h>,
bpf/endian.go:10
↓ 1 callersMethodOutput
Output is the one-shot variant of Reserve+Submit: it allocates, copies the value, and submits in a single call. Returns 0 on success or a negative err
bpf/ringbuf.go:47
↓ 1 callersFunctionPrintSummary
PrintSummary writes a one-line-per-artifact summary to w.
internal/transpile/pipeline.go:187
↓ 1 callersFunctionSockOpsCbFlagsSet
SockOpsCbFlagsSet wraps the BPF helper `bpf_sock_ops_cb_flags_set`. Attempt to set the value of the **bpf_sock_ops_cb_flags** field for the full TC
bpf/helpers_generated.go:3807
↓ 1 callersMethodTailCall
TailCall jumps into the program registered at key. On success this never returns; on failure (key out of range, no program registered, or tail-call li
bpf/maps.go:135
↓ 1 callersFunctionWriteBindings
WriteBindings emits a Go file with typed accessors for the program's BPF programs and maps. Consumers use cilium/ebpf's LoadAndAssign machinery via th
internal/transpile/bindings.go:22
↓ 1 callersFunctionattachFor
attachFor maps a //bpf:section value to an attach-helper template, or returns nil if gobee doesn't yet know how to attach this program kind from the b
internal/transpile/bindings.go:309
↓ 1 callersFunctionbasicToC
(b *types.Basic)
internal/transpile/types.go:29
↓ 1 callersFunctionbpfFieldNameTag
bpfFieldNameTag returns the value of the `bpf:"…"` struct tag on goName-named field of named, or "" if no such tag exists.
internal/transpile/emit.go:968
↓ 1 callersMethodcheckBodyTypes
checkBodyTypes flags forbidden basic types (string) reachable inside the function body. This catches `var s string`, `s := "hi"`, etc., which a pure-A
internal/transpile/validate.go:182
↓ 1 callersMethodcheckCall
(call *ast.CallExpr)
internal/transpile/validate.go:155
↓ 1 callersMethodcheckForStmt
(fs *ast.ForStmt)
internal/transpile/validate.go:172
↓ 1 callersMethodcheckImports
()
internal/transpile/validate.go:81
↓ 1 callersFunctioncollectDecls
(prog *Program)
internal/transpile/parse.go:75
↓ 1 callersFunctioncollectFileDirectives
(prog *Program)
internal/transpile/parse.go:53
↓ 1 callersMethodcoreReadChain
coreReadChain detects field access on a `*bpf.<KernelStruct>` value and returns the equivalent BPF_CORE_READ(...) expression. Returns ok=false if the
internal/transpile/emit.go:993
↓ 1 callersFunctioncountEmitted
(hs []helper)
tools/genhelpers/main.go:380
↓ 1 callersFunctioncountSkipped
(hs []helper)
tools/genhelpers/main.go:390
↓ 1 callersFunctiondecodeArgs
decodeArgs joins the 8 fixed-size 32-byte slots produced by the kernel's gobee_read_user_argv helper into a single space-separated string. Empty slots
example/sysmon/main.go:197
↓ 1 callersFunctiondirectivesEqual
(a, b *directive)
internal/transpile/directives_test.go:33
↓ 1 callersFunctiondocDirective
docDirective scans a doc comment group for the named directive and returns the first match, or nil if absent. Errors during parsing are ignored here;
internal/transpile/directives.go:45
↓ 1 callersFunctionemitDoc
(w *bufio.Writer, h helper)
tools/genhelpers/main.go:364
↓ 1 callersFunctionfindArchObjects
findArchObjects returns every .bpf.o under example/*/bpf/bin/<arch>/. arch is mapped from runtime.GOARCH because the Makefile uses libbpf- style names
e2e/loader_test.go:88
↓ 1 callersFunctionfindInputs
findInputs returns .go files in dir whose contents reference //bpf:license. Cheap text scan — avoids paying go/types cost on unrelated files.
internal/transpile/pipeline.go:164
↓ 1 callersMethodformatBinary
(b *ast.BinaryExpr)
internal/transpile/emit.go:1120
↓ 1 callersMethodformatCall
(call *ast.CallExpr)
internal/transpile/emit.go:1353
↓ 1 callersFunctionformatEvent
(ev *bpf.Event)
example/sysmon/main.go:175
↓ 1 callersMethodformatIdent
(id *ast.Ident)
internal/transpile/emit.go:911
↓ 1 callersMethodformatSelector
(sel *ast.SelectorExpr)
internal/transpile/emit.go:928
↓ 1 callersMethodformatUnary
(u *ast.UnaryExpr)
internal/transpile/emit.go:1102
↓ 1 callersFunctiongoCamelToSnake
(s string)
internal/transpile/emit.go:1088
↓ 1 callersFunctiongoNameFor
goNameFor turns a C helper name into its exported Go counterpart. The leading `bpf_` is dropped; remaining snake_case becomes PascalCase. bpf_map_lo
tools/genhelpers/main.go:196
↓ 1 callersFunctionisMapNamed
(n *types.Named)
internal/transpile/emit.go:1688
↓ 1 callersFunctionisQueueOrStackNamed
(n *types.Named)
internal/transpile/emit.go:1279
↓ 1 callersFunctionisStringType
(t types.Type)
internal/transpile/validate.go:198
↓ 1 callersMethodkernelStructType
kernelStructType returns the underlying *types.Named for `*bpf.<Type>` expressions where <Type> is one of the kernel-context structs we model. Returns
internal/transpile/emit.go:1027
next →1–100 of 474, ranked by callers