[PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

Arnaldo Carvalho de Melo acme at kernel.org
Wed Jun 14 06:06:49 AEST 2023


Em Tue, Jun 13, 2023 at 10:11:43PM +0530, Athira Rajeev escreveu:
> From: Aditya Gupta <adityag at linux.ibm.com>
> 
> ${$1} gives bad substitution error on sh, bash, and zsh. This seems like
> a typo, and this patch modifies it to $1, since that is what it's usage
> looks like from wherever `check_exec_0` is called.

Nicely spotted!

Please add the people that last touched the problem to the cc list,
specially when it fixes a bug.

Thanks for adding a Fixes tag, that helps the stable at kernel.org guys to
get this propagated to supported kernel releases.

I've added the test author to the CC list in this message.

thanks!

- Arnaldo
 
> This issue due to ${$1} caused all function calls to give error in
> `find_str_or_fail` line, and so no test runs completely. But
> 'perf test "perf script task-analyzer tests"' wrongly reports
> that tests passed with the status OK, which is wrong considering
> the tests didn't even run completely
> 
> Fixes: e8478b84d6ba ("perf test: add new task-analyzer tests")
> Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
> Signed-off-by: Kajol Jain <kjain at linux.ibm.com>
> Signed-off-by: Aditya Gupta <adityag at linux.ibm.com>
> ---
>  tools/perf/tests/shell/test_task_analyzer.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/shell/test_task_analyzer.sh b/tools/perf/tests/shell/test_task_analyzer.sh
> index 4264b54b654b..84ab7e7f57d5 100755
> --- a/tools/perf/tests/shell/test_task_analyzer.sh
> +++ b/tools/perf/tests/shell/test_task_analyzer.sh
> @@ -31,7 +31,7 @@ report() {
>  
>  check_exec_0() {
>  	if [ $? != 0 ]; then
> -		report 1 "invokation of ${$1} command failed"
> +		report 1 "invocation of $1 command failed"
>  	fi
>  }
>  
> -- 
> 2.39.1
> 

-- 

- Arnaldo


More information about the Linuxppc-dev mailing list