public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t 03/11] gem_wsim: Show workload timing stats
Date: Thu, 18 Jun 2020 11:47:39 +0100	[thread overview]
Message-ID: <20200618104747.24005-3-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20200618104747.24005-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Show average/min/max workload iteration and dropped period stats when 'p'
command is used.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_wsim.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index dc47470c621d..dd0b2e260a5a 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -2117,7 +2117,8 @@ static void *run_workload(void *data)
 	struct w_step *w;
 	int throttle = -1;
 	int qd_throttle = -1;
-	int count;
+	int count, missed = 0;
+	unsigned long time_tot = 0, time_min = ULONG_MAX, time_max = 0;
 	int i;
 
 	clock_gettime(CLOCK_MONOTONIC, &t_start);
@@ -2137,12 +2138,19 @@ static void *run_workload(void *data)
 				do_sleep = w->delay;
 			} else if (w->type == PERIOD) {
 				struct timespec now;
+				int elapsed;
 
 				clock_gettime(CLOCK_MONOTONIC, &now);
-				do_sleep = w->period -
-					   elapsed_us(&wrk->repeat_start, &now);
+				elapsed = elapsed_us(&wrk->repeat_start, &now);
+				do_sleep = w->period - elapsed;
+				time_tot += elapsed;
+				if (elapsed < time_min)
+					time_min = elapsed;
+				if (elapsed > time_max)
+					time_max = elapsed;
 				if (do_sleep < 0) {
-					if (verbose > 1)
+					missed++;
+					if (verbose > 2)
 						printf("%u: Dropped period @ %u/%u (%dus late)!\n",
 						       wrk->id, count, i, do_sleep);
 					continue;
@@ -2296,6 +2304,9 @@ static void *run_workload(void *data)
 		printf("%c%u: %.3fs elapsed (%d cycles, %.3f workloads/s).",
 		       wrk->background ? ' ' : '*', wrk->id,
 		       t, count, count / t);
+		if (time_tot)
+			printf(" Time avg/min/max=%lu/%lu/%luus; %u missed.",
+			       time_tot / count, time_min, time_max, missed);
 		putchar('\n');
 	}
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-06-18 10:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 10:47 [igt-dev] [PATCH i-g-t 01/11] gem_wsim: Rip out userspace balancing Tvrtko Ursulin
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 02/11] gem_wsim: Buffer objects working sets and complex dependencies Tvrtko Ursulin
2020-06-18 11:10   ` Chris Wilson
2020-06-18 10:47 ` Tvrtko Ursulin [this message]
2020-06-18 11:11   ` [igt-dev] [PATCH i-g-t 03/11] gem_wsim: Show workload timing stats Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 04/11] gem_wsim: Move BO allocation to a helper Tvrtko Ursulin
2020-06-18 11:11   ` Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 05/11] gem_wsim: Support random buffer sizes Tvrtko Ursulin
2020-06-18 11:12   ` [Intel-gfx] " Chris Wilson
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 06/11] gem_wsim: Support scaling workload batch durations Tvrtko Ursulin
2020-06-18 11:13   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 07/11] gem_wsim: Log max and active working set sizes in verbose mode Tvrtko Ursulin
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 08/11] gem_wsim: Snippet of a workload extracted from carchase Tvrtko Ursulin
2020-06-18 11:13   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 09/11] gem_wsim: Implement device selection Tvrtko Ursulin
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 10/11] gem_wsim: Fix calibration handling Tvrtko Ursulin
2020-06-18 11:15   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 11/11] gem_wsim: Do not keep batch mapped unless needed Tvrtko Ursulin
2020-06-18 10:56 ` [igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,01/11] gem_wsim: Rip out userspace balancing Patchwork
2020-06-18 11:09 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 01/11] " Chris Wilson

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=20200618104747.24005-3-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.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