events

package
v0.0.0-...-b6c5e5e Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventCPUCycles       = eventBasic{"cpu-cycles", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CPU_CYCLES}
	EventInstructions    = eventBasic{"instructions", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_INSTRUCTIONS}
	EventCacheReferences = eventBasic{"cache-references", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CACHE_REFERENCES}
	EventCacheMisses     = eventBasic{"cache-misses", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CACHE_MISSES}
	EventBranches        = eventBasic{"branches", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BRANCH_INSTRUCTIONS}
	EventBranchesMisses  = eventBasic{"branch-misses", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BRANCH_MISSES}
	EventBusCycles       = eventBasic{"bus-cycles", unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BUS_CYCLES}
)

Functions

This section is empty.

Types

type Event

type Event interface {
	// String returns the string representation of this event, preferably as the
	// name used by "perf record -e".
	String() string

	// SetAttrs sets the attributes for this event in the [unix.PerfEventAttr]
	// struct.
	SetAttrs(*unix.PerfEventAttr) error
}

An Event represents a performance event that perf can count.

func ParseEvent

func ParseEvent(name string) (Event, error)

type EventScale

type EventScale interface {
	Event

	// ScaleUnit returns the factor to multiply raw values by to compute a
	// meaningful value, plus the unit of that value. A no-op implementation
	// should return 1.0, "".
	ScaleUnit() (scale float64, unit string)
}

An EventScale is an Event that provides a scaling factor and unit to convert raw values into meaningful values.

Jump to

Keyboard shortcuts

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