pmc-cloud-tools icon indicating copy to clipboard operation
pmc-cloud-tools copied to clipboard

remove 2>&1 from perf stat to display errors

Open afernandez90 opened this issue 3 years ago • 1 comments

Redirecting stderr to stdout causes perf errors to be redirected to awk as normal stdin input. Then, awk silently discards them. This makes it hard to troubleshoot issues like unavailable counters or system configuration.

I had to remove '2>&1' manually from all scripts to troubleshoot silent termination with no errors. Turns out one metric was not available for my system and that causes 'perf stat' to terminate immediately. I think there's no reason to silence errors. When the script works fine, there's no error output and it works equally well.

afernandez90 avatar Dec 14 '21 18:12 afernandez90

Great PRs. I found the error by removing this

baonq-me avatar Aug 06 '24 02:08 baonq-me