Fix parsing of HTML files
HTML files collected by running systrace can have multiple trace-data
section in them. Currently we can only parse the section with raw
systrace output in it. This CL allows us to skip the other sections.
Also fixed a bug in systrace parsing causing pids not to be read
correctly.
Bug: 143202192
Change-Id: Ia2f88cf1452c1d46c870a73c540bfe0210b95759
diff --git a/tools/add_test_trace.sh b/tools/add_test_trace.sh
index 1c47fca..976955a 100755
--- a/tools/add_test_trace.sh
+++ b/tools/add_test_trace.sh
@@ -57,12 +57,12 @@
echo "Updating tools/install-build-deps"
echo ""
-OLD_SHA=$(cat tools/install-build-deps | grep '/test-data-.*.zip' -A1 | tail -n1 | cut -c5-44)
+OLD_SHA=$(cat tools/install-build-deps | grep '/test-data-.*.zip' -A1 | tail -n1 | cut -c10-49)
# Cannot easily use sed -i, it has different syntax on Linux vs Mac.
cat tools/install-build-deps \
- | sed -e 's|/test-data-.*.zip|/'$NEW_TEST_DATA'|g' \
- | sed -e 's|'$OLD_SHA'|'$NEW_SHA'|g' \
+ | sed -e "s|/test-data-.*.zip|/$NEW_TEST_DATA|g" \
+ | sed -e "s|$OLD_SHA|$NEW_SHA|g" \
> tools/install-build-deps.tmp
mv -f tools/install-build-deps.tmp tools/install-build-deps