diff --git a/.codespellrc b/.codespellrc index 5dedc5f69..f21ae7a97 100644 --- a/.codespellrc +++ b/.codespellrc @@ -4,8 +4,7 @@ builtin = clear,rare,informal check-filenames = check-hidden = ignore-words = .codespellignore -ignore-regex = \b[a-z]+[A-Z][a-zA-Z0-9]*\b -interactive = 1 +ignore-regex = \b[a-z]+[A-Z][a-zA-Z0-9]*\b|\b[a-z_]+_[a-z_]+\b|\b0x[0-9a-fA-F]+\b|^\s*(package|import|use|include|#include)\s +interactive = 0 skip = .git,AUTHORS.md,go.mod,go.sum,LICENSES,zydis,tools.mod,tools.sum uri-ignore-words-list = * -write = diff --git a/design-docs/00000-example-docs/04359-remove-bpf-hashing/README.md b/design-docs/00000-example-docs/04359-remove-bpf-hashing/README.md index 1f676f25a..53ba9dd41 100644 --- a/design-docs/00000-example-docs/04359-remove-bpf-hashing/README.md +++ b/design-docs/00000-example-docs/04359-remove-bpf-hashing/README.md @@ -294,7 +294,7 @@ sent through: `` Perf events are essentially per-CPU ring-buffers. The events don't have to be -copied into user-mode memory: the ring buffer is `mmaped` into the UM +copied into user-mode memory: the ring buffer is `mmapped` into the UM process[^1]. Since we're currently only suppressing about 45% of trace resends anyway, we @@ -628,7 +628,7 @@ of caching. No strong opinion on this, though. #### Improvements on newer kernels Kernel versions v4.18+ actually have a function `bpf_get_current_cgroup_id` that -we could use to obtain a unique ID that is guaranteed not to be re-used: +we could use to obtain a unique ID that is guaranteed not to be reused: https://github.com/torvalds/linux/blob/9b6de136b5f0158c60844f85286a593cb70fb364/include/linux/kernfs.h#L217-L221 diff --git a/design-docs/00001-off-cpu-profiling/README.md b/design-docs/00001-off-cpu-profiling/README.md index ccde893cd..a61947a39 100644 --- a/design-docs/00001-off-cpu-profiling/README.md +++ b/design-docs/00001-off-cpu-profiling/README.md @@ -101,7 +101,7 @@ algorithm should be revisited and updated. ## Option A Attach stack unwinding functionality to the tracepoint `tracepoint:sched:sched_switch`. This -tracepoint is called everytime the Linux kernel scheduler takes resources from a task before +tracepoint is called every time the Linux kernel scheduler takes resources from a task before assigning these resources to another task. Similar to the eBPF program [`perf_event/native_tracer_entry`](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/dd0c20701b191975d6c13408c92d7fed637119da/support/ebpf/native_stack_trace.ebpf.c#L860C6-L860C36) diff --git a/design-docs/00002-custom-labels/README.md b/design-docs/00002-custom-labels/README.md index ce753b9b7..4007c8325 100644 --- a/design-docs/00002-custom-labels/README.md +++ b/design-docs/00002-custom-labels/README.md @@ -27,7 +27,7 @@ This design doc describes how we can surface Go pprof labels in the OTel profile - When disabled custom labels has little to no impact on performance or memory usage of the profiler - Custom labels should be limited so that even if a program has thousands of eligible labels the number supported is reasonably small (mostly enforced by eBPF itself) - Custom labels should be short and have fixed memory overhead -- The custom labels should be made available to the reporter backend but otherwise it should be left up to implementors what to do with them +- The custom labels should be made available to the reporter backend but otherwise it should be left up to implementers what to do with them # Scope diff --git a/internal/log/logging.go b/internal/log/logging.go index 560c86a87..83502f3de 100644 --- a/internal/log/logging.go +++ b/internal/log/logging.go @@ -27,7 +27,7 @@ var globalLogger = func() *atomic.Pointer[slog.Logger] { }() // SetLogger sets the global logger to l while respecting programLevel's log -// level. When default logger is overidden, SetLevel has no effect. +// level. When default logger is overridden, SetLevel has no effect. func SetLogger(l slog.Logger) { globalLogger.Store(&l) } diff --git a/interpreter/golabels/tls_arm64.go b/interpreter/golabels/tls_arm64.go index b8ac87e48..a6d402f84 100644 --- a/interpreter/golabels/tls_arm64.go +++ b/interpreter/golabels/tls_arm64.go @@ -17,7 +17,7 @@ import ( // https://github.com/golang/go/blob/6885bad7dd86880be/src/runtime/tls_arm64.s#L11 // -// Get's compiled into: +// Gets compiled into: // 0x000000000007f260 <+0>: adrp x27, 0x1c2000 // 0x000000000007f264 <+4>: ldrsb x0, [x27, #284] // 0x000000000007f268 <+8>: cbz x0, 0x7f278 diff --git a/kallsyms/kallsyms.go b/kallsyms/kallsyms.go index a9412b501..efcc5e3be 100644 --- a/kallsyms/kallsyms.go +++ b/kallsyms/kallsyms.go @@ -278,7 +278,7 @@ func (m *Module) LookupSymbolsByPrefix(prefix string) []*libpf.Symbol { } // updateSymbolsFrom parses /proc/kallsyms format data from the reader 'r'. -// If possible the data from previous reads is re-used to avoid allocations. +// If possible the data from previous reads is reused to avoid allocations. // The Symbolizer internal state is updated only if the input data is parsed // successfully. func (s *Symbolizer) updateSymbolsFrom(r io.Reader) error { diff --git a/libpf/pfelf/file.go b/libpf/pfelf/file.go index ebdf18db6..5791931c0 100644 --- a/libpf/pfelf/file.go +++ b/libpf/pfelf/file.go @@ -844,7 +844,7 @@ func (ph *Prog) Data(maxSize uint) ([]byte, error) { return mapping.Subslice(int(ph.Off), int(ph.Filesz)) } - // Fallback option if the file is not mmaped. + // Fallback option if the file is not mmapped. if ph.Filesz > uint64(maxSize) { return nil, fmt.Errorf("segment size %d is too large", ph.Filesz) } @@ -889,7 +889,7 @@ func (sh *Section) Data(maxSize uint) ([]byte, error) { return mapping.Subslice(int(sh.Offset), int(sh.FileSize)) } - // Fallback option if the file is not mmaped. + // Fallback option if the file is not mmapped. if sh.FileSize > uint64(maxSize) { return nil, fmt.Errorf("section size %d is too large", sh.FileSize) } @@ -898,7 +898,7 @@ func (sh *Section) Data(maxSize uint) ([]byte, error) { return p, err } -// SetDontNeed sets the flag MADV_DONTNEED on the mmaped data. +// SetDontNeed sets the flag MADV_DONTNEED on the mmapped data. func (f *File) SetDontNeed() { if mapping, ok := f.elfReader.(*mmap.ReaderAt); ok { if err := mapping.SetMadvDontNeed(); err != nil { diff --git a/libpf/pfelf/internal/mmap/mmap.go b/libpf/pfelf/internal/mmap/mmap.go index 95ce00940..fb648078b 100644 --- a/libpf/pfelf/internal/mmap/mmap.go +++ b/libpf/pfelf/internal/mmap/mmap.go @@ -74,7 +74,7 @@ func (r *ReaderAt) ReadAt(p []byte, off int64) (int, error) { return n, nil } -// Subslice returns a subset of the mmaped backed data. +// Subslice returns a subset of the mmapped backed data. func (r *ReaderAt) Subslice(offset, length int) ([]byte, error) { if offset+length > r.Len() { return nil, fmt.Errorf("requested data %x-%x exceeds %x: %w", diff --git a/rust-crates/symblib/README.md b/rust-crates/symblib/README.md index 9b0f42149..d452f15e4 100644 --- a/rust-crates/symblib/README.md +++ b/rust-crates/symblib/README.md @@ -69,13 +69,13 @@ Examples of such abstractions: ### Debugging the debug format parsers The debug information emitted by modern compilers is not nearly as well-tested -and maintained as the code that they are genearting. It's not at all uncommon to +and maintained as the code that they are generating. It's not at all uncommon to have at least partially broken debug info. The formats are also often very complex and it's easy to accidentally do incorrect parsing in our code. To simplify debugging and investigating such problems, we tend to have an internal debugging sub-command for each symbol format abstraction in `symbtool`. For -example, the `dwarf` abstration has a corresponding `dwarf` sub-command that in +example, the `dwarf` abstraction has a corresponding `dwarf` sub-command that in turn has a `dump` sub-command that prints (and optionally filters) all info that the format abstraction exposes in a format fit for human consumption. @@ -107,7 +107,7 @@ slow if we did them for every single frame that we want to symbolize. We then made the following observations: - in every stack trace, all[^all] frames except for the last one will always be a - return addresses thats follow a call + return address that follows a call - only a small fraction of instructions in a typical executables are calls Based on these observations, we came up with the idea to: @@ -145,7 +145,7 @@ sufficient to also get return pad extraction support for free**. `symblib` uses strong-typed error handling. Each major sub-module defines their own `Error` and `Result` types. These types are usually error `enums` that -explicitly list most common problems that can occurr during usage and implement +explicitly list most common problems that can occur during usage and implement the [`std::error::Error`] trait via the macros in the [`thiserror`] crate. The idea here is to allow library users to detect and specifically handle particular errors. Debug information in real-world executables is often partially broken, diff --git a/rust-crates/symblib/src/disas.rs b/rust-crates/symblib/src/disas.rs index 2e0421aa9..3ba4666b0 100644 --- a/rust-crates/symblib/src/disas.rs +++ b/rust-crates/symblib/src/disas.rs @@ -31,7 +31,7 @@ pub trait InstrDecoder { /// Information about an instruction. #[derive(Debug, Clone, PartialEq, Eq)] pub struct InstrInfo { - /// Virtual addresss of the instruction. + /// Virtual address of the instruction. pub addr: VirtAddr, /// Whether the instruction is a call or syscall. diff --git a/rust-crates/symblib/src/objfile.rs b/rust-crates/symblib/src/objfile.rs index e3a71863f..9e3e3f05b 100644 --- a/rust-crates/symblib/src/objfile.rs +++ b/rust-crates/symblib/src/objfile.rs @@ -452,7 +452,7 @@ impl<'obj> SectionData<'obj> { /// Builds a mutable reference to the section's data (CoW semantics). /// /// If the data was previously borrowed, the first call will force a copy; - /// all consecutive calls will re-use the same buffer. + /// all consecutive calls will reuse the same buffer. pub fn make_mut(&mut self) -> Result<&mut [u8]> { let borrowed = match self { // Fast paths: underlying buffer is writable already. diff --git a/rust-crates/symblib/src/symbconv/go.rs b/rust-crates/symblib/src/symbconv/go.rs index 636647faf..8b5ae8520 100644 --- a/rust-crates/symblib/src/symbconv/go.rs +++ b/rust-crates/symblib/src/symbconv/go.rs @@ -12,7 +12,7 @@ use fallible_iterator::FallibleIterator as _; /// Result type shorthand. pub type Result = std::result::Result; -/// Errors that can occurr during Go symbol extraction. +/// Errors that can occur during Go symbol extraction. #[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, thiserror::Error)] diff --git a/rust-crates/symblib/src/symbconv/mod.rs b/rust-crates/symblib/src/symbconv/mod.rs index dcb68a136..bbc6d5125 100644 --- a/rust-crates/symblib/src/symbconv/mod.rs +++ b/rust-crates/symblib/src/symbconv/mod.rs @@ -9,7 +9,7 @@ use std::io; /// Result type shorthand. pub type Result = std::result::Result; -/// Errors that can occurr during symbol extraction. +/// Errors that can occur during symbol extraction. #[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, thiserror::Error)] @@ -87,7 +87,7 @@ pub struct ResolvedSymbol { pub function_name: Option, /// File name that hold this function. pub file_name: Option, - /// Line number associcated with this virtual address. + /// Line number associated with this virtual address. pub line_number: Option, } diff --git a/rust-crates/symblib/src/symbconv/multi.rs b/rust-crates/symblib/src/symbconv/multi.rs index c88a459ae..488c8cca1 100644 --- a/rust-crates/symblib/src/symbconv/multi.rs +++ b/rust-crates/symblib/src/symbconv/multi.rs @@ -12,7 +12,7 @@ use std::ops; /// Result type shorthand. pub type Result = std::result::Result; -/// Errors that can occurr during extraction from multiple sources. +/// Errors that can occur during extraction from multiple sources. #[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, thiserror::Error)] diff --git a/rust-crates/symblib/src/symbfile/mod.rs b/rust-crates/symblib/src/symbfile/mod.rs index b810e0c96..c40cb0f28 100644 --- a/rust-crates/symblib/src/symbfile/mod.rs +++ b/rust-crates/symblib/src/symbfile/mod.rs @@ -81,7 +81,7 @@ pub enum Error { #[error("Not all arrays in a columnar struct-of-arrays have the same length")] ColumnLengthMismatch, - #[error("Encountered relative value without an absolut value preceding it")] + #[error("Encountered relative value without an absolute value preceding it")] RelativeValueWithoutReference, #[error("IO error")] diff --git a/support/ebpf/v8_tracer.h b/support/ebpf/v8_tracer.h index 54093beb7..cb6cfb0a9 100644 --- a/support/ebpf/v8_tracer.h +++ b/support/ebpf/v8_tracer.h @@ -17,7 +17,7 @@ #define V8_HeapObjectTagMask 0x3 // The Trace 'file' field is split to object pointer (aligned to 8 bytes), -// and the zero bits due to alignment are re-used as the following flags. +// and the zero bits due to alignment are reused as the following flags. #define V8_FILE_TYPE_MARKER 0x0 #define V8_FILE_TYPE_BYTECODE 0x1 #define V8_FILE_TYPE_NATIVE_SFI 0x2 diff --git a/tracer/events.go b/tracer/events.go index 6cb6d507e..c87b51f0f 100644 --- a/tracer/events.go +++ b/tracer/events.go @@ -88,7 +88,7 @@ func (t *Tracer) triggerReportEvent(data []byte) { // will wake up user-land. // // For each received event, triggerFunc is called. triggerFunc may NOT store -// references into the buffer that it is given: the buffer is re-used across +// references into the buffer that it is given: the buffer is reused across // calls. Returns a function that can be called to retrieve perf event array // error counts. func startPerfEventMonitor(ctx context.Context, perfEventMap *ebpf.Map, diff --git a/tracer/systemconfig.go b/tracer/systemconfig.go index a9d91c41a..51781dd6a 100644 --- a/tracer/systemconfig.go +++ b/tracer/systemconfig.go @@ -296,7 +296,7 @@ func determineSysConfig(coll *cebpf.CollectionSpec, maps map[string]*cebpf.Map, return nil } -// loadRodataVars initalizes RODATA variables for the eBPF programs. +// loadRodataVars initializes RODATA variables for the eBPF programs. func loadRodataVars(coll *cebpf.CollectionSpec, kmod *kallsyms.Module, cfg *Config) error { if cfg.VerboseMode { if err := coll.Variables["with_debug_output"].Set(uint32(1)); err != nil { diff --git a/tracer/tracer.go b/tracer/tracer.go index 96a75d9f5..aa9558bdf 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -992,7 +992,7 @@ func (t *Tracer) eBPFMetricsCollector( var ( errRecordTooSmall = errors.New("trace record too small") errRecordUnexpectedSize = errors.New("unexpected record size") - errOriginUnexpected = errors.New("unexepcted origin") + errOriginUnexpected = errors.New("unexpected origin") ) // loadBpfTrace parses a raw BPF trace into a `host.Trace` instance.