~andreas-pokorny/mir/09-input-config-authorizer

« back to all changes in this revision

Viewing changes to benchmarks/memory/benchmark.sh.in

  • Committer: Thomas Voß
  • Date: 2012-11-06 12:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 221.
  • Revision ID: thomas.voss@canonical.com-20121106120810-pvosg8r24rdbtean
mir/benchmarks: Add cpu and memory benchmarking with massif and callgrind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Starting the server
 
4
server_fn=@CMAKE_CURRENT_BINARY_DIR@/massif_$4
 
5
@VALGRIND_EXECUTABLE@ --tool=massif --pages-as-heap=yes --massif-out-file=`echo $server_fn`.out @CMAKE_INSTALL_PREFIX@/bin/mir -f @MEMORY_BENCHMARKS_SOCKET@ &
 
6
server_pid=$!
 
7
 
 
8
sleep 5
 
9
 
 
10
# Starting the clients
 
11
fn=@CMAKE_CURRENT_BINARY_DIR@/massif_$3
 
12
seq 1 $1 | xargs -I {} -n 1 -P $1 @VALGRIND_EXECUTABLE@ --tool=massif --pages-as-heap=yes --massif-out-file=`echo $fn`.out.{} @CMAKE_INSTALL_PREFIX@/bin/mir_demo_client -f @MEMORY_BENCHMARKS_SOCKET@ -c $2
 
13
 
 
14
kill $server_pid
 
15
 
 
16
# This is extremely ugly, but we need to introduce some latency to account
 
17
# for the fact that we fire up multiple mir instances in rapid succession.
 
18
sleep 5