package perf

import "github.com/google/cadvisor/perf"

Collector of perf events for a container.

Configuration for perf event manager.

Manager of perf events for containers.

Index

Functions

func Finalize

func Finalize()

Finalize terminates libpfm4 to free resources.

func NewCollector

func NewCollector(cgroupPath string, events Events, numCores int) stats.Collector

func NewManager

func NewManager(configFile string, topology []info.Node) (stats.Manager, error)

Types

type Config

type Config []uint64

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(b []byte) error

type CustomEvent

type CustomEvent struct {
	// Type of the event. See perf_event_attr documentation
	// at man perf_event_open.
	Type uint32 `json:"type,omitempty"`

	// Symbolically formed event like:
	// pmu/config=PerfEvent.Config[0],config1=PerfEvent.Config[1],config2=PerfEvent.Config[2]
	// as described in man perf-stat.
	Config Config `json:"config"`

	// Human readable name of metric that will be created from the event.
	Name Event `json:"name"`
}

type Event

type Event string

type Events

type Events struct {
	// List of perf events' names to be measured.
	Events []Group `json:"events"`

	// List of custom perf events' to be measured. It is impossible to
	// specify some events using their names and in such case you have
	// to provide lower level configuration.
	CustomEvents []CustomEvent `json:"custom_events"`
}

type Group

type Group struct {
	// contains filtered or unexported fields
}

func (*Group) UnmarshalJSON

func (g *Group) UnmarshalJSON(b []byte) error

type PerfEvents

type PerfEvents struct {
	// Core perf events to be measured.
	Core Events `json:"core,omitempty"`

	// Uncore perf events to be measured.
	Uncore Events `json:"uncore,omitempty"`
}

Source Files

collector_no_libpfm.go config.go manager_no_libpfm.go

Version
v0.52.1 (latest)
Published
Mar 5, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
3 days ago

Tools for package owners.