From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>,
maddy@linux.vnet.ibm.com,
Nageswara Sastry <rnsastry@linux.ibm.com>,
Kajol Jain <kjain@linux.ibm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
linux-perf-users@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
Disha Goel <disgoel@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/2] tools/perf/tests: Fix string substitutions in build id test
Date: Wed, 28 Sep 2022 10:24:16 +0530 [thread overview]
Message-ID: <3EE5CFF3-51BC-444E-8FEF-2AC219E809F6@linux.vnet.ibm.com> (raw)
In-Reply-To: <444a5a64-7bc6-d5fd-2880-611c5cbca587@intel.com>
Hi All,
Looking for what direction we can take here.
Do we want to change all tests in tools/perf/tests/shell except test_intel_pt.sh to use "bash" or go with
the approach in the patch ? Please share your comments
Thanks
Athira
> On 23-Sep-2022, at 11:54 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> On 22/09/22 22:15, Arnaldo Carvalho de Melo wrote:
>> Em Wed, Sep 21, 2022 at 10:38:38PM +0530, Athira Rajeev escreveu:
>>> The perf test named “build id cache operations” skips with below
>>> error on some distros:
>>
>> I wonder if we shouldn't instead state that bash is needed?
>>
>> ⬢[acme@toolbox perf-urgent]$ head -1 tools/perf/tests/shell/*.sh | grep ^#
>> #!/bin/sh
>> #!/bin/bash
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/bash
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/bash
>> #!/bin/sh
>> #!/bin/bash
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> #!/bin/sh
>> ⬢[acme@toolbox perf-urgent]$
>>
>> Opinions?
>>
>
> Please don't change tools/perf/tests/shell/test_intel_pt.sh
>
> I started using shellcheck on that with the "perf test:
> test_intel_pt.sh: Add per-thread test" patch set that I sent.
>
> FYI, if you use shellcheck on buildid.sh, it shows up issues even
> after changing to bash:
>
> *** Before ***
>
> $ shellcheck -S warning tools/perf/tests/shell/buildid.sh
>
> In tools/perf/tests/shell/buildid.sh line 69:
> link=${build_id_dir}/.build-id/${id:0:2}/${id:2}
> ^-------^ SC2039: In POSIX sh, string indexing is undefined.
> ^-----^ SC2039: In POSIX sh, string indexing is undefined.
>
>
> In tools/perf/tests/shell/buildid.sh line 77:
> file=${build_id_dir}/.build-id/${id:0:2}/`readlink ${link}`/elf
> ^-------^ SC2039: In POSIX sh, string indexing is undefined.
>
>
> In tools/perf/tests/shell/buildid.sh line 123:
> echo "running: perf record $@"
> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
>
>
> In tools/perf/tests/shell/buildid.sh line 124:
> ${perf} record --buildid-all -o ${data} $@ &> ${log}
> ^-- SC2068: Double quote array expansions to avoid re-splitting elements.
> ^-------^ SC2039: In POSIX sh, &> is undefined.
>
>
> In tools/perf/tests/shell/buildid.sh line 126:
> echo "failed: record $@"
> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
>
>
> In tools/perf/tests/shell/buildid.sh line 131:
> check ${@: -1}
> ^------^ SC2068: Double quote array expansions to avoid re-splitting elements.
> ^------^ SC2039: In POSIX sh, string indexing is undefined.
>
>
> In tools/perf/tests/shell/buildid.sh line 158:
> exit ${err}
> ^----^ SC2154: err is referenced but not assigned.
>
> For more information:
> https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
> https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ...
> https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, &> is undefined.
>
> *** After ***
>
> $ shellcheck -S warning tools/perf/tests/shell/buildid.sh
>
> In tools/perf/tests/shell/buildid.sh line 123:
> echo "running: perf record $@"
> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
>
>
> In tools/perf/tests/shell/buildid.sh line 124:
> ${perf} record --buildid-all -o ${data} $@ &> ${log}
> ^-- SC2068: Double quote array expansions to avoid re-splitting elements.
>
>
> In tools/perf/tests/shell/buildid.sh line 126:
> echo "failed: record $@"
> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
>
>
> In tools/perf/tests/shell/buildid.sh line 131:
> check ${@: -1}
> ^------^ SC2068: Double quote array expansions to avoid re-splitting elements.
>
>
> In tools/perf/tests/shell/buildid.sh line 158:
> exit ${err}
> ^----^ SC2154: err is referenced but not assigned.
>
> For more information:
> https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
> https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ...
> https://www.shellcheck.net/wiki/SC2154 -- err is referenced but not assigned.
next prev parent reply other threads:[~2022-09-28 4:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 17:08 [PATCH 1/2] tools/perf/tests: Fix string substitutions in build id test Athira Rajeev
2022-09-21 17:08 ` [PATCH 2/2] tools/perf/tests: Fix build id test check for PE file Athira Rajeev
2022-09-22 19:15 ` [PATCH 1/2] tools/perf/tests: Fix string substitutions in build id test Arnaldo Carvalho de Melo
2022-09-22 23:44 ` Ian Rogers
2022-09-23 6:24 ` Adrian Hunter
2022-09-28 4:54 ` Athira Rajeev [this message]
2023-01-16 5:02 ` Athira Rajeev
2023-01-16 6:17 ` Ian Rogers
2023-01-16 11:59 ` Athira Rajeev
2023-01-16 22:00 ` Ian Rogers
2023-01-17 13:14 ` Athira Rajeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EE5CFF3-51BC-444E-8FEF-2AC219E809F6@linux.vnet.ibm.com \
--to=atrajeev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=disgoel@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=rnsastry@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).