-
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.
initrdscripts: add bootchart hook w/ OS_DEVELOPMENT=1
Run systemd-bootchart in an initramfs hook early in the boot process to collect information on CPU and disk load, and output to a chart in /run/log. This hook is disabled by default, and can be enabled using the `bootchart` bootparam. Change-type: patch Signed-off-by: Joseph Kogut <[email protected]>
- Loading branch information
Showing
3 changed files
with
28 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
19 changes: 19 additions & 0 deletions
19
meta-balena-common/recipes-core/initrdscripts/files/bootchart
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,19 @@ | ||
#!/bin/sh | ||
|
||
bootchart_enabled() { | ||
# shellcheck disable=SC2154 | ||
[ "${bootparam_bootchart}" = "true" ] && return 0 || return 1 | ||
} | ||
|
||
bootchart_run() { | ||
# bootchart runs backgrounded through switch_root, after the real root | ||
# is mounted and init is run, until it's collected enough samples, at | ||
# which point it exits | ||
# | ||
# argv[0][0] is replaced with '@' in main() to indicate that the | ||
# process remains from the initramfs, and to prevent init from killing | ||
# it | ||
# | ||
# https://freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ | ||
( exec /lib/systemd/systemd-bootchart ) & | ||
} |
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