From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: trix@redhat.com
Cc: williams@redhat.com, jkacur@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 15:49:37 +0200 [thread overview]
Message-ID: <20200420134937.fxyjibufftdt6btr@linutronix.de> (raw)
In-Reply-To: <20200418141449.19293-1-trix@redhat.com>
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().
Sebastian
next prev parent reply other threads:[~2020-04-20 13:49 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 [this message]
2020-04-20 16:04 ` John Kacur
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=20200420134937.fxyjibufftdt6btr@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=jkacur@redhat.com \
--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