trace

package
v0.0.0-...-ef90cfb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUEvents

func CPUEvents(ctx context.Context, frequency time.Duration) error

func Enable

func Enable(prefix string) error

Enable is a convenience function for creating a file in $TMPDIR/distri.traces/prefix.$PID.

The filename assumes the OS does not frequently re-use the same pid.

func MemEvents

func MemEvents(ctx context.Context, frequency time.Duration) error

func Sink

func Sink(w io.Writer)

Sink writes all following Event()s as a Chrome trace event file into w.

Types

type PendingEvent

type PendingEvent struct {
	Name           string      `json:"name"` // name of the event, as displayed in Trace Viewer
	Categories     string      `json:"cat"`  // event categories (comma-separated)
	Type           string      `json:"ph"`   // event type (single character)
	ClockTimestamp uint64      `json:"ts"`   // tracing clock timestamp (microsecond granularity)
	Duration       uint64      `json:"dur"`
	Pid            uint64      `json:"pid"` // process ID for the process that output this event
	Tid            uint64      `json:"tid"` // thread ID for the thread that output this event
	Args           interface{} `json:"args"`
	// contains filtered or unexported fields
}

func Event

func Event(name string, tid int) *PendingEvent

func (*PendingEvent) Done

func (pe *PendingEvent) Done()

Jump to

Keyboard shortcuts

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