Skip to content

Commit a969925

Browse files
committed
fixup! test: enable trace_events tests with perfetto
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
1 parent 3fa572d commit a969925

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ tools/*/*.i.tmp
118118

119119
# === Rules for tools/perfetto ===
120120
/tools/perfetto/trace_processor_shell
121-
/tools/perfetto/.version
122121

123122
# === Rules for test artifacts ===
124123
/*.tap

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ distclean: ## Remove all build and test artifacts.
235235
$(RM) -r node_modules
236236
$(RM) -r deps/icu
237237
$(RM) -r deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp
238-
$(RM) tools/perfetto/trace_processor_shell tools/perfetto/.version
238+
$(RM) tools/perfetto/trace_processor_shell
239239
$(RM) $(BINARYTAR).* $(TARBALL).*
240240

241241
.PHONY: check

‎tools/perfetto/get_trace_processor‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ set -e
77
tools_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
88
version=$(cat "$tools_dir/../../deps/perfetto/VERSION")
99
trace_processor="$1"
10-
stamp="$tools_dir/.version"
11-
12-
if [ -x "$trace_processor" ] && [ "$(cat "$stamp" 2>/dev/null)" = "$version" ]; then
13-
echo "trace_processor_shell v$version is already downloaded"
14-
exit 0
15-
fi
1610

1711
# Perfetto names its release archives <os>-<arch>, which does not match uname.
1812
case "$(uname -s)" in
@@ -30,10 +24,13 @@ esac
3024
url="https://github.com/google/perfetto/releases/download/v$version/$os-$arch.zip"
3125
archive="$tools_dir/$os-$arch.zip"
3226

33-
rm -f "$trace_processor" "$stamp"
27+
rm -f "$trace_processor"
3428
echo "Downloading $url"
3529
curl -sSfL -o "$archive" "$url"
3630
unzip -q -j -o "$archive" '*/trace_processor_shell' -d "$tools_dir"
3731
rm -f "$archive"
3832
chmod +x "$trace_processor"
39-
printf '%s\n' "$version" > "$stamp"
33+
# The archive carries the release's own mtime. Make decides whether the tool is
34+
# current by comparing it against deps/perfetto/VERSION, so it has to come out
35+
# newer than the version file it was downloaded for.
36+
touch "$trace_processor"

0 commit comments

Comments
 (0)