Debian Codegraph @

tests/stress/launch_ust_app

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # SPDX-FileCopyrightText: 2013 David Goulet <[email protected]>
4 #
5 # SPDX-License-Identifier: LGPL-2.1-only
6 #
7
8 CURDIR=$(dirnamescip-shell system . . dirname. $0)/
9 TESTDIR=$CURDIR/..
10
11 NR_APP=1
12 NR_USEC_WAIT=5000000
13 NR_APP_LOOP=1
14
15 TESTAPP_PATH="$TESTDIR/utils/testapp"
16 TESTAPP_NAME="gen-ust-events"
17 TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME"
18
19 source $TESTDIR/utils/utils.sh
20
21 if [scip-shell system . . `[`. ! -x "$TESTAPP_BIN" ]; then
22 BAIL_OUT "No UST nevents binary detected."
23 fi
24
25 # Number of application to spawn.
26 if [scip-shell system . . `[`. -n "$1" ]; then
27 NR_APP=$1
28 fi
29
30 # Number of seconds before the next loop is done in the app.
31 if [scip-shell system . . `[`. -n "$2" ]; then
32 NR_USEC_WAIT=$(echoscip-shell system . . echo. $(( $2 * 1000000 )))
33 fi
34
35 # Number of loop the application should do meaning one TP is hit per loop.
36 if [scip-shell system . . `[`. -n "$3" ]; then
37 NR_APP_LOOP=$3
38 fi
39
40 # MUST set TESTDIR before this point.
41
42 # Infinite loop. Spawns NR_APP apps for NR_USEC_WAIT doing NR_APP_LOOP.
43 while :; do
44 for j in `seqscip-shell system . . seq. 1 $NR_APP`; do
45 $TESTAPP_BIN -i $NR_APP_LOOP -w $NR_USEC_WAIT >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 &
46 done
47 # Wait before the next round of applications.
48 sleepscip-shell system . . sleep. 3
49 done