Re: [Fuego] [PATCH v3] lmbench: Add variables to specify scripts and results directory

<[email protected]> Tue, 8 Feb 2022 08:04:35 +0000
Newsgroups dev.linux.lists.fuego
Message-ID <OSYPR01MB55427161DB7D73E5466D1BBEA42D9@OSYPR01MB5542.jpnprd01.prod.outlook.com>
Hi Tim,

Could you please review this change as well, I think you might have missed this mail.

Please feel free to ask me if you need more details on this patch, as it been long time we discussed it. 

Thanks,
Venkata.
>-----Original Message-----
>From: [email protected] <[email protected]>
>Sent: 10 November 2021 23:52
>To: [email protected]
>Cc: pyla venkata(TSIP) <[email protected]>; sangorrin
>daniel(サンゴリン ダニエル □SWC◯ACT) <[email protected]>;
>[email protected]; dinesh kumar(TSIP)
><[email protected]>; hayashi kazuhiro(林 和宏 □SWC◯ACT)
><[email protected]>
>Subject: [PATCH v3] lmbench: Add variables to specify scripts and results
>directory
>
>From: venkata pyla <[email protected]>
>
>lmbench by default uses board test directory, to look over binaries and other
>files when compiled locally.
>
>if the files are not present in board test directory, then it checks in generally
>installed location by distributions  SCRIPTS_DIR=/usr/lib/lmbench/scripts
> RESULTS_DIR=/var/lib/lmbench/results
>
>If still want to specifiy different location for the lmbench files, one can use the
>following dynamic variables
>
>$ ftc run-test -b local -t lmbench2 -p ptrca \
>      --dynamic-vars SCRIPTS_DIR=/usr/lib/lmbench/scripts \
>      --dynamic-vars RESULTS_DIR=/usr/share/lmbench/results
>
>Signed-off-by: venkata pyla <[email protected]>
>---
> tests/Benchmark.lmbench2/fuego_test.sh | 33 +++++++++++++++++++++-----
> 1 file changed, 27 insertions(+), 6 deletions(-)
>
>diff --git a/tests/Benchmark.lmbench2/fuego_test.sh
>b/tests/Benchmark.lmbench2/fuego_test.sh
>index e21fe0a..e012a80 100755
>--- a/tests/Benchmark.lmbench2/fuego_test.sh
>+++ b/tests/Benchmark.lmbench2/fuego_test.sh
>@@ -23,16 +23,37 @@ function test_deploy {  }
>
> function test_run {
>+   # Get the scripts and results directory paths of lmbench
>+   if [ -z "$BENCHMARK_LMBENCH2_SCRIPTS_DIR" ]; then
>+      SCRIPTS_DIR="$BOARD_TESTDIR/fuego.$TESTDIR/scripts"
>+      RESULTS_DIR="$BOARD_TESTDIR/fuego.$TESTDIR/results"
>+      if cmd "test ! -d $SCRIPTS_DIR" ; then
>+         SCRIPTS_DIR=/usr/lib/lmbench/scripts
>+         RESULTS_DIR=/var/lib/lmbench/results
>+         if cmd "test ! -d $SCRIPTS_DIR" ; then
>+            abort_job "Could not find lmbench scripts directory. Maybe specify
>SCRIPTS_DIR dynamic variable?"
>+         fi
>+      fi
>+   else
>+      SCRIPTS_DIR="$BENCHMARK_LMBENCH2_SCRIPTS_DIR"
>+      if [ -z "$BENCHMARK_LMBENCH2_RESULTS_DIR" ]; then
>+         RESULTS_DIR="$BOARD_TESTDIR/fuego.$TESTDIR/results"
>+      else
>+         RESULTS_DIR="$BENCHMARK_LMBENCH2_SCRIPTS_DIR"
>+      fi
>+   fi
>+
>    # some trickery to get the directory right
>    if [ -n "$PREFIX" ] ; then
>-      LMBENCH_OS=`ls ./bin`
>+      LMBENCH_OS=$(ls $SCRIPTS_DIR/../bin)
>    else
>-      LMBENCH_OS=$(scripts/os)
>+      get_program_path os $SCRIPTS_DIR
>$BOARD_TESTDIR/fuego.$TESTDIR/scripts/os
>+      LMBENCH_OS=$(cmd "$PROGRAM_OS")
>    fi
>-   safe_cmd "rm -rf $BOARD_TESTDIR/fuego.$TESTDIR/results"
>-   safe_cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR/scripts; OS=$LMBENCH_OS
>./config-run"
>-   safe_cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR/scripts; OS=$LMBENCH_OS
>./results"
>-   report "cd $BOARD_TESTDIR/fuego.$TESTDIR/scripts; ./getsummary
>../results/$LMBENCH_OS/*.0"
>+   cmd "rm -rf $RESULTS_DIR/*"
>+   cmd "cd $SCRIPTS_DIR; OS=$LMBENCH_OS BINDIR=$SCRIPTS_DIR/.. ./config-
>run"
>+   cmd "cd $SCRIPTS_DIR; OS=$LMBENCH_OS RESULTSDIR=$RESULTS_DIR
>./results"
>+   report "cd $SCRIPTS_DIR; ./getsummary $RESULTS_DIR/$LMBENCH_OS/*.0"
> }
>
> function test_cleanup {
>--
>2.20.1