payload

package
v0.0.0-...-c34bea4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventSample is equivalent to PERF_RECORD_SAMPLE
	EventSample = 9
	// RecordLost is equivalent to PERF_RECORD_LOST
	RecordLost = 2
)

Below constants are based on the ones from <linux/perf_event.h>.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meta

type Meta struct {
	Size uint32
	// contains filtered or unexported fields
}

Meta is used by readers to get information about the payload.

func (*Meta) MarshalBinary

func (meta *Meta) MarshalBinary() ([]byte, error)

MarshalBinary encodes the metadata into its binary representation.

func (*Meta) ReadBinary

func (meta *Meta) ReadBinary(r io.Reader) error

ReadBinary reads the metadata from its binary representation.

func (*Meta) UnmarshalBinary

func (meta *Meta) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the metadata from its binary representation.

func (*Meta) WriteBinary

func (meta *Meta) WriteBinary(w io.Writer) error

WriteBinary writes the metadata into its binary representation.

type Payload

type Payload struct {
	Data []byte
	CPU  int
	Lost uint64
	Type int
}

Payload is the structure used when copying events from the main monitor.

func (*Payload) Decode

func (pl *Payload) Decode(data []byte) error

Decode decodes the payload from its binary representation.

func (*Payload) DecodeBinary

func (pl *Payload) DecodeBinary(dec *gob.Decoder) error

DecodeBinary reads the payload from its binary representation.

func (*Payload) Encode

func (pl *Payload) Encode() ([]byte, error)

Encode encodes the payload into its binary representation.

func (*Payload) EncodeBinary

func (pl *Payload) EncodeBinary(enc *gob.Encoder) error

EncodeBinary writes the payload into its binary representation.

func (*Payload) ReadBinary

func (pl *Payload) ReadBinary(r io.Reader) error

ReadBinary reads the payload from its binary representation.

func (*Payload) WriteBinary

func (pl *Payload) WriteBinary(w io.Writer) error

WriteBinary writes the payload into its binary representation.

Jump to

Keyboard shortcuts

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