Skip to content

Commit 9d15930

Browse files
authored
improve linux perf script (#34)
motivation: more details from perf / flamegrpah changes: * run docker in privileged mode and turn off kptr_restrict * fix typo
1 parent 2e04511 commit 9d15930

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/linux_performance_setup.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
# docker run --cap-add SYS_ADMIN -it -v `pwd`:/code -w /code swift:5.1 bash
16+
# docker run --privileged -it -v `pwd`:/code -w /code swift:5.1 bash
1717

18-
apt-get update
18+
apt-get update -y
1919
apt-get install -y vim htop strace linux-tools-common linux-tools-generic
2020

21+
echo 0 > /proc/sys/kernel/kptr_restrict
22+
2123
cd /usr/bin
2224
rm -rf perf
2325
ln -s /usr/lib/linux-tools/4.15.0-88-generic/perf perf
2426
cd -
2527

26-
cd build
28+
cd /opt
2729
git clone https://github.com/brendangregg/FlameGraph.git
2830
cd -
2931

@@ -40,5 +42,5 @@ cd -
4042
#
4143
# perf
4244
# export MAX_REQUESTS=10000
43-
# perf record -o .build/perf-$MAX_REQUESTS.data -g .build/release/SwiftAwsLambdaStringSample dward
44-
# perf script -i .build/perf-$MAX_REQUESTS.data | .build/FlameGraph/stackcollapse-perf.pl | swift-demangle | .build/FlameGraph/flamegraph.pl > .build/flamegraph-$MAX_REQUESTS.svg
45+
# perf record -o .build/perf-$MAX_REQUESTS.data -g .build/release/SwiftAwsLambdaStringSample dwarf
46+
# 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)