linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rt-tests: incorrect first latency value for --verbose option
@ 2012-05-03  0:02 Frank Rowand
  2012-05-07 21:41 ` John Kacur
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Rowand @ 2012-05-03  0:02 UTC (permalink / raw)
  To: linux-rt-users@vger.kernel.org, williams, jkacur


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) {


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-07 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03  0:02 [PATCH] rt-tests: incorrect first latency value for --verbose option Frank Rowand
2012-05-07 21:41 ` John Kacur
2012-05-07 21:45   ` Frank Rowand
2012-05-07 22:03     ` John Kacur
2012-05-07 22:13       ` Frank Rowand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).