From: Waiman Long <longman@redhat.com>
To: Juntong Deng <juntong.deng@outlook.com>,
lizefan.x@bytedance.com, tj@kernel.org, hannes@cmpxchg.org,
shuah@kernel.org
Cc: cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] selftests/cgroup: Fix awk usage in test_cpuset_prs.sh that may cause error
Date: Tue, 26 Sep 2023 08:18:17 -0400 [thread overview]
Message-ID: <ed2993f2-4bdc-19c5-5a0f-1e96da44fb24@redhat.com> (raw)
In-Reply-To: <VI1P193MB07522BFC89B6B6DC5A89153999FCA@VI1P193MB0752.EURP193.PROD.OUTLOOK.COM>
On 9/25/23 15:38, Juntong Deng wrote:
> According to the awk manual, the -e option does not need to be specified
> in front of 'program' (unless you need to mix program-file).
>
> The redundant -e option can cause error when users use awk tools other
> than gawk (for example, mawk does not support the -e option).
>
> Error Example:
> awk: not an option: -e
> Cgroup v2 mount point not found!
>
> Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
> ---
> tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> index 4afb132e4e4f..6820653e8432 100755
> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> @@ -20,7 +20,7 @@ skip_test() {
> WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify
>
> # Find cgroup v2 mount point
> -CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}')
> +CGROUP2=$(mount -t cgroup2 | head -1 | awk '{print $3}')
> [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!"
>
> CPUS=$(lscpu | grep "^CPU(s):" | sed -e "s/.*:[[:space:]]*//")
Yes, the -e option is redundant. Thanks for catching that.
Acked-by: Waiman Long <longman@redhat.com>
next prev parent reply other threads:[~2023-09-26 12:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 19:38 Juntong Deng
2023-09-26 12:18 ` Waiman Long [this message]
2023-10-29 21:23 ` Juntong Deng
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=ed2993f2-4bdc-19c5-5a0f-1e96da44fb24@redhat.com \
--to=longman@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=juntong.deng@outlook.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®