All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_flip: Print timevals as float
Date: Fri, 6 Jul 2018 19:17:04 +0300	[thread overview]
Message-ID: <20180706161704.GN5565@intel.com> (raw)
In-Reply-To: <153088896608.7594.8769887620812665265@cwilso3-mobl.ger.corp.intel.com>

On Fri, Jul 06, 2018 at 03:56:06PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-07-06 15:50:48)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Time intervals as produced by timersub() are normalized to have
> > the tv_usec in the range 0-999999. That leads to very confusing
> > looking debug output for negative interval. Eg. an interval
> > of -0.1 seconds would be represented as tv_sec=-1, tv_usec=900000.
> > Let's just convert the thing to a float seconds value and print
> > that so that we'll get less confusing debug output.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  tests/kms_flip.c | 43 +++++++++++++++++++++++--------------------
> >  1 file changed, 23 insertions(+), 20 deletions(-)
> > 
> > diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> > index 3d6fe948d3bb..393d690ab535 100644
> > --- a/tests/kms_flip.c
> > +++ b/tests/kms_flip.c
> > @@ -125,23 +125,28 @@ struct event_state {
> >         int seq_step;
> >  };
> >  
> > +static float timeval_float(const struct timeval *tv)
> > +{
> > +       return tv->tv_sec + tv->tv_usec / 1000000.0f;
> > +}
> > +
> >  static void dump_event_state(const struct event_state *es)
> >  {
> >         igt_debug("name = %s\n"
> > -                 "last_ts = %ld.%06ld\n"
> > -                 "last_received_ts = %ld.%06ld\n"
> > +                 "last_ts = %.06f\n"
> > +                 "last_received_ts = %.06f\n"
> 
> Bikeshed time. We expect differences to be on the ms range, so
> %.03fms and timeval_ms()?

I guess that might be a decent idea. Although it rather makes
me want to switch over to float msecs everywhere in the test.

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-07-06 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 14:50 [igt-dev] [PATCH i-g-t] tests/kms_flip: Print timevals as float Ville Syrjala
2018-07-06 14:56 ` Chris Wilson
2018-07-06 16:17   ` Ville Syrjälä [this message]
2018-07-06 17:31 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-07-07 16:49 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=20180706161704.GN5565@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.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.