Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spellchecking tools + CI #44

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
203 changes: 203 additions & 0 deletions .aspell.en.pws
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
personal_ws-1.1 en 0
bpf
BPF
eBPF
cBPF
bpftool
bpffs
xdp
XDP
XSK
XSKs
skb
KFuncs
kfuncs
KFunc
kfunc
Kprobe
KProbe
KConfig
kptr
kptrs
KPtr
syscall
syscalls
Syscall
Sysctl
sysctl
Libbpf
libbpf
Libxdp
libxdp
Rlimit
rlimit
cGroup
cGroups
tailcall
tailcalls
Dynptr
dynptr
dynptrs
kprobe
kprobes
kretprobe
kretprobes
uprobe
uprobes
fprobe
ftrace
Fentry
fentry
Fexit
fexit
Fmodify
fmodify
datagram
datagrams
preempt
preemptible
subprog
comparator
vmlinux
ack
acked
xfrm
qdisc
qdiscs
performant
SELinux
ACK
ACKs
BTF
JIT
DDoS
NIC
NICs
UDP
DMA
LLVM
CPUs
RCU
APIs
BGP
DNS
LRU
TTL
TTLs
LWT
LSM
BCC
ABI
PMU
TCP
BBR
XFRM
VRF
FOU
IPIP
GUE
RSS
VLAN
IPsec
LPM
TCI
TOS
MTU
NAPI
IPv
GSO
GRO
LSO
QoS
PID
TPID
OSI
RTO
RTT
ECN
MSS
NUMA
IMM
GPL
MPL
relocation
relocations
signable
accumulatively
inlined
lifecycle
nginx
ethernet
temporality
boolean
namespace
namespaces
netfilter
netlink
prepend
etcetera
polymorphism
deduplication
dereferenced
dereferencing
incrementing
misprediction
sleepable
endian
callee
verifier
verifier's
runtime
userspace
Userspace
refcount
refcounted
bitfield
bitmask
allocator
allocate
deallocate
UAPI
readme
lookups
struct
structs
spinlock
spinlocks
tracepoint
tracepoints
bytecode
crypto
cryptographic
benchmarking
benchmarked
Decrypt
Decrypts
decrypt
Encrypt
encrypt
checksum
checksums
ctx
enum
umem
umems
Umem
iproute
ifindex
Inode
inode
inodes
netdev
netdevs
pre
Perf
perf
EINVAL
EBUSY
ENOENT
EFAULT
ENOMEM
ENOPROTOOPT
Netronome
Mellanox
20 changes: 20 additions & 0 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Spellcheck

on:
pull_request: {}
push:
branches:
- master

env:
USER: root

jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run spellcheck
run: |
make spellcheck

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.vscode/
venv/**
venv/**
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,28 @@ serve: build-container
-e "PROD=${PROD}" -e "GH_TOKEN=${GH_TOKEN}" \
-w /docs -u $$(id -u $${USER}):$$(id -g $${USER}) --entrypoint "bash" "${IMAGE}:${VERSION}" -c "mkdocs serve -a 0.0.0.0:8000 --watch /docs/docs"

.PHONY: build-tools
build-tools:
${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" -w /docs golang:latest bash -c \
"CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/spellcheck /docs/tools/spellcheck/. && \
CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/helper-ref-gen /docs/tools/helper-ref-gen/. && \
CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/feature-tag-gen /docs/tools/feature-tag-gen/. && \
CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/kfunc-gen /docs/tools/spellcheck/. && \
CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/mtu-calc /docs/tools/mtu-calc/. && \
CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/helper-def-scraper /docs/tools/helper-def-scraper/."

.PHONY: generate-docs
generate-docs:
cd ${REPODIR}/tools/helper-ref-gen; go run main.go --project-root "${REPODIR}"
cd ${REPODIR}/tools/feature-tag-gen; go run main.go --project-root "${REPODIR}"
cd ${REPODIR}/tools/kfunc-gen; go run main.go --project-root "${REPODIR}"
cd ${REPODIR}/tools/mtu-calc; go run . --project-root "${REPODIR}"
cd ${REPODIR}/tools/helper-def-scraper; go run main.go --helper-path "${REPODIR}/docs/linux/helper-function"
generate-docs: build-container build-tools
${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" \
-w /docs -u $$(id -u $${USER}):$$(id -g $${USER}) --entrypoint "bash" "${IMAGE}:${VERSION}" -c \
"/docs/tools/bin/helper-ref-gen --project-root /docs && \
/docs/tools/bin/feature-tag-gen --project-root /docs && \
/docs/tools/bin/kfunc-gen --project-root /docs && \
/docs/tools/bin/mtu-calc --project-root /docs && \
/docs/tools/bin/helper-def-scraper --helper-path /docs/docs/linux/helper-function"

.PHONY: spellcheck
spellcheck: build-container build-tools html
${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" \
-w /docs -u $$(id -u $${USER}):$$(id -g $${USER}) --entrypoint "bash" "${IMAGE}:${VERSION}" -c \
"/docs/tools/bin/spellcheck --project-root /docs"
34 changes: 33 additions & 1 deletion data/helpers-functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ groups:
cap: [CAP_BPF, CAP_PERFMON]
- name: bpf_trace_vprintk
cap: [CAP_BPF, CAP_PERFMON]
- name: bpf_cgrp_storage_get
kconfig: [CONFIG_CGROUPS]
- name: bpf_cgrp_storage_delete
kconfig: [CONFIG_CGROUPS]
- name: bpf_dynptr_data
- name: bpf_dynptr_from_mem
- name: bpf_dynptr_read
- name: bpf_dynptr_write
- name: bpf_kptr_xchg
- name: bpf_ktime_get_tai_ns
- name: bpf_ringbuf_discard_dynptr
- name: bpf_ringbuf_reserve_dynptr
- name: bpf_ringbuf_submit_dynptr
- name: bpf_user_ringbuf_drain

# `tracing_prog_func_proto` in `kernel/tracing/bpf_trace.c`
tracing_prog:
Expand Down Expand Up @@ -99,6 +113,8 @@ groups:
kconfig: [CONFIG_NET]
- name: bpf_xdp_get_buff_len
kconfig: [CONFIG_NET]
- name: bpf_skc_to_mptcp_sock
kconfig: [CONFIG_NET]
- name: bpf_seq_printf
attach_type: [BPF_TRACE_ITER]
- name: bpf_seq_write
Expand Down Expand Up @@ -336,6 +352,14 @@ programs:
kconfig: [CONFIG_INET]
- name: bpf_skb_set_tstamp
kconfig: [CONFIG_INET]
- name: bpf_tcp_raw_gen_syncookie_ipv4
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_gen_syncookie_ipv6
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_check_syncookie_ipv4
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_check_syncookie_ipv6
kconfig: [CONFIG_SYN_COOKIES]
- group: base

# `tc_cls_act_func_proto` in `net/core/filter.c`
Expand Down Expand Up @@ -449,6 +473,14 @@ programs:
kconfig: [CONFIG_INET]
- name: bpf_tcp_gen_syncookie
kconfig: [CONFIG_INET]
- name: bpf_tcp_raw_check_syncookie_ipv4
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_gen_syncookie_ipv6
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_check_syncookie_ipv4
kconfig: [CONFIG_SYN_COOKIES]
- name: bpf_tcp_raw_check_syncookie_ipv6
kconfig: [CONFIG_SYN_COOKIES]
- group: base

# `pe_prog_func_proto` in `kernel/tracing/bpf_trace.c`
Expand Down Expand Up @@ -759,7 +791,7 @@ programs:

# `tracing_prog_func_proto` in `kernel/tracing/bpf_trace.c`
BPF_PROG_TYPE_TRACING:
- group: tracing
- group: tracing_prog

# TODO struct ops has allowed helpers per struct type, currently only TCP Congestion Algo
# but it doesn't fit neatly with the rest :(
Expand Down
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* [Helper functions](linux/helper-function/)
* [Syscall commands](linux/syscall/)
* [KFuncs](linux/kfuncs/)
* [ePBF librairies](ebpf-library/index.md)
* [eBPF libraries](ebpf-library/index.md)
* [Libbpf](ebpf-library/libbpf.md)
* [Libxdp](ebpf-library/libxdp/)
* [Concepts](concepts/index.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts/btf.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# BTF

BTF (BPF Type Format) is a metadata format designed for encoding debug information related to BPF programs and maps. It focus on describing data types, function information for defined subroutines.
This debug information serves various purposes including map visualization, function signature enhancement for BPF programs, and aiding in the generation of annotated source code, JITed code, and verifier logs.
This debug information serves various purposes including map visualization, function signature enhancement for BPF programs, and aiding in the generation of annotated source code, JIT-ed code, and verifier logs.

The BTF specification is divided into two main parts:

* BTF Kernel API: This defines the interface between user space and the kernel. Before usage, the kernel validates the BTF information provided.
* BTF ELF File Format: This establishes the contract between the ELF file and the libbpf loader in user space.

It was created as an alternative to DWARF debug information. The BTF is more space-efficent due to his [deduplication algorithm] while remaining expressive enough to have all the type information of a C programs.
It was created as an alternative to DWARF debug information. The BTF is more space-efficient due to his [deduplication algorithm] while remaining expressive enough to have all the type information of a C programs.

!!! example "Docs could be improved"
This part of the docs is incomplete, contributions are very welcome
Expand Down
Loading
Loading