From: Riana Tauro <riana.tauro@intel.com>
To: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>,
<igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH 4/5] tests/intel: Print drpc info for rc6_residency test
Date: Thu, 9 Nov 2023 15:54:13 +0530 [thread overview]
Message-ID: <01e6c47b-e4d6-4ff6-848b-287f07278acb@intel.com> (raw)
In-Reply-To: <20231109063212.359798-5-sujaritha.sundaresan@intel.com>
Hi Suja
On 11/9/2023 12:02 PM, Sujaritha Sundaresan wrote:
> Add drpc debug info for the rc6_residency test.
>
> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
> ---
> tests/intel/i915_pm_rc6_residency.c | 47 ++++++++++++++++++++++-------
> 1 file changed, 36 insertions(+), 11 deletions(-)
>
> diff --git a/tests/intel/i915_pm_rc6_residency.c b/tests/intel/i915_pm_rc6_residency.c
> index 6c8ba52ae..a929a2175 100644
> --- a/tests/intel/i915_pm_rc6_residency.c
> +++ b/tests/intel/i915_pm_rc6_residency.c
> @@ -36,6 +36,7 @@
> #include "i915/gem.h"
> #include "i915/gem_create.h"
> #include "igt.h"
> +#include "igt_debugfs.h"
> #include "igt_perf.h"
> #include "igt_power.h"
> #include "igt_sysfs.h"
> @@ -233,14 +234,27 @@ static uint64_t pmu_read_single(int fd)
> return __pmu_read_single(fd, NULL);
> }
>
> -#define __assert_within_epsilon(x, ref, tol_up, tol_down) \
> - igt_assert_f((x) <= (ref) * (1.0 + (tol_up)/100.) && \
> - (x) >= (ref) * (1.0 - (tol_down)/100.), \
> - "'%s' != '%s' (%.3g not within +%d%%/-%d%% tolerance of %.3g)\n",\
> - #x, #ref, (double)(x), (tol_up), (tol_down), (double)(ref))
> +#define __assert_within_epsilon(x, ref, tol_up, tol_down, debug_data) \
> + igt_assert_f((double)(x) <= (1.0 + (tol_up)) * (double)(ref) && \
> + (double)(x) >= (1.0 - (tol_down)) * (double)(ref), \
> + "'%s' != '%s' (%f not within +%.1f%%/-%.1f%% tolerance of %f)\n %s\n",\
> + #x, #ref, (double)(x), \
> + (tol_up) * 100.0, (tol_down) * 100.0, \
> + (double)(ref), debug_data)
>
> -#define assert_within_epsilon(x, ref, tolerance) \
> - __assert_within_epsilon(x, ref, tolerance, tolerance)
> +#define assert_within_epsilon(x, ref, tolerance, debug_data) \
> + __assert_within_epsilon(x, ref, tolerance, tolerance, debug_data)
> +
> +char *drpc;
> +
> +static char *get_drpc(int i915, int gt_id)
> +{
> + int gt_dir;
> +
> + gt_dir = igt_debugfs_gt_dir(i915, gt_id);
> + igt_assert(gt_dir != -1);
> + return igt_sysfs_get(gt_dir, "drpc");
> +}
>
> static bool __pmu_wait_for_rc6(int fd)
> {
> @@ -417,7 +431,9 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags, unsigned int gt)
> "Total energy used while idle: %.1fmJ (%.1fmW)\n",
> idle, (idle * 1e9) / slept);
> }
> - assert_within_epsilon(rc6, ts[1] - ts[0], 5);
> + drpc = get_drpc(i915, igt_sysfs_get_u32(gt, "id"));
This should be get_drpc(i915,gt);
> +
> + assert_within_epsilon(rc6, ts[1] - ts[0], 5, drpc);
>
> done = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
>
> @@ -453,7 +469,10 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags, unsigned int gt)
> igt_assert(cycles >= SLEEP_DURATION);
>
> /* While very nearly idle, expect full RC6 */
> - assert_within_epsilon(rc6, ts[1] - ts[0], tolerance);
> + assert_within_epsilon(rc6, ts[1] - ts[0], tolerance, drpc);
> +
> + free(drpc);
> + drpc = NULL;
> }
>
> munmap(done, 4096);
> @@ -506,7 +525,9 @@ static void rc6_fence(int i915, unsigned int gt)
> "Total energy used while idle: %.1fmJ (%.1fmW)\n",
> idle, (idle * 1e9) / slept);
> }
> - assert_within_epsilon(rc6, ts[1] - ts[0], 5);
> + drpc = get_drpc(i915, igt_sysfs_get_u32(gt, "id"));
> +
> + assert_within_epsilon(rc6, ts[1] - ts[0], 5, drpc);
>
> /* Submit but delay execution, we should be idle and conserving power */
> ctx = intel_ctx_create_for_gt(i915, gt);
> @@ -547,8 +568,11 @@ static void rc6_fence(int i915, unsigned int gt)
>
> close(timeline);
>
> - assert_within_epsilon(rc6, ts[1] - ts[0], tolerance);
> + assert_within_epsilon(rc6, ts[1] - ts[0], tolerance, drpc);
This will print old drpc value. call the function here as well
> gem_quiescent_gpu(i915);
> +
> + free(drpc);
> + drpc = NULL;
> }
> put_ahnd(ahnd);
> intel_ctx_destroy(i915, ctx);
> @@ -637,6 +661,7 @@ igt_main
> }
>
> igt_fixture {
> + free(drpc);
> drm_close_driver(i915);
> }
> }
next prev parent reply other threads:[~2023-11-09 10:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 6:32 [igt-dev] [PATCH 0/5] Add multi-gt support for RC6 residency test Sujaritha Sundaresan
2023-11-09 6:32 ` [igt-dev] [PATCH 1/5] tests/intel: Add multi-gt support for rc6-idle test Sujaritha Sundaresan
2023-11-09 6:32 ` [igt-dev] [PATCH 2/5] tests/intel: Add multi-gt support for rc6-fence test Sujaritha Sundaresan
2023-11-09 6:32 ` [igt-dev] [PATCH 3/5] tests/intel: Add multi-gt support for rc6-accuracy test Sujaritha Sundaresan
2023-11-09 6:32 ` [igt-dev] [PATCH 4/5] tests/intel: Print drpc info for rc6_residency test Sujaritha Sundaresan
2023-11-09 10:24 ` Riana Tauro [this message]
2023-11-09 6:32 ` [igt-dev] [PATCH 5/5] HAX: Add rc6 residency to fast-feedback.testlist Sujaritha Sundaresan
2023-11-09 7:46 ` [igt-dev] ✗ CI.xeBAT: failure for Add multi-gt support for RC6 residency test (rev2) Patchwork
2023-11-09 7:55 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
2023-11-09 9:38 ` [igt-dev] ✓ CI.xeBAT: success for Add multi-gt support for RC6 residency test (rev3) Patchwork
2023-11-09 9:49 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
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=01e6c47b-e4d6-4ff6-848b-287f07278acb@intel.com \
--to=riana.tauro@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sujaritha.sundaresan@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