linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
	irogers@google.com, namhyung@kernel.org
Cc: atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com,
	linux-perf-users@vger.kernel.org, maddy@linux.ibm.com,
	disgoel@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 3/3] tools/perf/tests: Fix shellcheck warning in record_sideband.sh test
Date: Fri, 29 Sep 2023 09:41:33 +0530	[thread overview]
Message-ID: <20230929041133.95355-4-atrajeev@linux.vnet.ibm.com> (raw)
In-Reply-To: <20230929041133.95355-1-atrajeev@linux.vnet.ibm.com>

Running shellcheck on record_sideband.sh throws below
warning:

	In tests/shell/record_sideband.sh line 25:
	  if ! perf record -o ${perfdata} -BN --no-bpf-event -C $1 true 2>&1 >/dev/null
	    ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).

This shows shellcheck warning SC2069 where the redirection
order needs to be fixed. Use { cmd > file; } 2>&1 to fix the
redirection of perf record output

Fixes: 23b97c7ee963 ("perf test: Add test case for record sideband events")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
 tools/perf/tests/shell/record_sideband.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/record_sideband.sh b/tools/perf/tests/shell/record_sideband.sh
index 5024a7ce0c51..7e036763a43c 100755
--- a/tools/perf/tests/shell/record_sideband.sh
+++ b/tools/perf/tests/shell/record_sideband.sh
@@ -22,7 +22,7 @@ trap trap_cleanup EXIT TERM INT
 
 can_cpu_wide()
 {
-    if ! perf record -o ${perfdata} -BN --no-bpf-event -C $1 true 2>&1 >/dev/null
+    if ! { perf record -o ${perfdata} -BN --no-bpf-event -C $1 true > /dev/null; } 2>&1
     then
         echo "record sideband test [Skipped cannot record cpu$1]"
         err=2
-- 
2.31.1


  parent reply	other threads:[~2023-09-29  4:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  4:11 [PATCH 0/3] Fix for shellcheck issues with latest scripts in tests/shell Athira Rajeev
2023-09-29  4:11 ` [PATCH 1/3] perf tests test_arm_coresight: Fix the shellcheck warning in latest test_arm_coresight.sh Athira Rajeev
2023-10-05  5:02   ` Namhyung Kim
2023-10-05  8:19     ` James Clark
2023-10-05  9:36     ` Suzuki K Poulose
2023-10-12 15:56       ` Athira Rajeev
2023-10-12 16:07         ` Suzuki K Poulose
2023-10-12 16:20           ` Athira Rajeev
2023-10-05  8:20   ` James Clark
2023-10-05  8:54     ` Athira Rajeev
2023-11-06 21:44       ` Arnaldo Carvalho de Melo
2023-11-07  6:38         ` Athira Rajeev
2023-11-08 20:04           ` Arnaldo Carvalho de Melo
2023-10-05 10:15   ` David Laight
2023-10-05 15:45     ` David Laight
2023-10-12 15:47       ` Athira Rajeev
2023-09-29  4:11 ` [PATCH 2/3] tools/perf/tests Ignore the shellcheck SC2046 warning in lock_contentio Athira Rajeev
2023-09-29  4:11 ` Athira Rajeev [this message]
2023-10-05  5:04   ` [PATCH 3/3] tools/perf/tests: Fix shellcheck warning in record_sideband.sh test Namhyung Kim
2023-10-05  8:55     ` Athira Rajeev
2023-10-03  7:47 ` [PATCH 0/3] Fix for shellcheck issues with latest scripts in tests/shell kajoljain

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=20230929041133.95355-4-atrajeev@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.ibm.com \
    --cc=namhyung@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;
as well as URLs for NNTP newsgroup(s).