All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Howard Chu <howardchu95@gmail.com>
Cc: Benjamin Peterson <benjamin@engflow.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:PERFORMANCE EVENTS SUBSYSTEM"
	<linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH 2/2] perf tests: add test for trace output loss
Date: Thu, 14 Nov 2024 18:03:35 -0300	[thread overview]
Message-ID: <ZzZlpwTy_nXKE8LF@x1> (raw)
In-Reply-To: <CAH0uvojcZMVzDyNkWCSHMdwn59T2fgn6iGoqrh9NhaaQ5H2DOw@mail.gmail.com>

On Thu, Nov 14, 2024 at 12:16:46PM -0800, Howard Chu wrote:
> Hello,
> 
> On Thu, Nov 14, 2024 at 12:09 PM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > On Thu, Nov 14, 2024 at 09:44:56AM -0800, Benjamin Peterson wrote:
> > > > On Thu, Nov 14, 2024 at 02:37:52PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > diff --git a/tools/perf/tests/shell/trace_exit_race.sh b/tools/perf/tests/shell/trace_exit_race.sh
> > > > index 8b70324bc5b4fb4c..c37ed6bb9f7e8fab 100755
> > > > --- a/tools/perf/tests/shell/trace_exit_race.sh
> > > > +++ b/tools/perf/tests/shell/trace_exit_race.sh
> > > > @@ -12,10 +12,10 @@
> > > >  skip_if_no_perf_trace || exit 2
> >
> > > >  trace_shutdown_race() {
> > > > -       for i in $(seq 100); do
> > > > +       for _ in $(seq 100); do
> > > >                 perf trace -e syscalls:sys_enter_exit_group true 2>>$file
> > > >         done
> > > > -       [ $(grep -c -E " +[0-9]+\.[0-9]+ +true/[0-9]+ syscalls:sys_enter_exit_group\(\)$" $file) = "100" ]
> > > > +       [ "$(grep -c -E ' +[0-9]+\.[0-9]+ +true/[0-9]+ syscalls:sys_enter_exit_group\(\)$' $file)" = "100" ]
> > > >  }
> >
> > > This all looks okay.
> >
> > The test is failing for me as there is garbage in the output of perf
> > trace even with Namhyung having already applied your previous patch:
> >
> > ⬢ [acme@toolbox perf-tools-next]$ git log --oneline --author benjamin@engflow.com
> > 12bd434f68ea45c7 (HEAD -> perf-tools-next) perf tests: Add test for 'perf trace' output loss
> > efbcd2cd7eac10a9 perf trace: Do not lose last events in a race
> > 5fb8e56542a3cf46 (perf-tools-next/tmp.perf-tools-next) perf trace: avoid garbage when not printing a trace event's arguments
> > ⬢ [acme@toolbox perf-tools-next]$
> >
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982428 syscalls:sys_enter_exit_group( k?m)
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982430 syscalls:sys_enter_exit_group()
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982432 syscalls:sys_enter_exit_group()
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982434 syscalls:sys_enter_exit_group()
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982437 syscalls:sys_enter_exit_group( k�)
> > root@number:~# perf trace -e syscalls:sys_enter_exit_group true
> >      0.000 true/1982439 syscalls:sys_enter_exit_group(, loads 8��1)
> > root@number:~#
> >
> > So we don't _miss_ the events, which I was noticing and brought me to
> > test your latest 2 patches, which I applied and added a Tested-by, now
> > tryint to figure out this garbage...
> 
> Benjamin has already sent v2 to fix this:
> https://lore.kernel.org/linux-perf-users/20241107232128.108981-2-benjamin@engflow.com/

Interesting, I wonder why b4 didn't pick the v2 :-\

I'll try it, but see my other message, maybe the way I fixed is simpler?
Its a two liner that could be turned into a one liner by right at the
start of the function setting bf[0] = '\0', that way we wouldn't need
even to check if printed == 0 at the end.

Anyway, will test the newer version.

- Arnaldo

  reply	other threads:[~2024-11-14 21:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 23:45 [PATCH 1/2] perf trace: do not lose last events in a race Benjamin Peterson
2024-11-06 23:45 ` [PATCH 2/2] perf tests: add test for trace output loss Benjamin Peterson
2024-11-07 22:06   ` Howard Chu
2024-11-07 23:17     ` Benjamin Peterson
2024-11-08 16:20       ` Howard Chu
2024-11-08 16:59         ` Benjamin Peterson
2024-11-14 17:37   ` Arnaldo Carvalho de Melo
2024-11-14 17:43     ` Arnaldo Carvalho de Melo
2024-11-14 17:44       ` Benjamin Peterson
2024-11-14 20:09         ` Arnaldo Carvalho de Melo
2024-11-14 20:16           ` Howard Chu
2024-11-14 21:03             ` Arnaldo Carvalho de Melo [this message]
2024-11-14 20:50           ` Arnaldo Carvalho de Melo
2024-11-07 21:46 ` [PATCH 1/2] perf trace: do not lose last events in a race Howard Chu

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=ZzZlpwTy_nXKE8LF@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=benjamin@engflow.com \
    --cc=howardchu95@gmail.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.