From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 2/3] tests/i915/perf: deal with 0 delta reports
Date: Wed, 25 Nov 2020 14:12:27 -0800 [thread overview]
Message-ID: <20201125221227.GE4371@orsosgc001.ra.intel.com> (raw)
In-Reply-To: <20201125112540.426554-3-lionel.g.landwerlin@intel.com>
On Wed, Nov 25, 2020 at 01:25:39PM +0200, Lionel Landwerlin wrote:
>More thorough testing shows that it is possible to get a timer report
>followed by a context-switch report with the same timestamp.
>
>Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
nit below.
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Thanks,
Umesh
>---
> tests/i915/perf.c | 91 +++++++++++++++++++++++++----------------------
> 1 file changed, 49 insertions(+), 42 deletions(-)
>
>diff --git a/tests/i915/perf.c b/tests/i915/perf.c
>index 2fbea0f0c..811067aad 100644
>--- a/tests/i915/perf.c
>+++ b/tests/i915/perf.c
>@@ -778,15 +778,14 @@ gen8_sanity_check_test_oa_reports(const uint32_t *oa_report0,
> uint32_t b;
> uint32_t ref;
>
>+ igt_debug("report type: %s->%s %p/%p\n",
>+ gen8_read_report_reason(oa_report0),
>+ gen8_read_report_reason(oa_report1),
>+ oa_report0, oa_report1);
>
>- igt_assert_neq(time_delta, 0);
>- igt_assert_neq(clock_delta, 0);
>-
>- freq = ((uint64_t)clock_delta * 1000) / time_delta;
>+ freq = time_delta ? ((uint64_t)clock_delta * 1000) / time_delta : 0;
> igt_debug("freq = %"PRIu64"\n", freq);
Maybe one more check:
igt_assert(freq || (report_reason0 != report_reason1));
>
>- igt_assert(freq <= gt_max_freq_mhz);
>-
> igt_debug("clock delta = %"PRIu32"\n", clock_delta);
>
> max_delta = clock_delta * intel_perf->devinfo.n_eus;
>@@ -823,42 +822,50 @@ gen8_sanity_check_test_oa_reports(const uint32_t *oa_report0,
> * multiple of the gpu clock
> */
> if (format.n_b) {
>- b = rpt1_b[0] - rpt0_b[0];
>- igt_debug("B0: delta = %"PRIu32"\n", b);
>- igt_assert_eq(b, 0);
>-
>- b = rpt1_b[1] - rpt0_b[1];
>- igt_debug("B1: delta = %"PRIu32"\n", b);
>- igt_assert_eq(b, clock_delta);
>-
>- b = rpt1_b[2] - rpt0_b[2];
>- igt_debug("B2: delta = %"PRIu32"\n", b);
>- igt_assert_eq(b, clock_delta);
>-
>- b = rpt1_b[3] - rpt0_b[3];
>- ref = clock_delta / 2;
>- igt_debug("B3: delta = %"PRIu32"\n", b);
>- igt_assert(b >= ref - 1 && b <= ref + 1);
>-
>- b = rpt1_b[4] - rpt0_b[4];
>- ref = clock_delta / 3;
>- igt_debug("B4: delta = %"PRIu32"\n", b);
>- igt_assert(b >= ref - 1 && b <= ref + 1);
>-
>- b = rpt1_b[5] - rpt0_b[5];
>- ref = clock_delta / 3;
>- igt_debug("B5: delta = %"PRIu32"\n", b);
>- igt_assert(b >= ref - 1 && b <= ref + 1);
>-
>- b = rpt1_b[6] - rpt0_b[6];
>- ref = clock_delta / 6;
>- igt_debug("B6: delta = %"PRIu32"\n", b);
>- igt_assert(b >= ref - 1 && b <= ref + 1);
>-
>- b = rpt1_b[7] - rpt0_b[7];
>- ref = clock_delta * 2 / 3;
>- igt_debug("B7: delta = %"PRIu32"\n", b);
>- igt_assert(b >= ref - 1 && b <= ref + 1);
>+ if (clock_delta > 0) {
>+ b = rpt1_b[0] - rpt0_b[0];
>+ igt_debug("B0: delta = %"PRIu32"\n", b);
>+ igt_assert_eq(b, 0);
>+
>+ b = rpt1_b[1] - rpt0_b[1];
>+ igt_debug("B1: delta = %"PRIu32"\n", b);
>+ igt_assert_eq(b, clock_delta);
>+
>+ b = rpt1_b[2] - rpt0_b[2];
>+ igt_debug("B2: delta = %"PRIu32"\n", b);
>+ igt_assert_eq(b, clock_delta);
>+
>+ b = rpt1_b[3] - rpt0_b[3];
>+ ref = clock_delta / 2;
>+ igt_debug("B3: delta = %"PRIu32"\n", b);
>+ igt_assert(b >= ref - 1 && b <= ref + 1);
>+
>+ b = rpt1_b[4] - rpt0_b[4];
>+ ref = clock_delta / 3;
>+ igt_debug("B4: delta = %"PRIu32"\n", b);
>+ igt_assert(b >= ref - 1 && b <= ref + 1);
>+
>+ b = rpt1_b[5] - rpt0_b[5];
>+ ref = clock_delta / 3;
>+ igt_debug("B5: delta = %"PRIu32"\n", b);
>+ igt_assert(b >= ref - 1 && b <= ref + 1);
>+
>+ b = rpt1_b[6] - rpt0_b[6];
>+ ref = clock_delta / 6;
>+ igt_debug("B6: delta = %"PRIu32"\n", b);
>+ igt_assert(b >= ref - 1 && b <= ref + 1);
>+
>+ b = rpt1_b[7] - rpt0_b[7];
>+ ref = clock_delta * 2 / 3;
>+ igt_debug("B7: delta = %"PRIu32"\n", b);
>+ igt_assert(b >= ref - 1 && b <= ref + 1);
>+ } else {
>+ for (int j = 0; j < format.n_b; j++) {
>+ b = rpt1_b[j] - rpt0_b[j];
>+ igt_debug("B%i: delta = %"PRIu32"\n", j, b);
>+ igt_assert_eq(b, 0);
>+ }
>+ }
> }
>
> for (int j = 0; j < format.n_c; j++) {
>--
>2.29.2
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-11-25 22:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 11:25 [igt-dev] [PATCH i-g-t v2 0/3] tests/i915/perf: verify non zero reason field in OA reports Lionel Landwerlin
2020-11-25 11:25 ` [igt-dev] [PATCH i-g-t v2 1/3] tests/i915/perf: constify report checks functions Lionel Landwerlin
2020-11-25 21:43 ` Umesh Nerlige Ramappa
2020-11-25 11:25 ` [igt-dev] [PATCH i-g-t v2 2/3] tests/i915/perf: deal with 0 delta reports Lionel Landwerlin
2020-11-25 22:12 ` Umesh Nerlige Ramappa [this message]
2020-11-25 11:25 ` [igt-dev] [PATCH i-g-t v2 3/3] tests/i915/perf: verify reason field in OA reports is never 0 Lionel Landwerlin
2020-11-25 22:35 ` Umesh Nerlige Ramappa
2020-11-26 11:40 ` Lionel Landwerlin
2020-11-25 12:25 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/perf: verify non zero reason field in OA reports Patchwork
2020-11-25 13:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-11-25 14:08 ` Lionel Landwerlin
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=20201125221227.GE4371@orsosgc001.ra.intel.com \
--to=umesh.nerlige.ramappa@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lionel.g.landwerlin@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