All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Rowand <frank.rowand@am.sony.com>
To: "linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>,
	<williams@redhat.com>, <jkacur@redhat.com>
Subject: [PATCH] rt-tests: incorrect first latency value for --verbose option
Date: Wed, 2 May 2012 17:02:40 -0700	[thread overview]
Message-ID: <4FA1CB20.5000209@am.sony.com> (raw)


When the --verbose option is selected, the first value for each thread is
incorrectly reported as zero.

This is because when collecting the first value, the index into stat->values is
incremented from zero to one before storing the value.  But when printing the
values, the first value printed is stat->values[0], which has been initialized
to zero.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
 src/cyclictest/cyclictest.c |    3 	2 +	1 -	0 !
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: b/src/cyclictest/cyclictest.c
===================================================================
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -756,7 +756,6 @@ void *timerthread(void *param)
 			pthread_mutex_unlock(&break_thread_id_lock);
 		}
 		stat->act = diff;
-		stat->cycles++;
 
 		if (par->bufmsk)
 			stat->values[stat->cycles & par->bufmsk] = diff;
@@ -769,6 +768,8 @@ void *timerthread(void *param)
 				stat->hist_array[diff]++;
 		}
 
+		stat->cycles++;
+
 		next.tv_sec += interval.tv_sec;
 		next.tv_nsec += interval.tv_nsec;
 		if (par->mode == MODE_CYCLIC) {


             reply	other threads:[~2012-05-03  0:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03  0:02 Frank Rowand [this message]
2012-05-07 21:41 ` [PATCH] rt-tests: incorrect first latency value for --verbose option John Kacur
2012-05-07 21:45   ` Frank Rowand
2012-05-07 22:03     ` John Kacur
2012-05-07 22:13       ` Frank Rowand

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=4FA1CB20.5000209@am.sony.com \
    --to=frank.rowand@am.sony.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --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 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.