Skip to contentSkip to conversation

a tiny patch related to two shell scripts that use 2&>1 in place of 2>&1

PATCH In review Patrice Duroux 5 participants 8 messages Mar 1, 2023 – Mar 25, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi,

Further to the following item reported to the Debian QA mailing list:
https://lists.debian.org/debian-qa/2023/02/msg00052.html
here is attached a patch regarding two possible candidates in the linux source tree.

Regards,
Patrice

tools/perf/tests/shell/record_offcpu.sh +1 -1
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +1 -1
index a1f269ee84da..92acab83fbe2 100755
@@ -31,7 +31,7 @@ trap 'cleanup' EXIT
 
 eth=${NETIFS[p1]}
 
-ip link del br0 2&>1 >/dev/null || :
+ip link del br0 2>&1 >/dev/null || :
 ip link add br0 type bridge && ip link set $eth master br0
 
 (while :; do
#1 lore raw

PATCH 1/2 replace 2&>1 by 2>&1

---
 tools/perf/tests/shell/record_offcpu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record_offcpu.sh +1 -1
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
Signature · 1 line
2.39.2
reviewer Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] replace 2&>1 by 2>&1

Quoted 2 lines · Patrice Duroux
Fixes ade1d0307b2f ("perf offcpu: Update offcpu test for child process")

Thanks,
Ian

Quoted 20 lines
---
 tools/perf/tests/shell/record_offcpu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record_offcpu.sh +1 -2
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
--

2.39.2

reviewer
#3 lore raw

Re: [PATCH 1/2] replace 2&>1 by 2>&1

Quoted 10 lines · Ian Rogers
Quoted 2 lines · Patrice Duroux
Fixes ade1d0307b2f ("perf offcpu: Update offcpu test for child process")

Thanks,
Ian

Arnaldo, could we pick this up?

Thanks,
Ian

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/tests/shell/record_offcpu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record_offcpu.sh +1 -2
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
--

2.39.2

#4 lore raw

Re: [PATCH 1/2] replace 2&>1 by 2>&1

Em Thu, Mar 23, 2023 at 11:03:49AM -0700, Ian Rogers escreveu:

Quoted 6 lines · Ian Rogers
Quoted 5 lines · Patrice Duroux
Quoted 2 lines
Quoted 7 lines
Quoted 5 lines
Fixes ade1d0307b2f ("perf offcpu: Update offcpu test for child process")

Thanks,
Ian

Arnaldo, could we pick this up?

Yeah, but next time please write in the subject line that its a patch for the perf tools :-)

- Arnaldo

Quoted 23 lines

Thanks,
Ian

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/tests/shell/record_offcpu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record_offcpu.sh +1 -2
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
--

2.39.2

Signature · 1 line
- Arnaldo
Acked-by
#5 lore raw

Re: [PATCH 1/2] replace 2&>1 by 2>&1

Hello,

Quoted 11 lines · Arnaldo Carvalho de Melo

Em Thu, Mar 23, 2023 at 11:03:49AM -0700, Ian Rogers escreveu:

Quoted 9 lines · Ian Rogers
Quoted 8 lines · Patrice Duroux
Quoted 2 lines
Fixes ade1d0307b2f ("perf offcpu: Update offcpu test for child process")
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Thanks,
Ian

Arnaldo, could we pick this up?

Yeah, but next time please write in the subject line that its a patch for the perf tools :-)

Oops, it was me who messed this up.. sorry about that. At least now I know where the file named "1" is created. :)

Thanks,
Namhyung

Quoted 25 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
---
 tools/perf/tests/shell/record_offcpu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record_offcpu.sh +0 -0
index e01973d4e0fb..f062ae9a95e1 100755
@@ -65,7 +65,7 @@ test_offcpu_child() {
 
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
tools/perf/tests/shell/record_offcpu.sh +1 -2
   # perf bench sched messaging creates 400 processes
   if ! perf record --off-cpu -e dummy -o ${perfdata} -- \
-    perf bench sched messaging -g 10 > /dev/null 2&>1
+    perf bench sched messaging -g 10 > /dev/null 2>&1
   then
     echo "Child task off-cpu test [Failed record]"
     err=1
--

2.39.2

--

- Arnaldo

#6 lore raw

PATCH 2/2 replace 2&>1 by 2>&1

In reply to Patrice Duroux
---
 .../testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +1 -1
index a1f269ee84da..92acab83fbe2 100755
@@ -31,7 +31,7 @@ trap 'cleanup' EXIT
 
 eth=${NETIFS[p1]}
 
-ip link del br0 2&>1 >/dev/null || :
+ip link del br0 2>&1 >/dev/null || :
 ip link add br0 type bridge && ip link set $eth master br0
 
 (while :; do
Signature · 1 line
2.39.2
maintainer
#7 lore raw

Re: [PATCH 2/2] replace 2&>1 by 2>&1

On 3/3/23 12:20, Patrice Duroux wrote:

Missing commit log and the commit summary doesn't include the subsystem - try selftests/net:

Also say what this change is fixing instead of making that the commit summary.

Quoted 10 lines
---
  .../testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +0 -0
index a1f269ee84da..92acab83fbe2 100755

tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh trap 'cleanup' EXIT · line 37

Quoted 8 lines
tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +1 -1
@@ -31,7 +31,7 @@ trap 'cleanup' EXIT
 
  eth=${NETIFS[p1]}
 
-ip link del br0 2&>1 >/dev/null || :
+ip link del br0 2>&1 >/dev/null || :
  ip link add br0 type bridge && ip link set $eth master br0
 
  (while :; do

thanks,
-- Shuah