aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling/latency_profile/run_latency_profile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/profiling/latency_profile/run_latency_profile.sh')
-rwxr-xr-xtools/profiling/latency_profile/run_latency_profile.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/profiling/latency_profile/run_latency_profile.sh b/tools/profiling/latency_profile/run_latency_profile.sh
new file mode 100755
index 0000000000..41686be560
--- /dev/null
+++ b/tools/profiling/latency_profile/run_latency_profile.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -ex
+
+cd $(dirname $0)/../../..
+
+BINS="sync_unary_ping_pong_test sync_streaming_ping_pong_test"
+CPUS=`python -c 'import multiprocessing; print multiprocessing.cpu_count()'`
+
+make CONFIG=basicprof -j$CPUS $BINS
+
+mkdir -p reports
+
+echo '<html><head></head><body>' > reports/index.html
+for bin in $BINS
+do
+ bins/basicprof/$bin
+ mv latency_trace.txt $bin.trace
+ echo "<a href='$bin.txt'>$bin</a><br/>" >> reports/index.html
+done
+for bin in $BINS
+do
+ tools/profiling/latency_profile/profile_analyzer.py \
+ --source=$bin.trace --fmt=simple > reports/$bin.txt &
+done
+echo '</body></html>' >> reports/index.html
+
+wait
+