payload

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 17

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

func ReadMetaPayload added in v1.5.0

func ReadMetaPayload(r io.Reader, meta *Meta, pl *Payload) error

ReadMetaPayload reads a Meta and Payload from a Cilium monitor connection.

func WriteMetaPayload added in v1.5.0

func WriteMetaPayload(w io.Writer, meta *Meta, pl *Payload) error

WriteMetaPayload writes a Meta and Payload into a Cilium monitor connection. meta.Size is set to the size of the encoded Payload.

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) BuildMessage added in v1.5.0

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

BuildMessage builds the binary message to be sent and returns it

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