Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ sent through:
`<code block embedding removed: git history no longer exists>`

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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion design-docs/00001-off-cpu-profiling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion design-docs/00002-custom-labels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion internal/log/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion interpreter/golabels/tls_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <runtime.mheap_+101440>
// 0x000000000007f264 <+4>: ldrsb x0, [x27, #284]
// 0x000000000007f268 <+8>: cbz x0, 0x7f278 <runtime.load_g+24>
Expand Down
2 changes: 1 addition & 1 deletion kallsyms/kallsyms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions libpf/pfelf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion libpf/pfelf/internal/mmap/mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions rust-crates/symblib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib/src/disas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib/src/objfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib/src/symbconv/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use fallible_iterator::FallibleIterator as _;
/// Result type shorthand.
pub type Result<T = (), E = Error> = std::result::Result<T, E>;

/// 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)]
Expand Down
4 changes: 2 additions & 2 deletions rust-crates/symblib/src/symbconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::io;
/// Result type shorthand.
pub type Result<T = (), E = Error> = std::result::Result<T, E>;

/// Errors that can occurr during symbol extraction.
/// Errors that can occur during symbol extraction.
#[non_exhaustive]
#[allow(missing_docs)]
#[derive(Debug, thiserror::Error)]
Expand Down Expand Up @@ -87,7 +87,7 @@ pub struct ResolvedSymbol {
pub function_name: Option<String>,
/// File name that hold this function.
pub file_name: Option<String>,
/// Line number associcated with this virtual address.
/// Line number associated with this virtual address.
pub line_number: Option<u32>,
}

Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib/src/symbconv/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::ops;
/// Result type shorthand.
pub type Result<T = (), E = Error> = std::result::Result<T, E>;

/// 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)]
Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib/src/symbfile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion support/ebpf/v8_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tracer/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tracer/systemconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down