public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: trix@redhat.com, williams@redhat.com, tglx@linutronix.de,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2] Import a new test, jitterz
Date: Mon, 20 Apr 2020 12:04:58 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.21.2004201204210.4545@planxty> (raw)
In-Reply-To: <20200420134937.fxyjibufftdt6btr@linutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]



On Mon, 20 Apr 2020, Sebastian Andrzej Siewior wrote:

> On 2020-04-18 07:14:49 [-0700], trix@redhat.com wrote:
> > --- /dev/null
> > +++ b/src/jitterz/jitterz.c
> > @@ -0,0 +1,400 @@
> …
> > +/*
> > + * jitterz
> > + *
> > + * Copyright 2019-2020 Tom Rix <trix@redhat.com>
> > + *
> > + */
> > +
> > +#ifndef _GNU_SOURCE
> > +#define _GNU_SOURCE
> > +#endif
> 
> in general there is no need of that ifndef and this should be taken care
> by the build system (and refuse the build if _GNU_SOURCE makes no
> difference/ is not available). And then include the config.h (or so)
> first header file. 
> In rt-tests, the Makefile already adds this define to the CFLAGS.
> 
> …
> > +/* Returns clock ticks */
> > +static inline uint64_t time_stamp_counter(void)
> > +{
> > +	uint64_t ret = -1;
> > +#if defined(__i386__) || defined(__x86_64__)
> > +	uint32_t l, h;
> > +
> > +	__asm__ __volatile__("lfence");
> > +	__asm__ __volatile__("rdtsc" : "=a"(l), "=d"(h));
> > +	ret = ((uint64_t)h << 32) | l;
> > +#else
> > +	fprintf(stderr,
> > +		"Add a time_stamp_counter function for your arch here %s:%d\n",
> > +		__FILE__, __LINE__);
> > +	exit(1);
> > +#endif
> > +	return ret;
> > +}
> 
> I remember I complained about this in `queuelat' and it ended nowhere
> once it got merged.
> To repeat my question: Is there a reason not to use clock_gettime()?
> With VDSO there should be hardly any difference between this and
> clock_gettime().

I would agree with Sebastian there Tom, also easier to maintain.

Thanks

John

  reply	other threads:[~2020-04-20 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 14:14 [PATCH v2] Import a new test, jitterz trix
2020-04-20 13:49 ` Sebastian Andrzej Siewior
2020-04-20 16:04   ` John Kacur [this message]
2020-04-20 16:59 ` John Kacur
2020-04-20 18:38   ` Tom Rix
2020-04-20 18:54 ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2020-04-01 22:13 [PATCH] " trix
2020-04-01 23:02 ` Thomas Gleixner
2020-04-18 14:40   ` [PATCH v2] " Tom Rix

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=alpine.LFD.2.21.2004201204210.4545@planxty \
    --to=jkacur@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=trix@redhat.com \
    --cc=williams@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