debugd

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package debugd interacts with debugd D-Bus service.

Index

Constants

View Source
const (
	DRMTraceCategoryCore   DRMTraceCategories = 0x001
	DRMTraceCategoryDriver                    = 0x002
	DRMTraceCategoryKMS                       = 0x004
	DRMTraceCategoryPrime                     = 0x008
	DRMTraceCategoryAtomic                    = 0x010
	DRMTraceCategoryVBL                       = 0x020
	DRMTraceCategoryState                     = 0x040
	DRMTraceCategoryLease                     = 0x080
	DRMTraceCategoryDP                        = 0x100
	DRMTraceCategoryDRMRes                    = 0x200
)

This must match the DRMTraceCategories flags defined in org.chromium.debugd.xml.

Variables

This section is empty.

Functions

This section is empty.

Types

type CUPSResult

type CUPSResult int32

CUPSResult is a status code for the CUPS related debugd D-Bus methods. Values are from platform2/system_api/dbus/debugd/dbus-constants.h

const (
	// CUPSSuccess indicates the operation succeeded.
	CUPSSuccess CUPSResult = 0

	// CUPSFatal indicates the operation failed for an unknown reason.
	CUPSFatal CUPSResult = 1

	// CUPSInvalidPPD indicates the operation failed because the given PPD is invalid.
	CUPSInvalidPPD CUPSResult = 2

	// CUPSLPAdminFailure indicates the operation failed because lpadmin command failed.
	CUPSLPAdminFailure CUPSResult = 3

	// CUPSAutoconfFailure indicates the operation failed due to autoconf failures.
	CUPSAutoconfFailure CUPSResult = 4

	// CUPSBadURI indicates that the operation failed because debugd
	// rejected the printer URI.
	CUPSBadURI CUPSResult = 5

	// CUPSIOError indicates that the operation failed because of I/O error.
	CUPSIOError CUPSResult = 6

	// CUPSMemoryAllocError indicates that the operation failed because of
	// memory allocation error.
	CUPSMemoryAllocError CUPSResult = 7

	// CUPSPrinterUnreachable indicates that the printer did not respond.
	CUPSPrinterUnreachable CUPSResult = 8

	// CUPSPrinterWrongResponse indicates that the printer sent
	// an unexpected response.
	CUPSPrinterWrongResponse CUPSResult = 9

	// CUPSPrinterNotAutoconf indicates that the operation failed because
	// the printer is not autoconfigurable as it supposed to be.
	CUPSPrinterNotAutoconf CUPSResult = 10
)

func (CUPSResult) String

func (r CUPSResult) String() string

type DRMTraceCategories

type DRMTraceCategories uint32

DRMTraceCategories is a bitmask used as an argument to the DRMTraceSetCategories method.

type DRMTraceSize

type DRMTraceSize uint32

DRMTraceSize is an enumeration used as an argument to the DRMTraceSetSize method.

const (
	DRMTraceSizeDefault DRMTraceSize = 0
	DRMTraceSizeDebug                = 1
)

This must match the DRMTraceSize enum defined in org.chromium.debugd.xml.

type DRMTraceSnapshotType

type DRMTraceSnapshotType uint32

DRMTraceSnapshotType is an enumeration used as an argument to the DRMTraceSnapshot method.

const (
	DRMTraceSnapshotTypeTrace    DRMTraceSnapshotType = 0
	DRMTraceSnapshotTypeModetest DRMTraceSnapshotType = 1
)

This must match the DRMTraceSnapshotType enum defined in org.chromium.debugd.xml.

type Debugd

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

Debugd is used to interact with the debugd process over D-Bus. For detailed spec of each D-Bus method, please find src/platform2/debugd/dbus_bindings/org.chromium.debugd.xml

func New

func New(ctx context.Context) (*Debugd, error)

New connects to debugd via D-Bus and returns a Debugd object.

func (*Debugd) CupsAddAutoConfiguredPrinter

func (d *Debugd) CupsAddAutoConfiguredPrinter(ctx context.Context, name, uri string) (CUPSResult, error)

CupsAddAutoConfiguredPrinter calls debugd.CupsAddAutoConfiguredPrinter D-Bus method.

func (*Debugd) CupsAddManuallyConfiguredPrinter

func (d *Debugd) CupsAddManuallyConfiguredPrinter(ctx context.Context, name, uri string, ppdContents []byte) (CUPSResult, error)

CupsAddManuallyConfiguredPrinter calls debugd.CupsAddManuallyConfiguredPrinter D-Bus method.

func (*Debugd) CupsRemovePrinter

func (d *Debugd) CupsRemovePrinter(ctx context.Context, name string) error

CupsRemovePrinter calls debugd.CupsRemovePrinter D-Bus method.

func (*Debugd) DRMTraceAnnotateLog

func (d *Debugd) DRMTraceAnnotateLog(ctx context.Context, log string) (err error)

DRMTraceAnnotateLog calls debugd's DRMTraceAnnotateLog D-Bus method.

func (*Debugd) DRMTraceSetCategories

func (d *Debugd) DRMTraceSetCategories(ctx context.Context, categories DRMTraceCategories) (err error)

DRMTraceSetCategories calls debugd's DRMTraceSetCategories D-Bus method.

func (*Debugd) DRMTraceSetSize

func (d *Debugd) DRMTraceSetSize(ctx context.Context, size DRMTraceSize) (err error)

DRMTraceSetSize calls debugd's DRMTraceSetSize D-Bus method.

func (*Debugd) DRMTraceSnapshot

func (d *Debugd) DRMTraceSnapshot(ctx context.Context, snapshotType DRMTraceSnapshotType) (err error)

DRMTraceSnapshot calls debugd's DRMTraceSnapshot D-Bus method.

func (*Debugd) GetPerfOutputV2

func (d *Debugd) GetPerfOutputV2(ctx context.Context, quipperArgs []string, disableCPUIdle bool, output *os.File) (uint64, error)

GetPerfOutputV2 calls debugd's GetPerfOutputV2 D-Bus method.

func (*Debugd) PacketCaptureStart

func (d *Debugd) PacketCaptureStart(ctx context.Context, output, stat *os.File, options map[string]dbus.Variant) (h string, err error)

PacketCaptureStart calls debugd's PacketCaptureStart D-Bus method.

func (*Debugd) PacketCaptureStop

func (d *Debugd) PacketCaptureStop(ctx context.Context, handle string) (err error)

PacketCaptureStop calls debugd's PacketCaptureStop D-Bus method.

func (*Debugd) SetCrashSenderTestMode

func (d *Debugd) SetCrashSenderTestMode(ctx context.Context, testMode bool) (err error)

SetCrashSenderTestMode calls debugd's SetCrashSenderTestMode. If this is set to true, the crash_sender invoked from debugd will just touch the "test successful" file instead of uploading crashes.

func (*Debugd) SetSchedulerConfiguration

func (d *Debugd) SetSchedulerConfiguration(ctx context.Context, param Scheduler) (err error)

SetSchedulerConfiguration calls debugd's SetSchedulerConfigurationV2 D-Bus method.

func (*Debugd) StopPerf

func (d *Debugd) StopPerf(ctx context.Context, sessionID uint64) error

StopPerf calls debugd's StopPerf D-Bus method.

type Scheduler

type Scheduler string

Scheduler describes a scheduler mode that can be applied via SetSchedulerConfiguration.

const (
	// Conservative scheduler favors stability.
	Conservative Scheduler = "conservative"
	// Performance scheduler favors speed.
	Performance = "performance"
)

Jump to

Keyboard shortcuts

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