Re: [PATCH v1 4/5] perf test trace: Remove set -e for BTF general tests

From: Howard Chu
Date: Sun May 18 2025 - 14:18:31 EST


Hello,

On Sun, May 18, 2025 at 10:38 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Sat, May 17, 2025 at 09:32:29AM -0700, Howard Chu wrote:
> > Remove set -e and print error messages in BTF general tests.

<SNIP>

> > + if ! echo "$output" | grep -q -E "^mv/[0-9]+ renameat(2)?\(.*, \"${file1}\", .*, \"${file2}\", .*\) += +[0-9]+$"
> > then
> > - echo "String augmentation test failed"
> > + printf "String augmentation test failed, output:\n$output"
>
> Looks like you need "\n" after the output as well.
>
> > err=1
> > fi
> > }
> > @@ -39,20 +38,20 @@ trace_test_string() {
> > trace_test_buffer() {
> > echo "Testing perf trace's buffer augmentation"
> > # echo will insert a newline (\10) at the end of the buffer
> > - if ! perf trace -e write --max-events=1 -- echo "${buffer}" 2>&1 | \
> > - grep -q -E "^echo/[0-9]+ write\([0-9]+, ${buffer}.*, [0-9]+\) += +[0-9]+$"
> > + output="$(perf trace -e write --max-events=1 -- echo "${buffer}" 2>&1)"
> > + if ! echo "$output" | grep -q -E "^echo/[0-9]+ write\([0-9]+, ${buffer}.*, [0-9]+\) += +[0-9]+$"
> > then
> > - echo "Buffer augmentation test failed"
> > + printf "Buffer augmentation test failed, output:\n$output"
>
> Ditto. And probably for the previous patch too.

No problem, thanks. I should also mention I used the wrong title for
patch 3. It should be 'perf test trace: Stop tracing hrtimer_setup
event in trace enum test' instead of 'perf test trace: Stop tracing
hrtimer_init event in trace enum test'. Thanks for the review and I
will change them in v2.

Thanks,
Howard