public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: trix@redhat.com, williams@redhat.com, jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org, Tom Rix <trix@redhat.com>
Subject: Re: [PATCH v2] Import a new test, jitterz
Date: Mon, 20 Apr 2020 20:54:29 +0200	[thread overview]
Message-ID: <875zduvvh6.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200418141449.19293-1-trix@redhat.com>

Tom,

trix@redhat.com writes:
> From: Tom Rix <trix@redhat.com>

it seems you are serious about this.

> jitterz is a program for measuring system jitter.

Aside of that not being accurate, there is neither a proper description
of the functionality nor a reasoning why this is useful and should
therefore be part of rt-tests.

> diff --git a/src/jitterz/jitterz.8 b/src/jitterz/jitterz.8
> new file mode 100644
> index 0000000..5b85640
> --- /dev/null
> +++ b/src/jitterz/jitterz.8
> @@ -0,0 +1,39 @@
> +.TH JIITERZ 8 "April 1, 2020"
> +.SH NAME
> +jitterz \- inference of stalls by looking for gaps in executing a tight loop
> +.SH SYNOPSIS
> +.B jitterz
> +.RI "<options>"
> +.SH DESCRIPTION
> +In a tight loop, measure the time between iterations.
> +If the time exceeds a theshold, increment a count in a time
> +bucket.  At the end of test print out the buckets.

Jitter is the deviation from true periodicity of a periodic event.

But that's not what you are measuring here. You try to find gaps in
tight loop execution, which is something completely different.

Now again the question is what's the purpose and the value of this
measurement?

> +/* 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;

First of all. What's wrong with using clock_gettime() ?

> +	__asm__ __volatile__("lfence");
> +	__asm__ __volatile__("rdtsc" : "=a"(l), "=d"(h));

Aside of that x86-ism here, what guarantees that the CPU has lfence?

> +	ret = ((uint64_t)h << 32) | l;
> +#else
> +	fprintf(stderr,
> +		"Add a time_stamp_counter function for your arch here %s:%d\n",
> +		__FILE__, __LINE__);

This is brilliant. You know already at compile time that this can't
work, but instead of failing the build you print an error at runtime.

Thanks,

        tglx

  parent reply	other threads:[~2020-04-20 18:54 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
2020-04-20 16:59 ` John Kacur
2020-04-20 18:38   ` Tom Rix
2020-04-20 18:54 ` Thomas Gleixner [this message]
  -- 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=875zduvvh6.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --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