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 { |
Hector Dearman | b18409c | 2019-03-29 18:40:23 +0000 | [diff] [blame] | 8 | rm -rf "$DIR" |
| 9 | echo "Deleted temp working directory $DIR" |
Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame] | 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 |
Hector Dearman | b18409c | 2019-03-29 18:40:23 +0000 | [diff] [blame] | 21 | |
| 22 | if which shasum; then |
| 23 | NEW_SHA=$(shasum $DIR/trace_to_text | cut -f1 -d' ') # Mac OS |
| 24 | else |
| 25 | NEW_SHA=$(sha1sum $DIR/trace_to_text | cut -f1 -d' ') # Linux |
| 26 | fi |
Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame] | 27 | |
| 28 | if is_mac; then |
| 29 | platform=mac |
| 30 | else |
| 31 | platform=linux |
| 32 | fi |
| 33 | |
Hector Dearman | b18409c | 2019-03-29 18:40:23 +0000 | [diff] [blame] | 34 | name=trace_to_text-$platform-$NEW_SHA |
Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame] | 35 | |
| 36 | gsutil cp $DIR/trace_to_text gs://perfetto/$name |
| 37 | gsutil cp $DIR/trace_to_text gs://chromium-telemetry/binary_dependencies/$name |
Hector Dearman | b18409c | 2019-03-29 18:40:23 +0000 | [diff] [blame] | 38 | gsutil acl ch -u AllUsers:R gs://perfetto/$name |
| 39 | gsutil acl ch -u AllUsers:R gs://chromium-telemetry/binary_dependencies/$name |
Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame] | 40 | |
| 41 | echo 'Now run the following command to update tools/traceconv:' |
Hector Dearman | b18409c | 2019-03-29 18:40:23 +0000 | [diff] [blame] | 42 | echo "sed \"s/'$platform': '[^']*',/'$platform': '$NEW_SHA',/\" --in-place tools/traceconv" |
Hector Dearman | 21a33af | 2019-03-29 17:46:36 +0000 | [diff] [blame] | 43 | |