blob: 2860273670155244530a4722358360fbaad20d5a [file] [log] [blame]
Hector Dearman21a33af2019-03-29 17:46:36 +00001#!/bin/bash
2
3set -e
4
5DIR=$(mktemp -d out/perfetto.XXXXXX)
6
7function cleanup {
Hector Dearmanb18409c2019-03-29 18:40:23 +00008 rm -rf "$DIR"
9 echo "Deleted temp working directory $DIR"
Hector Dearman21a33af2019-03-29 17:46:36 +000010}
11
12#trap cleanup EXIT
13
14function is_mac {
15 ! test -d /proc
16 return $?
17}
18
19tools/gn gen $DIR --args='is_clang=true is_debug=false'
20tools/ninja -C $DIR trace_to_text
Hector Dearmanb18409c2019-03-29 18:40:23 +000021
22if which shasum; then
23 NEW_SHA=$(shasum $DIR/trace_to_text | cut -f1 -d' ') # Mac OS
24else
25 NEW_SHA=$(sha1sum $DIR/trace_to_text | cut -f1 -d' ') # Linux
26fi
Hector Dearman21a33af2019-03-29 17:46:36 +000027
28if is_mac; then
29 platform=mac
30else
31 platform=linux
32fi
33
Hector Dearmanb18409c2019-03-29 18:40:23 +000034name=trace_to_text-$platform-$NEW_SHA
Hector Dearman21a33af2019-03-29 17:46:36 +000035
36gsutil cp $DIR/trace_to_text gs://perfetto/$name
37gsutil cp $DIR/trace_to_text gs://chromium-telemetry/binary_dependencies/$name
Hector Dearmanb18409c2019-03-29 18:40:23 +000038gsutil acl ch -u AllUsers:R gs://perfetto/$name
39gsutil acl ch -u AllUsers:R gs://chromium-telemetry/binary_dependencies/$name
Hector Dearman21a33af2019-03-29 17:46:36 +000040
41echo 'Now run the following command to update tools/traceconv:'
Hector Dearmanb18409c2019-03-29 18:40:23 +000042echo "sed \"s/'$platform': '[^']*',/'$platform': '$NEW_SHA',/\" --in-place tools/traceconv"
Hector Dearman21a33af2019-03-29 17:46:36 +000043