-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from roxell/add-systemd-analyze
automated: linux: add systemd-analyze
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (C) 2024 Linaro Ltd. | ||
|
||
# shellcheck disable=SC1091 | ||
. ../../lib/sh-test-lib | ||
OUTPUT="$(pwd)/output" | ||
OUTPUT_FILE="${OUTPUT}/output.txt" | ||
RESULT_FILE="${OUTPUT}/result.txt" | ||
SKIP_INSTALL="true" | ||
|
||
usage() { | ||
echo "\ | ||
Usage: ${0} [-s True|False] | ||
" | ||
} | ||
|
||
while getopts "hs:" opt; do | ||
case $opt in | ||
s) | ||
SKIP_INSTALL="${OPTARG}" | ||
;; | ||
h|*) | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
create_out_dir "${OUTPUT}" | ||
|
||
pkgs="systemd" | ||
install_deps "${pkgs}" "${SKIP_INSTALL}" | ||
|
||
command -v systemd-analyze | ||
exit_on_fail "systemd-analyze not in ${PATH} or not installed" | ||
systemd-analyze | tee "${OUTPUT_FILE}" | ||
|
||
head -1 "${OUTPUT_FILE}" | grep -oP '\d+\.\d+s \(\w+\)' | while read -r row; do | ||
seconds=$(echo "${row}"| awk -F ' ' '{print $1}'|sed -e 's|s$||g') | ||
what=$(echo "${row}"| awk -F ' ' '{print $2}'|sed -e 's|^(||g'|sed -e 's|)$||g') | ||
echo "systemd-analyze-${what} pass ${seconds} seconds" | tee -a "${RESULT_FILE}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (C) 2024 Linaro Ltd. | ||
metadata: | ||
format: Lava-Test Test Definition 1.0 | ||
name: systemd-analyze | ||
description: | | ||
The systemd-analyze analyzes the boot times. It's boot times | ||
for firmware, bootloader, kernel and userspace. | ||
maintainer: | ||
- [email protected] | ||
os: | ||
- debian | ||
- ubuntu | ||
- fedora | ||
- centos | ||
- openembedded | ||
scope: | ||
- boot performance | ||
devices: | ||
- all | ||
|
||
params: | ||
SKIP_INSTALL: true | ||
|
||
run: | ||
steps: | ||
- cd ./automated/linux/systemd-analyze/ | ||
- ./systemd-analyze.sh -s "${SKIP_INSTALL}" | ||
- ../../utils/send-to-lava.sh ./output/result.txt |