aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/lib/systemd/journalctl-boot-parse.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/lib/systemd/journalctl-boot-parse.sh b/scripts/lib/systemd/journalctl-boot-parse.sh
new file mode 100755
index 00000000000..b05b8201109
--- /dev/null
+++ b/scripts/lib/systemd/journalctl-boot-parse.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# this script is intended to run where logs exist with output of the
+# journalctl command
+
+VERBOSE=
+target_logs=`find testrun*/testimage/ -name ssh_target_log*`
+NAs=0
+numlogs=0
+below3=0
+
+[[ X"$1" = X"-v" ]] && VERBOSE=true
+
+echo_v (){
+ [[ X"$VERBOSE" = X"true" ]] && echo $*
+}
+
+target_logs=`find testrun*/testimage/ -name ssh_target_log*`
+NAs=0
+numlogs=0
+logswto=0
+below3=0
+ubelow3=0
+echo_v "target_log kernel_start_time(s) \
+ userspace_start_time(m:s) \
+ total_start_time(m:s) \
+ K_U_under_3min \
+ timeout_wc"
+# loop across the test logs
+for log in $target_logs; do
+ numlogs=`expr $numlogs + 1`
+ B3="no"
+ uB3="no"
+ # get the systemd line with startup times
+ startup_finished=`cat $log|grep "Startup finished"`
+ timeout_wc=`cat $log|egrep -c --ignore-case "systemd.*timeout"`
+ # separate the logs where ssh did not even come up
+ if [ X"$startup_finished" = X"" ]; then
+ kernel_startup="NA"
+ userspace_startup="NA"
+ total_startup="NA"
+ NAs=`expr $NAs + 1`
+ # get the user + kernel startup times
+ else
+ kernel_startup=`echo $startup_finished|cut -f9 -d ' '`
+ userspace_startup=`echo $startup_finished|cut -f12-13 -d' '|\
+ sed 's/min /:/'`
+ userspace_startup_min=`echo $userspace_startup|cut -f1 -d':'`
+ if [ X"$userspace_startup_min" = X"" -o \
+ $userspace_startup_min -lt 3 ]; then
+ ubelow3=`expr $ubelow3 + 1`
+ B3='U'
+ fi
+ total_startup=`echo $startup_finished|cut -f16-17 -d' '|\
+ sed 's/min /:/'`
+ total_startup_min=`echo $total_startup|cut -f1 -d':'`
+ if [ X"$total_startup_min" = X"" -o $total_startup_min -lt 3 ]; then
+ below3=`expr $below3 + 1`
+ B3='K+U'
+ fi
+ # count this as a log where timeout is shown
+ [[ X"$timeout_wc" != X"0" ]] && logswto=`expr $logswto + 1`
+ fi
+ echo_v $log $kernel_startup $userspace_startup $total_startup $B3 \
+ $timeout_wc
+done
+echo "$numlogs total number of target logs processed"
+echo "$NAs number of targets without ssh connectivity"
+echo "$below3 number of targets where kernel + userspace startup < 90 seconds"
+echo "$ubelow3 number of targets where userspace startup < 90 seconds"
+echo "$logswto number of target logs where '[s]ystemd' and '[t]imeout' appeared together"