From: Zhao Liu <zhao1.liu@intel.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Mads Ynddal <mads@ynddal.dk>, John Snow <jsnow@redhat.com>,
Cleber Rosa <crosa@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN
Date: Thu, 9 May 2024 12:14:41 +0800 [thread overview]
Message-ID: <ZjxNsUJGsm73a+eJ@intel.com> (raw)
In-Reply-To: <3cf22fc2-222d-40a1-b27f-fda72d4b2be5@linaro.org>
On Wed, May 08, 2024 at 04:23:00PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Wed, 8 May 2024 16:23:00 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable
> timestamp as WARN
>
> On 8/5/24 15:55, Zhao Liu wrote:
> > Hi Philippe,
> >
> > On Wed, May 08, 2024 at 03:09:39PM +0200, Philippe Mathieu-Daudé wrote:
> > > Date: Wed, 8 May 2024 15:09:39 +0200
> > > From: Philippe Mathieu-Daudé <philmd@linaro.org>
> > > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable
> > > timestamp as WARN
> > >
> > > On 8/5/24 06:32, Zhao Liu wrote:
> > > > In some trace log, there're unstable timestamp breaking temporal
> > > > ordering of trace records. For example:
> > > >
> > > > kvm_run_exit -0.015 pid=3289596 cpu_index=0x0 reason=0x6
> > > > kvm_vm_ioctl -0.020 pid=3289596 type=0xffffffffc008ae67 arg=0x7ffeefb5aa60
> > > > kvm_vm_ioctl -0.021 pid=3289596 type=0xffffffffc008ae67 arg=0x7ffeefb5aa60
> > > >
> > > > Negative delta intervals tend to get drowned in the massive trace logs,
> > > > and an unstable timestamp can corrupt the calculation of intervals
> > > > between two events adjacent to it.
> > > >
> > > > Therefore, mark the outputs with unstable timestamps as WARN like:
> > > >
> > > > WARN: skip unstable timestamp: kvm_run_exit cur(8497404907761146)-pre(8497404907761161) pid=3289596 cpu_index=0x0 reason=0x6
> > > > WARN: skip unstable timestamp: kvm_vm_ioctl cur(8497404908603653)-pre(8497404908603673) pid=3289596 type=0xffffffffc008ae67 arg=0x7ffeefb5aa60
> > > > WARN: skip unstable timestamp: kvm_vm_ioctl cur(8497404908625787)-pre(8497404908625808) pid=3289596 type=0xffffffffc008ae67 arg=0x7ffeefb5aa60
> > > >
> > > > This would help to identify unusual events.
> > > >
> > > > And skip them without updating Formatter2.last_timestamp_ns to avoid
> > > > time back.
> > >
> > > Can't we reorder them instead?
> >
> > I think so...IIUC, when the current event with "wrong" timestamp is
> > detected, its previous events records have already been output and
> > cannot be reordered.
>
> Well, this certainly need rework to cleverly handle out of sync
> events, reordering them to display them correctly.
>
> Skipping events really sounds a bad idea to me. Even more out
> of sync ones.
>
> Some simple approach could be to queue up to N events, then sort them
> and unqueue N/2, while processing all events.
Reordering might be possible, but as Stefan replied, some psitive value
might also be problematic too.
Maybe my negative value check is not enough in itself...
Thanks,
Zhao
next prev parent reply other threads:[~2024-05-09 4:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 4:32 [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN Zhao Liu
2024-05-08 13:09 ` Philippe Mathieu-Daudé
2024-05-08 13:55 ` Zhao Liu
2024-05-08 14:23 ` Philippe Mathieu-Daudé
2024-05-09 4:14 ` Zhao Liu [this message]
2024-05-08 18:05 ` Stefan Hajnoczi
2024-05-09 3:59 ` Zhao Liu
2024-05-09 13:47 ` Stefan Hajnoczi
2024-05-14 8:12 ` Zhao Liu
2024-05-14 12:56 ` Stefan Hajnoczi
2024-05-13 6:54 ` Mads Ynddal
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=ZjxNsUJGsm73a+eJ@intel.com \
--to=zhao1.liu@intel.com \
--cc=crosa@redhat.com \
--cc=jsnow@redhat.com \
--cc=mads@ynddal.dk \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).