-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initramfs bootchart #3098
base: master
Are you sure you want to change the base?
initramfs bootchart #3098
Conversation
e381564
to
c516bc2
Compare
c516bc2
to
7cfbc27
Compare
a641112
to
7a93fb4
Compare
d7d46a5
to
6203584
Compare
6203584
to
b8bee59
Compare
b8bee59
to
11a006b
Compare
0456d08
to
8701ae1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try not to modify production code to introduce an OS development helper tool.
mount --move /sys $ROOTFS_DIR/sys | ||
|
||
# remount proc in $ROOTFS_DIR instead of moving if systemd-bootchart is | ||
# running, as it reads from /proc/schedstat | ||
if pgrep systemd-bootchart; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing pgrep
is also included in the initramfs or it's an enabled busybox applet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexgg pgrep
is provided by busybox, is there a way to add this as an RDEPENDS
?
@@ -14,10 +14,10 @@ prepare_run() { | |||
if ! mount -t tmpfs -o "nosuid,nodev,strictatime,mode=0755" tmpfs /run; then | |||
warn "Couldn't mount /run so initramfs logs will not be persistent." | |||
fi | |||
mkdir -m 0755 /run/initramfs | |||
mkdir -m 0755 /run/log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any special reason for the name change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexgg By default, bootchart outputs to /run/log
, so this directory needs created anyway. Rather than create both /run/initramfs
and /run/log
, I chose to consolidate on /run/log
, which is more conventional.
@@ -17,7 +18,8 @@ SRC_URI:append = " \ | |||
" | |||
|
|||
do_install:append() { | |||
install -m 0755 ${WORKDIR}/prepare ${D}/init.d/70-prepare | |||
install -m 0755 ${WORKDIR}/prepare ${D}/init.d/00-prepare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we had:
000-console_null
00-debug
01-udev
70-prepare
I'd rather leave the prepare module after udev as it was before, but I am guessing prepare mounts somewhere where bootchar logs and we want bootchart to also include udev data, right?
I would prefer if the introduction of this bootchart module which is really only useful for OS development would not modify production code, like moving prepare before udev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexgg Correct, bootchart is intended to run as early as possible to profile the boot process, and udev (as well as many of the subprocesses it spawns) is one of the primary resource consumers during boot.
The prepare hook mounts a tmpfs at /run
, which is where the bootchart output is written.
We could duplicate this in the bootchart hook in the run()
function before running bootchart, but I found it cleaner to just mount /run
earlier.
This should also result in more complete logs, especially when debugging udev rules, as we capture any output much earlier.
0ef57cb
to
6117ea9
Compare
@resin-jenkins retest this please |
1 similar comment
@resin-jenkins retest this please |
6117ea9
to
bd7cf5d
Compare
bd7cf5d
to
dfd3453
Compare
dfd3453
to
6760364
Compare
Contributor checklist
Change-type
present on at least one commitSigned-off-by
is presentReviewer Guidelines