Skip to content

Commit 64ee5a2

Browse files
authored
small fixes to the perf script (#78)
motivation: keep script up to date changes: * use 5.3 nightly * better support for perf symlink as the location is a moving target * info about cold/warm start
1 parent ab3ce64 commit 64ee5a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/linux_performance_setup.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
# docker run --privileged -it -v `pwd`:/code -w /code swiftlang/swift:nightly-5.2-bionic bash
16+
# docker run --privileged -it -v `pwd`:/code -w /code swiftlang/swift:nightly-5.3-bionic bash
1717

1818
apt-get update -y
1919
apt-get install -y vim htop strace linux-tools-common linux-tools-generic libc6-dbg
@@ -22,7 +22,7 @@ echo 0 > /proc/sys/kernel/kptr_restrict
2222

2323
cd /usr/bin
2424
rm -rf perf
25-
ln -s /usr/lib/linux-tools/4.15.0-91-generic/perf perf
25+
ln -s /usr/lib/linux-tools/*/perf perf
2626
cd -
2727

2828
cd /opt
@@ -36,11 +36,11 @@ cd -
3636
# (.build/release/MockServer) &
3737
#
3838
# strace
39-
# export MAX_REQUESTS=10000
39+
# export MAX_REQUESTS=10000 (or MAX_REQUESTS=1 for cold start analysis)
4040
# strace -o .build/strace-c-string-$MAX_REQUESTS -c .build/release/StringSample
4141
# strace -o .build/strace-ffftt-string-$MAX_REQUESTS -fftt .build/release/StringSample
4242
#
4343
# perf
44-
# export MAX_REQUESTS=10000
44+
# export MAX_REQUESTS=10000 (or MAX_REQUESTS=1 for cold start analysis)
4545
# perf record -o .build/perf-$MAX_REQUESTS.data -g -F 100000 .build/release/StringSample dwarf
4646
# perf script -i .build/perf-$MAX_REQUESTS.data | /opt/FlameGraph/stackcollapse-perf.pl | swift-demangle | /opt/FlameGraph/flamegraph.pl > .build/flamegraph-$MAX_REQUESTS.svg

0 commit comments

Comments
 (0)