@@ -895,21 +895,66 @@ save_proc() {
895
895
save_sys () {
896
896
trap ' handle_error $? $LINENO' ERR
897
897
local sysfiles=" $@ "
898
+ local cp_cmd=" sudo cp"
899
+
898
900
$MKDIR $V -p $TARDIR /sys
899
901
for f in $sysfiles
900
902
do
901
903
if $NOOP ; then
902
904
if [ -e $f ]; then
903
- echo " $CP $V -r $f $TARDIR /sys"
905
+ echo " $cp_cmd $V -r -p $f $TARDIR /sys"
904
906
fi
905
907
else
906
- ( [ -e $f ] && $CP $V -r $f $TARDIR /sys ) || echo " $f not found" > $TARDIR /$f
908
+ ( [ -e $f ] && $cp_cmd $V -r -p $f $TARDIR /sys ) || echo " $f not found" > $TARDIR /$f
907
909
fi
908
910
done
909
911
910
912
chmod ugo+rw -R $DUMPDIR /$BASE /sys
911
913
}
912
914
915
+ # ##############################################################################
916
+ # Given list of pstore directories or files, saves subdirectories and files to tar.
917
+ # Globals:
918
+ # V
919
+ # TARDIR
920
+ # MKDIR
921
+ # CP
922
+ # DUMPDIR
923
+ # TAR
924
+ # RM
925
+ # BASE
926
+ # TARFILE
927
+ # NOOP
928
+ # Arguments:
929
+ # *pstorefiles: variable-length list of pstore file paths to save
930
+ # Returns:
931
+ # None
932
+ # ##############################################################################
933
+ save_pstore () {
934
+ trap ' handle_error $? $LINENO' ERR
935
+ local pstorefiles=" $@ "
936
+ PSTORE_DIR_LIST_INFO_FILE=" techsupport_pstore_dir_listing_info"
937
+ $MKDIR $V -p $TARDIR /pstore
938
+
939
+ echo " ==================================" > $TARDIR /pstore/$PSTORE_DIR_LIST_INFO_FILE
940
+ echo " /var/lib/systemd/pstore files info" >> $TARDIR /pstore/$PSTORE_DIR_LIST_INFO_FILE
941
+ echo " ==================================" >> $TARDIR /pstore/$PSTORE_DIR_LIST_INFO_FILE
942
+ for f in $pstorefiles
943
+ do
944
+ if $NOOP ; then
945
+ if [ -e $f ]; then
946
+ echo " $CP $V -r -p $f /* $TARDIR /pstore"
947
+ fi
948
+ else
949
+ ls --time-style=' +%d-%m-%Y %H:%M:%S' -last $f >> $TARDIR /pstore/$PSTORE_DIR_LIST_INFO_FILE
950
+ ls --time-style=' +%d-%m-%Y %H:%M:%S' -last $f /* >> $TARDIR /pstore/$PSTORE_DIR_LIST_INFO_FILE
951
+ ( [ -e $f ] && $CP $V -r -p $f /* $TARDIR /pstore ) || echo " $f not found" > $TARDIR /$f
952
+ fi
953
+ done
954
+
955
+ chmod ugo+rw -R $DUMPDIR /$BASE /pstore
956
+ }
957
+
913
958
# ##############################################################################
914
959
# Dump io stats for processes
915
960
# Globals:
@@ -2133,12 +2178,19 @@ main() {
2133
2178
echo " [ Capture Proc State ] : $(( $end_t - $start_t )) msec" >> $TECHSUPPORT_TIME_INFO
2134
2179
wait
2135
2180
2136
- # capture /sys info - include acpi info
2137
- save_sys /sys/firmware/acpi/tables &
2181
+ # capture /sys info - include acpi info and pre-process pstore info
2182
+ save_sys /sys/firmware/acpi/tables /sys/fs/pstore &
2138
2183
end_t2=$( date +%s%3N)
2139
2184
echo " [ Capture Sys info ] : $(( $end_t2 - $end_t )) msec" >> $TECHSUPPORT_TIME_INFO
2140
2185
wait
2141
2186
2187
+ # capture /var/lib/systemd/pstore info
2188
+ start_t=$( date +%s%3N)
2189
+ save_pstore /var/lib/systemd/pstore &
2190
+ end_t=$( date +%s%3N)
2191
+ echo " [ Capture pstore info ] : $(( $end_t - $start_t )) msec" >> $TECHSUPPORT_TIME_INFO
2192
+ wait
2193
+
2142
2194
# Save all the processes within each docker
2143
2195
save_cmd " show services" services.summary &
2144
2196
0 commit comments