Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | DIR=$(mktemp -d out/perfetto.XXXXXX) |
| 6 | |
| 7 | function cleanup { |
| 8 | rm -rf "$WORK_DIR" |
| 9 | echo "Deleted temp working directory $WORK_DIR" |
| 10 | } |
| 11 | |
| 12 | #trap cleanup EXIT |
| 13 | |
| 14 | function is_mac { |
| 15 | ! test -d /proc |
| 16 | return $? |
| 17 | } |
| 18 | |
| 19 | tools/gn gen $DIR --args='is_clang=true is_debug=false' |
| 20 | tools/ninja -C $DIR trace_to_text |
| 21 | hash=$(shasum $DIR/trace_to_text | cut -f1 -d' ') |
| 22 | |
| 23 | if is_mac; then |
| 24 | platform=mac |
| 25 | else |
| 26 | platform=linux |
| 27 | fi |
| 28 | |
| 29 | name=trace_to_text-$platform-$hash |
| 30 | |
| 31 | gsutil cp $DIR/trace_to_text gs://perfetto/$name |
| 32 | gsutil cp $DIR/trace_to_text gs://chromium-telemetry/binary_dependencies/$name |
| 33 | |
| 34 | echo 'Now run the following command to update tools/traceconv:' |
| 35 | echo "sed \"s/'$platform': '[^']*',/'$platform': '$hash',/\" --in-place tools/traceconv" |
| 36 | |