Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/boratanrikulu/gobee
/ functions
Functions
474 in github.com/boratanrikulu/gobee
⨍
Functions
474
◇
Types & classes
106
↓ 37 callers
Method
formatExpr
formatExpr returns the C representation of a Go expression as a string.
internal/transpile/emit.go:871
↓ 32 callers
Method
writef
(format string, args ...any)
internal/transpile/emit.go:80
↓ 30 callers
Method
writeln
(s string)
internal/transpile/emit.go:86
↓ 25 callers
Method
Lookup
(key *K)
bpf/maps.go:23
↓ 25 callers
Method
emit
(pos token.Pos, format string, args ...any)
internal/transpile/validate.go:74
↓ 21 callers
Method
Contains
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 callers
Method
writeIndent
()
internal/transpile/emit.go:92
↓ 16 callers
Function
AtomicAdd64
AtomicAdd64 atomically adds delta to *addr. Transpiles to __sync_fetch_and_add(addr, delta) in BPF C.
bpf/helpers.go:7
↓ 15 callers
Method
String
()
internal/transpile/validate.go:19
↓ 15 callers
Function
goTypeToC
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 callers
Method
Error
()
internal/transpile/validate.go:20
↓ 12 callers
Method
Update
(key *K, value *V)
bpf/maps.go:24
↓ 8 callers
Function
ParseFile
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 callers
Function
emit
(w *os.File, helpers []helper)
tools/genhelpers/main.go:295
↓ 7 callers
Function
cstr
(b []byte)
example/sysmon/main.go:209
↓ 7 callers
Function
declString
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 callers
Method
writeBlock
(b *ast.BlockStmt)
internal/transpile/emit.go:523
↓ 6 callers
Method
Reserve
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 callers
Method
Submit
Submit publishes a previously reserved event so the userspace reader can see it.
bpf/ringbuf.go:38
↓ 6 callers
Function
Validate
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 callers
Function
Emit
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 callers
Function
KtimeGetNs
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 callers
Function
fillHeader
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 callers
Method
recordPos
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 callers
Function
GetCurrentPid
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 callers
Function
ParseSourceMap
ParseSourceMap reads a sourcemap as written by transpile.FormatSourceMap. Comment lines (`#...`) and blank lines are skipped.
diagnose/diagnose.go:60
↓ 4 callers
Function
parseDirective
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 callers
Function
pascalCase
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 callers
Function
FormatSourceMap
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 callers
Function
GetCurrentPidTgid
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 callers
Method
Redirect
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 callers
Function
Rewrite
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 callers
Function
Run
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 callers
Function
bpfPackageTypeInfo
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 callers
Function
die
(err error)
tools/genhelpers/main.go:54
↓ 3 callers
Method
resolveLHSName
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 callers
Function
validateSource
(t *testing.T, src string)
internal/transpile/validate_test.go:138
↓ 2 callers
Function
AnnotateLines
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 callers
Function
GetCurrentUid
GetCurrentUid returns the calling task's effective UID (the lower 32 bits of bpf_get_current_uid_gid).
bpf/sugar.go:19
↓ 2 callers
Function
GetUserString
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 callers
Function
ParseSourceMapBytes
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 callers
Method
Push
(value *T)
bpf/maps.go:108
↓ 2 callers
Function
annotateLine
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 callers
Function
anyExampleMentions
(examples []string, needle string)
internal/transpile/coverage_test.go:85
↓ 2 callers
Function
basicKind
(t types.Type)
internal/transpile/parse_test.go:53
↓ 2 callers
Function
cTypeToGo
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 callers
Method
checkFunc
(fd *ast.FuncDecl)
internal/transpile/validate.go:95
↓ 2 callers
Method
formatForClause
(stmt ast.Stmt)
internal/transpile/emit.go:833
↓ 2 callers
Function
goNameToBpfHelper
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 callers
Function
isKernelContextStruct
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 callers
Function
isRingBufNamed
(n *types.Named)
internal/transpile/emit.go:1231
↓ 2 callers
Method
mapMethodCall
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 callers
Function
parseBpfTag
(tag string)
internal/transpile/emit.go:1074
↓ 2 callers
Function
readExampleSources
(t *testing.T)
internal/transpile/coverage_test.go:61
↓ 2 callers
Method
storageMapInfo
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 callers
Method
Add
Add inserts an element. Always succeeds (a bloom filter never rejects).
bpf/maps.go:83
↓ 1 callers
Function
Execute
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 callers
Method
Get
(sk unsafe.Pointer)
bpf/maps.go:223
↓ 1 callers
Function
GetCurrentTaskBtf
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 callers
Method
GetOrCreate
(sk unsafe.Pointer, value *V)
bpf/maps.go:224
↓ 1 callers
Function
GetPrandomU32
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 callers
Function
GetSmpProcessorId
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 callers
Function
GetTaskComm
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 callers
Function
GetUserArgv
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 callers
Function
Ntohl
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 callers
Method
Output
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 callers
Function
PrintSummary
PrintSummary writes a one-line-per-artifact summary to w.
internal/transpile/pipeline.go:187
↓ 1 callers
Function
SockOpsCbFlagsSet
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 callers
Method
TailCall
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 callers
Function
WriteBindings
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 callers
Function
attachFor
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 callers
Function
basicToC
(b *types.Basic)
internal/transpile/types.go:29
↓ 1 callers
Function
bpfFieldNameTag
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 callers
Method
checkBodyTypes
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 callers
Method
checkCall
(call *ast.CallExpr)
internal/transpile/validate.go:155
↓ 1 callers
Method
checkForStmt
(fs *ast.ForStmt)
internal/transpile/validate.go:172
↓ 1 callers
Method
checkImports
()
internal/transpile/validate.go:81
↓ 1 callers
Function
collectDecls
(prog *Program)
internal/transpile/parse.go:75
↓ 1 callers
Function
collectFileDirectives
(prog *Program)
internal/transpile/parse.go:53
↓ 1 callers
Method
coreReadChain
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 callers
Function
countEmitted
(hs []helper)
tools/genhelpers/main.go:380
↓ 1 callers
Function
countSkipped
(hs []helper)
tools/genhelpers/main.go:390
↓ 1 callers
Function
decodeArgs
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 callers
Function
directivesEqual
(a, b *directive)
internal/transpile/directives_test.go:33
↓ 1 callers
Function
docDirective
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 callers
Function
emitDoc
(w *bufio.Writer, h helper)
tools/genhelpers/main.go:364
↓ 1 callers
Function
findArchObjects
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 callers
Function
findInputs
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 callers
Method
formatBinary
(b *ast.BinaryExpr)
internal/transpile/emit.go:1120
↓ 1 callers
Method
formatCall
(call *ast.CallExpr)
internal/transpile/emit.go:1353
↓ 1 callers
Function
formatEvent
(ev *bpf.Event)
example/sysmon/main.go:175
↓ 1 callers
Method
formatIdent
(id *ast.Ident)
internal/transpile/emit.go:911
↓ 1 callers
Method
formatSelector
(sel *ast.SelectorExpr)
internal/transpile/emit.go:928
↓ 1 callers
Method
formatUnary
(u *ast.UnaryExpr)
internal/transpile/emit.go:1102
↓ 1 callers
Function
goCamelToSnake
(s string)
internal/transpile/emit.go:1088
↓ 1 callers
Function
goNameFor
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 callers
Function
isMapNamed
(n *types.Named)
internal/transpile/emit.go:1688
↓ 1 callers
Function
isQueueOrStackNamed
(n *types.Named)
internal/transpile/emit.go:1279
↓ 1 callers
Function
isStringType
(t types.Type)
internal/transpile/validate.go:198
↓ 1 callers
Method
kernelStructType
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