Documentation
¶
Overview ¶
Code generated by glibc_dwarfdump. DO NOT EDIT.
Code generated by musl_dwarfdump. DO NOT EDIT.
Code generated by python_dwarfdump. DO NOT EDIT.
Index ¶
- Variables
- func GetTSSKey(pid uint32, version Version, offsets *UserOffsets, ...) (int32, error)
- func LoadPerf() (*ebpf.CollectionSpec, error)
- func LoadPerfObjects(obj interface{}, opts *ebpf.CollectionOptions) error
- func PythonString(tok []int8, typ *PerfPyStrType) string
- func ReadPyEvent(raw []byte, event *PerfPyEvent) error
- type GlibcOffsets
- type LazySymbols
- type MuslOffsets
- type Perf
- func (s *Perf) Close()
- func (s *Perf) CollectEvents(buf []*PerfPyEvent) []*PerfPyEvent
- func (s *Perf) FindProc(pid uint32) *Proc
- func (s *Perf) GetLazySymbols() LazySymbols
- func (s *Perf) GetSymbols(svcReason string) (map[uint32]*PerfPySymbol, error)
- func (s *Perf) NewProc(pid uint32, data *PerfPyPidData, options *symtab.SymbolOptions, ...) (*Proc, error)
- func (s *Perf) RemoveDeadPID(pid uint32)
- type PerfLibc
- type PerfMapSpecs
- type PerfMaps
- type PerfObjects
- type PerfProgramSpecs
- type PerfPrograms
- type PerfPyEvent
- type PerfPyOffsetConfig
- type PerfPyPidData
- type PerfPySampleStateT
- type PerfPyStrType
- type PerfPySymbol
- type PerfSpecs
- type Proc
- type ProcInfo
- type PyError
- type PyStrType
- type StackStatus
- type UserOffsets
- type Version
Constants ¶
This section is empty.
Variables ¶
var Py311 = &Version{Major: 3, Minor: 11}
var Py312 = &Version{Major: 3, Minor: 12}
var Py313 = &Version{Major: 3, Minor: 13}
var Py37 = &Version{Major: 3, Minor: 7}
Functions ¶
func LoadPerf ¶
func LoadPerf() (*ebpf.CollectionSpec, error)
LoadPerf returns the embedded CollectionSpec for Perf.
func LoadPerfObjects ¶
func LoadPerfObjects(obj interface{}, opts *ebpf.CollectionOptions) error
LoadPerfObjects loads Perf and converts it into a struct.
The following types are suitable as obj argument:
*PerfObjects *PerfPrograms *PerfMaps
See ebpf.CollectionSpec.LoadAndAssign documentation for details.
func PythonString ¶
func PythonString(tok []int8, typ *PerfPyStrType) string
func ReadPyEvent ¶ added in v0.7.1
func ReadPyEvent(raw []byte, event *PerfPyEvent) error
Types ¶
type GlibcOffsets ¶
type LazySymbols ¶
type LazySymbols struct {
// contains filtered or unexported fields
}
LazySymbols tries to reuse a map from previous profile collection. If found a new symbols, then full dump ( GetSymbols ) is performed.
func (*LazySymbols) GetSymbol ¶
func (s *LazySymbols) GetSymbol(symID uint32, svc string) (*PerfPySymbol, error)
type MuslOffsets ¶
type Perf ¶
type Perf struct {
// contains filtered or unexported fields
}
func (*Perf) CollectEvents ¶
func (s *Perf) CollectEvents(buf []*PerfPyEvent) []*PerfPyEvent
func (*Perf) GetLazySymbols ¶
func (s *Perf) GetLazySymbols() LazySymbols
func (*Perf) GetSymbols ¶
func (s *Perf) GetSymbols(svcReason string) (map[uint32]*PerfPySymbol, error)
func (*Perf) NewProc ¶
func (s *Perf) NewProc(pid uint32, data *PerfPyPidData, options *symtab.SymbolOptions, serviceName string) (*Proc, error)
func (*Perf) RemoveDeadPID ¶
type PerfLibc ¶
type PerfMapSpecs ¶
type PerfMapSpecs struct {
PyEvents *ebpf.MapSpec `ebpf:"py_events"`
PyPidConfig *ebpf.MapSpec `ebpf:"py_pid_config"`
PyProgs *ebpf.MapSpec `ebpf:"py_progs"`
PyStateHeap *ebpf.MapSpec `ebpf:"py_state_heap"`
PySymbols *ebpf.MapSpec `ebpf:"py_symbols"`
Stacks *ebpf.MapSpec `ebpf:"stacks"`
}
PerfMapSpecs contains maps before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type PerfMaps ¶
type PerfMaps struct {
PyEvents *ebpf.Map `ebpf:"py_events"`
PyPidConfig *ebpf.Map `ebpf:"py_pid_config"`
PyProgs *ebpf.Map `ebpf:"py_progs"`
PyStateHeap *ebpf.Map `ebpf:"py_state_heap"`
PySymbols *ebpf.Map `ebpf:"py_symbols"`
Stacks *ebpf.Map `ebpf:"stacks"`
}
PerfMaps contains all maps after they have been loaded into the kernel.
It can be passed to LoadPerfObjects or ebpf.CollectionSpec.LoadAndAssign.
type PerfObjects ¶
type PerfObjects struct {
PerfPrograms
PerfMaps
}
PerfObjects contains all objects after they have been loaded into the kernel.
It can be passed to LoadPerfObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*PerfObjects) Close ¶
func (o *PerfObjects) Close() error
type PerfProgramSpecs ¶
type PerfProgramSpecs struct {
PyperfCollect *ebpf.ProgramSpec `ebpf:"pyperf_collect"`
ReadPythonStack *ebpf.ProgramSpec `ebpf:"read_python_stack"`
}
PerfSpecs contains programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type PerfPrograms ¶
type PerfPrograms struct {
PyperfCollect *ebpf.Program `ebpf:"pyperf_collect"`
ReadPythonStack *ebpf.Program `ebpf:"read_python_stack"`
}
PerfPrograms contains all programs after they have been loaded into the kernel.
It can be passed to LoadPerfObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*PerfPrograms) Close ¶
func (p *PerfPrograms) Close() error
type PerfPyEvent ¶
type PerfPyOffsetConfig ¶
type PerfPyOffsetConfig struct {
PyThreadStateFrame int16
PyThreadStateCframe int16
PyCFrameCurrentFrame int16
PyCodeObjectCoFilename int16
PyCodeObjectCoName int16
PyCodeObjectCoVarnames int16
PyCodeObjectCoLocalsplusnames int16
PyTupleObjectObItem int16
PyVarObjectObSize int16
PyObjectObType int16
PyTypeObjectTpName int16
VFrameCode int16
VFramePrevious int16
VFrameLocalsplus int16
PyInterpreterFrameOwner int16
PyASCIIObjectSize int16
PyCompactUnicodeObjectSize int16
}
type PerfPyPidData ¶
type PerfPyPidData struct {
Offsets PerfPyOffsetConfig
Version struct {
Major uint32
Minor uint32
Patch uint32
}
Libc PerfLibc
TssKey int32
// contains filtered or unexported fields
}
func GetPyPerfPidData ¶
func GetPyPerfPidData(l log.Logger, pid uint32) (*PerfPyPidData, error)
type PerfPySampleStateT ¶
type PerfPySampleStateT struct {
SymbolCounter int64
Offsets PerfPyOffsetConfig
CurCpu uint32
FramePtr uint64
PythonStackProgCallCnt int64
Event PerfPyEvent
// contains filtered or unexported fields
}
type PerfPyStrType ¶
type PerfPySymbol ¶
type PerfPySymbol struct {
Classname [32]int8
Name [64]int8
File [128]int8
ClassnameType PerfPyStrType
NameType PerfPyStrType
FileType PerfPyStrType
Padding PerfPyStrType
}
type PerfSpecs ¶
type PerfSpecs struct {
PerfProgramSpecs
PerfMapSpecs
}
PerfSpecs contains maps and programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type Proc ¶
type Proc struct {
PerfPyPidData *PerfPyPidData
SymbolOptions *symtab.SymbolOptions
}
type ProcInfo ¶
type PyError ¶
type PyError uint8
var ( PyErrorGeneric PyError = 1 PyErrorThreadState PyError = 2 PyErrorThreadStateNull PyError = 3 PyErrorTopFrame PyError = 4 PyErrorFrameCode PyError = 5 PyErrorFramePrev PyError = 6 PyErrorSymbol PyError = 7 PyErrorTlsbase PyError = 8 PyErrorFirstArg PyError = 9 PyErrorClassName PyError = 10 PyErrorFileName PyError = 11 PyErrorName PyError = 12 )
type StackStatus ¶
type StackStatus uint8
var ( StackStatusComplete StackStatus = 0 StackStatusError StackStatus = 1 StackStatusTruncated StackStatus = 2 )
func (StackStatus) String ¶
func (s StackStatus) String() string
type UserOffsets ¶
type UserOffsets struct {
PyVarObject_ob_size int16
PyObject_ob_type int16
PyTypeObject_tp_name int16
PyThreadState_frame int16
PyThreadState_cframe int16
PyThreadState_current_frame int16
PyCFrame_current_frame int16
PyFrameObject_f_back int16
PyFrameObject_f_code int16
PyFrameObject_f_localsplus int16
PyCodeObject_co_filename int16
PyCodeObject_co_name int16
PyCodeObject_co_varnames int16
PyCodeObject_co_localsplusnames int16
PyTupleObject_ob_item int16
PyInterpreterFrame_f_code int16
PyInterpreterFrame_f_executable int16
PyInterpreterFrame_previous int16
PyInterpreterFrame_localsplus int16
PyInterpreterFrame_owner int16
PyRuntimeState_gilstate int16
PyRuntimeState_autoTSSkey int16
Gilstate_runtime_state_autoTSSkey int16
PyTssT_is_initialized int16
PyTssT_key int16
PyTssTSize int16
PyASCIIObjectSize int16
PyCompactUnicodeObjectSize int16
}
UserOffsets keeps Python offsets which are then partially passed to ebpf with ProfilePyOffsetConfig
func GetUserOffsets ¶
func GetUserOffsets(version Version) (*UserOffsets, bool, error)
type Version ¶
type Version struct {
Major, Minor, Patch int
}
func GetGlibcVersionFromFile ¶
func GetMuslVersionFromFile ¶
func GetMuslVersionFromReader ¶
GetMuslVersionFromReader return minor musl version. For example 1 for 1.1.44 and 2 for 1.2.4
func GetPythonPatchVersion ¶
GetPythonPatchVersion searches for a patch version given a major + minor version with regexp r is libpython3.11.so or python3.11 elf binary