File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # docker run --cap-add SYS_ADMIN -it -v `pwd`:/code -w /code swift:5.1 bash
4
+
5
+ apt-get update
6
+ apt-get install -y vim htop strace linux-tools-common linux-tools-generic
7
+
8
+ cd /usr/bin
9
+ rm -rf perf
10
+ ln -s /usr/lib/linux-tools/4.15.0-88-generic/perf perf
11
+ cd -
12
+
13
+ cd build
14
+ git clone https://github.com/brendangregg/FlameGraph.git
15
+ cd -
16
+
17
+ # build the code in relase mode with debug symbols
18
+ # swift build -c release -Xswiftc -g
19
+ #
20
+ # run the server
21
+ # (.build/release/MockServer) &
22
+ #
23
+ # strace
24
+ # export MAX_REQUESTS=10000
25
+ # strace -o .build/strace-c-string-$MAX_REQUESTS -c .build/release/SwiftAwsLambdaStringSample
26
+ # strace -o .build/strace-ffftt-string-$MAX_REQUESTS -fftt .build/release/SwiftAwsLambdaStringSample
27
+ #
28
+ # perf
29
+ # export MAX_REQUESTS=10000
30
+ # perf record -o .build/perf-$MAX_REQUESTS.data -g .build/release/SwiftAwsLambdaStringSample dward
31
+ # perf script -i .build/perf-$MAX_REQUESTS.data | .build/FlameGraph/stackcollapse-perf.pl | swift-demangle | .build/FlameGraph/flamegraph.pl > .build/flamegraph-$MAX_REQUESTS.svg
You can’t perform that action at this time.
0 commit comments