How to record boot time?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I want to monitor boot time (the time needed by the system to boot) compared to software version installed (kernel and other software) day by day in order to have a look at boot performance for my arch-linux computer.
I use the systemd command systemd-analyze time
to get the boot time.
My idea is to have a log with:
[day]
.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
.......with kernel version 4.11.2
.......gnome-shell version 3.24.1
[day+1]
.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
.......with kernel version 4.17.11
.......gnome-shell version 3.28.3
How can I do?
systemd
add a comment |Â
up vote
0
down vote
favorite
I want to monitor boot time (the time needed by the system to boot) compared to software version installed (kernel and other software) day by day in order to have a look at boot performance for my arch-linux computer.
I use the systemd command systemd-analyze time
to get the boot time.
My idea is to have a log with:
[day]
.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
.......with kernel version 4.11.2
.......gnome-shell version 3.24.1
[day+1]
.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
.......with kernel version 4.17.11
.......gnome-shell version 3.28.3
How can I do?
systemd
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to monitor boot time (the time needed by the system to boot) compared to software version installed (kernel and other software) day by day in order to have a look at boot performance for my arch-linux computer.
I use the systemd command systemd-analyze time
to get the boot time.
My idea is to have a log with:
[day]
.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
.......with kernel version 4.11.2
.......gnome-shell version 3.24.1
[day+1]
.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
.......with kernel version 4.17.11
.......gnome-shell version 3.28.3
How can I do?
systemd
I want to monitor boot time (the time needed by the system to boot) compared to software version installed (kernel and other software) day by day in order to have a look at boot performance for my arch-linux computer.
I use the systemd command systemd-analyze time
to get the boot time.
My idea is to have a log with:
[day]
.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
.......with kernel version 4.11.2
.......gnome-shell version 3.24.1
[day+1]
.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
.......with kernel version 4.17.11
.......gnome-shell version 3.28.3
How can I do?
systemd
edited 2 days ago
jasonwryan
46.2k14123173
46.2k14123173
asked 2 days ago
mattia.b89
660217
660217
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Basic idea
I'd be tempted to do this as a systemd service that logs this to a file:
$ systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//'
442ms (kernel) + 10.224s (userspace)
This cuts the output of systemd-analyze time
down to just the bits you want. The rest of the info you want is easy to come by via uname
and gnome-shell
command-lines' themselves:
$ systemd-analyze time |
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//';
printf "kernel: %sngnome-shell: %sn" "$(uname -r)" "$(gnome-shell --version)"
442ms (kernel) + 10.224s (userspace)
kernel: 3.10.0-693.21.1.el7.x86_64
gnome-shell: GNOME Shell 3.25.4
More refined
As a script the above:
$ cat ./boottime.bash
#!/bin/bash
printf "[%s]n" "$(date)"
printf ".......Boot time [s]: %sn" "$(systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
printf ".......with kernel version: %sn" "$(uname -r)"
printf ".......gnome-shell version: %sn" "$(gnome-shell --version)"
#[day]
#.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
#.......with kernel version 4.11.2
#.......gnome-shell version 3.24.1
#[day+1]
#.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
#.......with kernel version 4.17.11
#.......gnome-shell version 3.28.3
The output:
$ ./boottime.bash
[Sat Aug 4 14:34:40 EDT 2018]
.......Boot time [s]: 442ms (kernel) + 10.224s (userspace)
.......with kernel version: 3.10.0-693.21.1.el7.x86_64
.......gnome-shell version: GNOME Shell 3.25.4
The unit file:
$ cat /etc/systemd/system/boottime.service
[Unit]
Description=Boottime Service
After=systend-user-sessions.service
[Service]
Type=simple
ExecStart=/opt/bin/boottime.bash
TLDR; parsing systemd-analyze time
The sed
used above works as follows:
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
s/Startup finished in //
- removes everything from left up to the wordin
s/ +.*(initrd)//
- removes everything starting at+
up to(initrd)
s/ =.*$//
- removes everything at the end of string, starting with=
to the end of the line$
It looks good! I am not an expert of sed, can you explain the complex parts/ +.*(initrd)//;s/ =.*$//
?
â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Basic idea
I'd be tempted to do this as a systemd service that logs this to a file:
$ systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//'
442ms (kernel) + 10.224s (userspace)
This cuts the output of systemd-analyze time
down to just the bits you want. The rest of the info you want is easy to come by via uname
and gnome-shell
command-lines' themselves:
$ systemd-analyze time |
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//';
printf "kernel: %sngnome-shell: %sn" "$(uname -r)" "$(gnome-shell --version)"
442ms (kernel) + 10.224s (userspace)
kernel: 3.10.0-693.21.1.el7.x86_64
gnome-shell: GNOME Shell 3.25.4
More refined
As a script the above:
$ cat ./boottime.bash
#!/bin/bash
printf "[%s]n" "$(date)"
printf ".......Boot time [s]: %sn" "$(systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
printf ".......with kernel version: %sn" "$(uname -r)"
printf ".......gnome-shell version: %sn" "$(gnome-shell --version)"
#[day]
#.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
#.......with kernel version 4.11.2
#.......gnome-shell version 3.24.1
#[day+1]
#.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
#.......with kernel version 4.17.11
#.......gnome-shell version 3.28.3
The output:
$ ./boottime.bash
[Sat Aug 4 14:34:40 EDT 2018]
.......Boot time [s]: 442ms (kernel) + 10.224s (userspace)
.......with kernel version: 3.10.0-693.21.1.el7.x86_64
.......gnome-shell version: GNOME Shell 3.25.4
The unit file:
$ cat /etc/systemd/system/boottime.service
[Unit]
Description=Boottime Service
After=systend-user-sessions.service
[Service]
Type=simple
ExecStart=/opt/bin/boottime.bash
TLDR; parsing systemd-analyze time
The sed
used above works as follows:
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
s/Startup finished in //
- removes everything from left up to the wordin
s/ +.*(initrd)//
- removes everything starting at+
up to(initrd)
s/ =.*$//
- removes everything at the end of string, starting with=
to the end of the line$
It looks good! I am not an expert of sed, can you explain the complex parts/ +.*(initrd)//;s/ =.*$//
?
â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
add a comment |Â
up vote
1
down vote
accepted
Basic idea
I'd be tempted to do this as a systemd service that logs this to a file:
$ systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//'
442ms (kernel) + 10.224s (userspace)
This cuts the output of systemd-analyze time
down to just the bits you want. The rest of the info you want is easy to come by via uname
and gnome-shell
command-lines' themselves:
$ systemd-analyze time |
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//';
printf "kernel: %sngnome-shell: %sn" "$(uname -r)" "$(gnome-shell --version)"
442ms (kernel) + 10.224s (userspace)
kernel: 3.10.0-693.21.1.el7.x86_64
gnome-shell: GNOME Shell 3.25.4
More refined
As a script the above:
$ cat ./boottime.bash
#!/bin/bash
printf "[%s]n" "$(date)"
printf ".......Boot time [s]: %sn" "$(systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
printf ".......with kernel version: %sn" "$(uname -r)"
printf ".......gnome-shell version: %sn" "$(gnome-shell --version)"
#[day]
#.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
#.......with kernel version 4.11.2
#.......gnome-shell version 3.24.1
#[day+1]
#.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
#.......with kernel version 4.17.11
#.......gnome-shell version 3.28.3
The output:
$ ./boottime.bash
[Sat Aug 4 14:34:40 EDT 2018]
.......Boot time [s]: 442ms (kernel) + 10.224s (userspace)
.......with kernel version: 3.10.0-693.21.1.el7.x86_64
.......gnome-shell version: GNOME Shell 3.25.4
The unit file:
$ cat /etc/systemd/system/boottime.service
[Unit]
Description=Boottime Service
After=systend-user-sessions.service
[Service]
Type=simple
ExecStart=/opt/bin/boottime.bash
TLDR; parsing systemd-analyze time
The sed
used above works as follows:
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
s/Startup finished in //
- removes everything from left up to the wordin
s/ +.*(initrd)//
- removes everything starting at+
up to(initrd)
s/ =.*$//
- removes everything at the end of string, starting with=
to the end of the line$
It looks good! I am not an expert of sed, can you explain the complex parts/ +.*(initrd)//;s/ =.*$//
?
â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Basic idea
I'd be tempted to do this as a systemd service that logs this to a file:
$ systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//'
442ms (kernel) + 10.224s (userspace)
This cuts the output of systemd-analyze time
down to just the bits you want. The rest of the info you want is easy to come by via uname
and gnome-shell
command-lines' themselves:
$ systemd-analyze time |
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//';
printf "kernel: %sngnome-shell: %sn" "$(uname -r)" "$(gnome-shell --version)"
442ms (kernel) + 10.224s (userspace)
kernel: 3.10.0-693.21.1.el7.x86_64
gnome-shell: GNOME Shell 3.25.4
More refined
As a script the above:
$ cat ./boottime.bash
#!/bin/bash
printf "[%s]n" "$(date)"
printf ".......Boot time [s]: %sn" "$(systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
printf ".......with kernel version: %sn" "$(uname -r)"
printf ".......gnome-shell version: %sn" "$(gnome-shell --version)"
#[day]
#.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
#.......with kernel version 4.11.2
#.......gnome-shell version 3.24.1
#[day+1]
#.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
#.......with kernel version 4.17.11
#.......gnome-shell version 3.28.3
The output:
$ ./boottime.bash
[Sat Aug 4 14:34:40 EDT 2018]
.......Boot time [s]: 442ms (kernel) + 10.224s (userspace)
.......with kernel version: 3.10.0-693.21.1.el7.x86_64
.......gnome-shell version: GNOME Shell 3.25.4
The unit file:
$ cat /etc/systemd/system/boottime.service
[Unit]
Description=Boottime Service
After=systend-user-sessions.service
[Service]
Type=simple
ExecStart=/opt/bin/boottime.bash
TLDR; parsing systemd-analyze time
The sed
used above works as follows:
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
s/Startup finished in //
- removes everything from left up to the wordin
s/ +.*(initrd)//
- removes everything starting at+
up to(initrd)
s/ =.*$//
- removes everything at the end of string, starting with=
to the end of the line$
Basic idea
I'd be tempted to do this as a systemd service that logs this to a file:
$ systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//'
442ms (kernel) + 10.224s (userspace)
This cuts the output of systemd-analyze time
down to just the bits you want. The rest of the info you want is easy to come by via uname
and gnome-shell
command-lines' themselves:
$ systemd-analyze time |
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//';
printf "kernel: %sngnome-shell: %sn" "$(uname -r)" "$(gnome-shell --version)"
442ms (kernel) + 10.224s (userspace)
kernel: 3.10.0-693.21.1.el7.x86_64
gnome-shell: GNOME Shell 3.25.4
More refined
As a script the above:
$ cat ./boottime.bash
#!/bin/bash
printf "[%s]n" "$(date)"
printf ".......Boot time [s]: %sn" "$(systemd-analyze time | sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
printf ".......with kernel version: %sn" "$(uname -r)"
printf ".......gnome-shell version: %sn" "$(gnome-shell --version)"
#[day]
#.......Boot time [s]: 2.145 (kernel) + 13.675 (userspace)
#.......with kernel version 4.11.2
#.......gnome-shell version 3.24.1
#[day+1]
#.......Boot time [s]: 3.145 (kernel) + 21.665 (userspace)
#.......with kernel version 4.17.11
#.......gnome-shell version 3.28.3
The output:
$ ./boottime.bash
[Sat Aug 4 14:34:40 EDT 2018]
.......Boot time [s]: 442ms (kernel) + 10.224s (userspace)
.......with kernel version: 3.10.0-693.21.1.el7.x86_64
.......gnome-shell version: GNOME Shell 3.25.4
The unit file:
$ cat /etc/systemd/system/boottime.service
[Unit]
Description=Boottime Service
After=systend-user-sessions.service
[Service]
Type=simple
ExecStart=/opt/bin/boottime.bash
TLDR; parsing systemd-analyze time
The sed
used above works as follows:
sed 's/Startup finished in //;s/ +.*(initrd)//;s/ =.*$//')"
s/Startup finished in //
- removes everything from left up to the wordin
s/ +.*(initrd)//
- removes everything starting at+
up to(initrd)
s/ =.*$//
- removes everything at the end of string, starting with=
to the end of the line$
edited yesterday
answered 2 days ago
slmâ¦
232k65479648
232k65479648
It looks good! I am not an expert of sed, can you explain the complex parts/ +.*(initrd)//;s/ =.*$//
?
â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
add a comment |Â
It looks good! I am not an expert of sed, can you explain the complex parts/ +.*(initrd)//;s/ =.*$//
?
â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
It looks good! I am not an expert of sed, can you explain the complex part
s/ +.*(initrd)//;s/ =.*$//
?â mattia.b89
yesterday
It looks good! I am not an expert of sed, can you explain the complex part
s/ +.*(initrd)//;s/ =.*$//
?â mattia.b89
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
@mattia.b89 - see updated section at end that explains
â slmâ¦
yesterday
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
thank you, now it's clear! I don't have an initrd item...
â mattia.b89
10 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460511%2fhow-to-record-boot-time%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password