Open dmohnen opened 7 years ago
I have the same problem (same exact steps 1-4). This is the error message:
I'm having the same issue with Samsung S8, S8+ and Note 8.
On Samsung GS7 edge the graph is not showing but the system stats are loading.
I've tried the solution suggested in https://github.com/google/battery-historian/issues/111 on the S8 bugreport file but no luck. It fixed my GS7 Edge issue with graph not loading up but all the 8 series phones battery stat are still not working.
What I did was I unzipped the file, modified the bugreport txt tile in there with this command: LC_CTYPE=C sed '/^9,hsp.*/ {s/|//g;}' bugreport-2018-01-26-12-54-41.txt >edited.txt And then changed the file name, zipped the folder, uploaded to battery historian.
Still couldn't get the graph or any battery stat. Any help or suggestions would be greatly appreciated.
@vkyt thanks for saving so much time.
#!/bin/bash
# set -ex
if [ "$#" -lt 1 ]; then
echo "Zip file (bugreport) path must be provided as argument"
exit 1
fi
ARG_FILE_PATH=$1
if [ ! -f "${ARG_FILE_PATH}" ]; then
echo "arguemnt zip file does not exist"
fi
lines_to_remove[0]="^9,h.*Pss=5"
lines_to_remove[1]="^9,0,l,kwl,800f000"
lines_to_remove[2]="^9,h.*SubsystemPowerState"
TMP_DIR_NAME=$(uuidgen)
UNZIPPED_BASE_DIR="/tmp/${TMP_DIR_NAME}"
#### unzip the file
unzip -d "${UNZIPPED_BASE_DIR}" "${ARG_FILE_PATH}" > /dev/null
BUREGPORT_TXT_FILE=$(find "${UNZIPPED_BASE_DIR}" | grep "txt" | grep "bugreport")
cd "${UNZIPPED_BASE_DIR}"
# remove lines matching bad patterns
for ptrn in "${lines_to_remove[@]}"; do
awk "!/${ptrn}/" "${BUREGPORT_TXT_FILE}" > ./tmp62774.tmp
mv ./tmp62.tmp "${BUREGPORT_TXT_FILE}"
done
# https://github.com/google/battery-historian/issues/145#issuecomment-360929532
LC_CTYPE=C
sed "/^9,hsp.*/ {s/|//g;}" "${BUREGPORT_TXT_FILE}" > ./tmp62774.tmp
mv ./tmp62774.tmp "${BUREGPORT_TXT_FILE}"
OUTPUT_ZIP_FILENAME="${ARG_FILE_PATH}.fixed.zip"
zip -r "${OUTPUT_ZIP_FILENAME}" ./* > /dev/null
cd -
rm -rf "${UNZIPPED_BASE_DIR}"
echo "fixed file: ${OUTPUT_ZIP_FILENAME}"
My ugly small script that removes unrecognized items and repacks into zip again :) (tested only on macOS)
Steps to reproduce.