bpfstack

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bpfstack parses the raw layout produced by BPF_MAP_TYPE_STACK_TRACE: a fixed 127-slot buffer of little-endian u64 instruction pointers, terminated by a zero slot. Shared between profile/ (CPU sampling) and offcpu/ (sched_switch tracking).

Index

Constants

View Source
const MaxFrames = 127

MaxFrames is the depth of a BPF stackmap entry. Matches the BPF PERF_MAX_STACK_DEPTH macro in bpf/perf.bpf.c and bpf/offcpu.bpf.c.

Variables

This section is empty.

Functions

func ExtractIPs

func ExtractIPs(stack []byte) []uint64

ExtractIPs decodes a BPF stackmap entry into a slice of instruction pointers, stopping at the first zero slot. Buffers shorter than MaxFrames*8 bytes are processed up to their length; buffers longer are truncated at MaxFrames.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL