kernel

package
v0.0.0-...-d2356ba Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: Apache-2.0 Imports: 8 Imported by: 10

Documentation

Overview

Package kernel parses Kernel wakesource files, and outputs CSV entries for integration with Historian v2.

Index

Constants

View Source
const (
	// TimeLayout is the layout passed to time.Parse.
	TimeLayout = "2006-01-02 15:04:05"

	// PositiveTransition is the string for positive transitions in the Kernel wakesource file.
	PositiveTransition = "wakeup_source_activate"

	// NegativeTransition is the string for negative transitions in the Kernel wakesource file.
	NegativeTransition = "wakeup_source_deactivate"

	// KernelWakeSource is the csv description for the Kernel wakesource metric.
	KernelWakeSource = "Kernel Wakesource"
)

Variables

View Source
var (

	// TraceFileRE is a regular expression to match the top line in a kernel trace file.
	TraceFileRE = regexp.MustCompile(`^# tracer: nop\n`)

	// WakeSourceRE is a regular expression to match a line in the Kernel wakesource file.
	//   e.g. healthd-188 [001] d..2 "2015-05-28 19:50:27.636636" wakeup_source_activate: eventpoll state=0x176d0004
	WakeSourceRE = regexp.MustCompile(`^` + `[^"]+` + `\s+` + `["]` + `(?P<timeStamp>[^.]+)` + `[.]` + `(?P<remainder>\d+)` + `["]` + `\s+` + `(?P<transitionType>\S+):` + `\s+` + `(?P<value>\S+)`)
)

Functions

func IsSupportedDevice

func IsSupportedDevice(device string) bool

IsSupportedDevice returns true if the kernel trace file is currently parseable for that device. 'device' should be device name (eg. hammerhead) and not model name (eg. Nexus 5).

func IsTrace

func IsTrace(f []byte) bool

IsTrace returns true if the given contents match a kernel trace file.

func Parse

func Parse(f string) (bool, string, []error)

Parse writes a csv entry for each line in the kernel log file, and returns whether the format was valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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