bootperf

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: 18 Imported by: 0

Documentation

Overview

Package bootperf provides constants and common utilities for test platform.BootPerf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDiff

func CalculateDiff(results *platform.GetBootPerfMetricsResponse)

CalculateDiff generates metrics from existing ones. Metrics of time and rdbytes are calculated from kernel startup. For example, metric "seconds_startup_to_chrome_exec" that represents time from the "startup" stage to Chrome execution begins, is calculated from subtracting "seconds_kernel_to_chrome_exec" to "seconds_kernel_to_startup".

func DisableBootchart

func DisableBootchart(ctx context.Context) error

DisableBootchart Disables bootchart by removing "cros_bootchart" from kernel arguments.

func EnableBootchart

func EnableBootchart(ctx context.Context) error

EnableBootchart enables bootchart by adding "cros_bootchart" to kernel arguments.

func GatherConsoleRamoops

func GatherConsoleRamoops(raw map[string][]byte) error

GatherConsoleRamoops gathers console_ramoops from previous reboot.

func GatherDiskMetrics

func GatherDiskMetrics(results *platform.GetBootPerfMetricsResponse)

GatherDiskMetrics reads and reports disk read metrics. It reads "sectors read since kernel startup" from the bootstat files for the events named in |eventMetrics|, converts the values to "bytes read since boot", and stores the values as perf metrics. The following metrics are recorded:

  • rdbytes_kernel_to_startup
  • rdbytes_kernel_to_startup_done
  • rdbytes_kernel_to_chrome_exec
  • rdbytes_kernel_to_chrome_main
  • rdbytes_kernel_to_login

Disk statistics are reported in units of 512 byte sectors; we convert the metrics to bytes so that downstream consumers don't have to ask "How big is a sector?".

func GatherFirmwareBootTime

func GatherFirmwareBootTime(ctx context.Context, results *platform.GetBootPerfMetricsResponse) error

GatherFirmwareBootTime gets firmware startup time from the firmware log or the timestamp file.

func GatherMetricRawDataFiles

func GatherMetricRawDataFiles(raw map[string][]byte) error

GatherMetricRawDataFiles gathers content of raw data files to be returned to the client.

func GatherRebootMetrics

func GatherRebootMetrics(results *platform.GetBootPerfMetricsResponse) error

GatherRebootMetrics reads and reports shutdown and reboot times. The shutdown process saves all bootstat files in /var/log, plus it saves a timestamp file that can be used to convert "time since boot" into times in UTC. Read the saved files from the most recent shutdown, and use them to calculate the time spent from the start of that shutdown until the completion of the most recent boot. This function records these metrics:

  • seconds_shutdown_time
  • seconds_reboot_time
  • seconds_reboot_error

func GatherTimeMetrics

func GatherTimeMetrics(ctx context.Context, results *platform.GetBootPerfMetricsResponse) error

GatherTimeMetrics reads and reports boot time metrics. It reads "seconds since kernel startup" from the bootstat files for the events named in |eventMetrics|, and stores the values as perf metrics. The following metrics may be recorded:

  • seconds_kernel_to_startup
  • seconds_kernel_to_startup_done
  • seconds_kernel_to_chrome_exec
  • seconds_kernel_to_chrome_main
  • seconds_kernel_to_signin_start
  • seconds_kernel_to_signin_wait
  • seconds_kernel_to_signin_users
  • seconds_kernel_to_login
  • seconds_kernel_to_android_start
  • seconds_kernel_to_cellular_registered
  • seconds_kernel_to_wifi_registered
  • seconds_kernel_to_network

func StoreFirmwareTimestamps

func StoreFirmwareTimestamps(ctx context.Context, raw map[string][]byte)

StoreFirmwareTimestamps stores the raw firmware timestamps from `cbmem -t`.

func WaitUntilBootComplete

func WaitUntilBootComplete(ctx context.Context) error

WaitUntilBootComplete is a helper function to wait until boot complete and we are ready to collect boot metrics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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