Documentation ¶
Index ¶
- Constants
- Variables
- func ArrowSamplesField(profileLabelFields []arrow.Field) []arrow.Field
- func ArrowSchema(profileLabelFields []arrow.Field) *arrow.Schema
- func EncodeArrowLocation(address uint64, hasMapping bool, mappingStart uint64, mappingLimit uint64, ...) []byte
- func EncodeOtelLocation(l *pprofextended.Location, m *pprofextended.Mapping, ...) []byte
- func EncodePprofLocation(l *pprofpb.Location, m *pprofpb.Mapping, funcs []*pprofpb.Function, ...) []byte
- func LocationsArrowSchema() *arrow.Schema
- func Schema() (*dynparquet.Schema, error)
- func SchemaDefinition() *schemapb.Schema
- func UvarintSize(x uint64) int
- type DecodeResult
- type Demangler
- type ExecutableInfo
- type Label
- type LabelColumn
- type Location
- type LocationLine
- type LocationsWriter
- type Mapping
- type Meta
- type NormalizedProfile
- type NormalizedSample
- type NumLabel
- type OldProfile
- type Profile
- type ProgHeader
- type Reader
- type RecordReader
- type SymbolizationInfo
- type SymbolizedSample
- type ValueType
- type Writer
Constants ¶
View Source
const ( ColumnLabelsPrefix = ColumnLabels + "." ColumnPprofLabelsPrefix = ColumnPprofLabels + "." )
View Source
const ( SchemaName = "parca" // The columns are sorted by their name in the schema too. ColumnDuration = "duration" ColumnLabels = "labels" ColumnName = "name" ColumnPeriod = "period" ColumnPeriodType = "period_type" ColumnPeriodUnit = "period_unit" ColumnPprofLabels = "pprof_labels" ColumnPprofNumLabels = "pprof_num_labels" ColumnSampleType = "sample_type" ColumnSampleUnit = "sample_unit" ColumnStacktrace = "stacktrace" ColumnTimestamp = "timestamp" ColumnValue = "value" )
View Source
const ( MaxVal9 = maxUint64 >> (1 + iota*7) MaxVal8 MaxVal7 MaxVal6 MaxVal5 MaxVal4 MaxVal3 MaxVal2 MaxVal1 )
MaxValN is the maximum varint-encoded integer that fits in N bytes.
Variables ¶
View Source
var LocationsField = arrow.Field{ Name: "locations", Type: arrow.ListOf(arrow.StructOf([]arrow.Field{{ Name: "address", Type: arrow.PrimitiveTypes.Uint64, }, { Name: "mapping_start", Type: arrow.PrimitiveTypes.Uint64, }, { Name: "mapping_limit", Type: arrow.PrimitiveTypes.Uint64, }, { Name: "mapping_offset", Type: arrow.PrimitiveTypes.Uint64, }, { Name: "mapping_file", Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary}, }, { Name: "mapping_build_id", Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary}, }, { Name: "lines", Type: arrow.ListOf(arrow.StructOf([]arrow.Field{{ Name: "line", Type: arrow.PrimitiveTypes.Int64, }, { Name: "function_name", Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary}, }, { Name: "function_system_name", Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary}, }, { Name: "function_filename", Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary}, }, { Name: "function_start_line", Type: arrow.PrimitiveTypes.Int64, }}...)), }}...)), }
Functions ¶
func ArrowSamplesField ¶ added in v0.19.0
func ArrowSchema ¶ added in v0.19.0
func EncodeArrowLocation ¶ added in v0.22.0
func EncodeArrowLocation( address uint64, hasMapping bool, mappingStart uint64, mappingLimit uint64, mappingOffset uint64, mappingFile []byte, buildID []byte, linesStartOffset int, linesEndOffset int, lines *array.List, line *array.Struct, lineNumber *array.Int64, lineFunctionName *array.Dictionary, lineFunctionNameDict *array.Binary, lineFunctionSystemName *array.Dictionary, lineFunctionSystemNameDict *array.Binary, lineFunctionFilename *array.RunEndEncoded, lineFunctionFilenameDict *array.Dictionary, lineFunctionFilenameDictValues *array.Binary, lineFunctionStartLine *array.Int64, ) []byte
func EncodeOtelLocation ¶ added in v0.22.0
func EncodeOtelLocation( l *pprofextended.Location, m *pprofextended.Mapping, funcs []*pprofextended.Function, stringTable []string, ) []byte
func EncodePprofLocation ¶ added in v0.22.0
func LocationsArrowSchema ¶ added in v0.19.0
func Schema ¶ added in v0.19.0
func Schema() (*dynparquet.Schema, error)
func SchemaDefinition ¶ added in v0.19.0
func UvarintSize ¶ added in v0.22.0
UvarintSize returns the number of bytes necessary to encode a given uint. Unfortunately the standard lib does not provide this function, so we create it here.
Types ¶
type DecodeResult ¶ added in v0.22.0
func DecodeInto ¶ added in v0.22.0
func DecodeInto(lw LocationsWriter, data []byte) (DecodeResult, error)
type ExecutableInfo ¶ added in v0.22.0
type ExecutableInfo struct { ElfType elf.Type TextProgHdrIndex int16 ProgHeaders []ProgHeader }
func ExecutableInfoFromELF ¶ added in v0.22.0
func ExecutableInfoFromELF(f *elf.File) (ExecutableInfo, error)
func (ExecutableInfo) FindProgramHeader ¶ added in v0.22.0
func (ei ExecutableInfo) FindProgramHeader(m Mapping, addr uint64) (*ProgHeader, error)
FindProgramHeader returns the program segment that matches the current mapping and the given address, or an error if it cannot find a unique program header.
type LabelColumn ¶ added in v0.19.0
type LocationLine ¶ added in v0.12.0
type LocationsWriter ¶ added in v0.19.0
type LocationsWriter struct { RecordBuilder *array.RecordBuilder LabelBuildersMap map[string]*array.BinaryDictionaryBuilder LabelBuilders []*array.BinaryDictionaryBuilder LocationsList *array.ListBuilder Locations *array.StructBuilder Addresses *array.Uint64Builder MappingStart *array.Uint64Builder MappingLimit *array.Uint64Builder MappingOffset *array.Uint64Builder MappingFile *array.BinaryDictionaryBuilder MappingBuildID *array.BinaryDictionaryBuilder Lines *array.ListBuilder Line *array.StructBuilder LineNumber *array.Int64Builder FunctionName *array.BinaryDictionaryBuilder FunctionSystemName *array.BinaryDictionaryBuilder FunctionFilename *array.BinaryDictionaryBuilder FunctionStartLine *array.Int64Builder Value *array.Int64Builder Diff *array.Int64Builder }
func NewLocationsWriter ¶ added in v0.19.0
func NewLocationsWriter(pool memory.Allocator) LocationsWriter
type Meta ¶ added in v0.12.0
type Meta struct { Name string PeriodType ValueType SampleType ValueType Timestamp int64 Duration int64 Period int64 }
func MetaFromPprof ¶ added in v0.8.0
func MetaFromPprof(p *pprofproto.Profile, name string, sampleIndex int) Meta
type NormalizedProfile ¶ added in v0.12.0
type NormalizedProfile struct { Samples []*NormalizedSample Meta Meta }
type NormalizedSample ¶ added in v0.12.0
type OldProfile ¶ added in v0.19.0
type OldProfile struct { Meta Meta Samples []*SymbolizedSample }
type ProgHeader ¶ added in v0.22.0
A ProgHeader represents a single ELF program header.
type Reader ¶ added in v0.19.0
type Reader struct { Profile Profile RecordReaders []*RecordReader }
type RecordReader ¶ added in v0.19.0
type RecordReader struct { Record arrow.Record LabelFields []arrow.Field LabelColumns []LabelColumn Locations *array.List Location *array.Struct Address *array.Uint64 MappingStart *array.Uint64 MappingLimit *array.Uint64 MappingOffset *array.Uint64 MappingFileIndices *array.Uint32 MappingFileDict *array.Binary MappingBuildIDIndices *array.Uint32 MappingBuildIDDict *array.Binary Lines *array.List Line *array.Struct LineNumber *array.Int64 LineFunctionNameIndices *array.Uint32 LineFunctionNameDict *array.Binary LineFunctionSystemNameIndices *array.Uint32 LineFunctionSystemNameDict *array.Binary LineFunctionFilenameIndices *array.Uint32 LineFunctionFilenameDict *array.Binary LineFunctionStartLine *array.Int64 Value *array.Int64 Diff *array.Int64 }
func NewRecordReader ¶ added in v0.19.0
func NewRecordReader(ar arrow.Record) *RecordReader
type SymbolizationInfo ¶ added in v0.22.0
func DecodeSymbolizationInfo ¶ added in v0.22.0
func DecodeSymbolizationInfo(data []byte) (SymbolizationInfo, uint64)
type SymbolizedSample ¶ added in v0.12.0
type Writer ¶ added in v0.19.0
type Writer struct { RecordBuilder *array.RecordBuilder LabelBuildersMap map[string]*array.BinaryDictionaryBuilder LabelBuilders []*array.BinaryDictionaryBuilder LocationsList *array.ListBuilder Locations *array.StructBuilder Addresses *array.Uint64Builder MappingStart *array.Uint64Builder MappingLimit *array.Uint64Builder MappingOffset *array.Uint64Builder MappingFile *array.BinaryDictionaryBuilder MappingBuildID *array.BinaryDictionaryBuilder Lines *array.ListBuilder Line *array.StructBuilder LineNumber *array.Int64Builder FunctionName *array.BinaryDictionaryBuilder FunctionSystemName *array.BinaryDictionaryBuilder FunctionFilename *array.BinaryDictionaryBuilder FunctionStartLine *array.Int64Builder Value *array.Int64Builder Diff *array.Int64Builder }
Click to show internal directories.
Click to hide internal directories.