From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECC63C369CB for ; Wed, 23 Apr 2025 23:14:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0E9210E398; Wed, 23 Apr 2025 23:14:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="OFqF17Ht"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA26810E398 for ; Wed, 23 Apr 2025 23:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745450076; x=1776986076; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=QqwipsODptM944F56QETmiBjVl5zgQ7Jx/Zp3ljZ+aE=; b=OFqF17Ht30DbOGn7HSrejHI+A9vE2atSb3RJ09PH5qwflTBSYZQzzdTo F+xu/d/mIIuXPI/oiGCnD+aZfEm3rnx8ele5ujBHvWjbfQPj0ga/1qoMk F59Wu0LElcr0TC5Z4A17zrgylSxENxwsojUncLmpy2lo50ZwB+7vWwqOM eF5aBWw0J9P//dV0XMl6x/pm9LGRsSWWURfE3fccjx2gAc63hhhpEY0aF WYuiMMufaRmbIv00OzaagqSCHxMpw0DD3ZcvkXY4PPA22bE9lyZOUHmou d+w8y90/mXrJoESCwzgpViDXUvGEhkbd7RrILBox9/L22FvITsFW0jpnl A==; X-CSE-ConnectionGUID: Hhjl1lDXQzW0n8qbbXL2Ww== X-CSE-MsgGUID: 0eNHSwH2SyGlIehymJaUOQ== X-IronPort-AV: E=McAfee;i="6700,10204,11412"; a="46297005" X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="46297005" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 16:14:36 -0700 X-CSE-ConnectionGUID: SzDy56OfQCaFFUTQgOMRxQ== X-CSE-MsgGUID: hv7vPRHjTeyJjBMW9ZbsXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="132422380" Received: from zschafft-mobl.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.218.216]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 16:14:38 -0700 Date: Wed, 23 Apr 2025 16:14:33 -0700 Message-ID: <875xiu5v3a.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Harish Chegondi Cc: Subject: Re: [PATCH 1/1] tests/intel/xe_eu_stall: Add tests to run blocking and non-blocking read twice In-Reply-To: References: <87a58623sp.wl-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Wed, 23 Apr 2025 15:02:30 -0700, Harish Chegondi wrote: > > On Wed, Apr 23, 2025 at 10:20:06AM -0700, Dixit, Ashutosh wrote: > > On Tue, 22 Apr 2025 19:57:34 -0700, Harish Chegondi wrote: > > > > > > Add tests that enable EU stall sampling, read all the EU stall data and > > > disable EU stall sampling, two times back to back. Add tests for both > > > blocking and non-blocking reads. Also, add a check for the presence of > > > /proc/sys/dev/xe/observation_paranoid file which is required for the > > > unprivileged-access test. > > > > > > Signed-off-by: Harish Chegondi > > > --- > > > tests/intel/xe_eu_stall.c | 44 ++++++++++++++++++++++++++++++--------- > > > 1 file changed, 34 insertions(+), 10 deletions(-) > > > > > > diff --git a/tests/intel/xe_eu_stall.c b/tests/intel/xe_eu_stall.c > > > index da9bd7843..15d4589c6 100644 > > > --- a/tests/intel/xe_eu_stall.c > > > +++ b/tests/intel/xe_eu_stall.c > > > @@ -14,9 +14,15 @@ > > > * SUBTEST: non-blocking-read > > > * Description: Verify non-blocking read of EU stall data during a workload run > > > * > > > + * SUBTEST: non-blocking-read-twice > > > + * Description: Run non-blocking read test twice with disable and enable between the runs > > > + * > > > * SUBTEST: blocking-read > > > * Description: Verify blocking read of EU stall data during a workload run > > > * > > > + * SUBTEST: blocking-read-twice > > > + * Description: Run blocking read test twice with disable and enable between the runs > > > + * > > > > Not sure about the "read-twice" name, i.e. not sure if that name clearly > > communicates the purpose of these new tests. The purpose to me seems that > > reads can be done after a disable and enable, correct? > > > > Maybe "blocking-enable-disable" and "non-blocking-enable-disable" are > > better names? > Yes I will change the names. How about non-blocking-read-after-re-enable > and blocking-read-after-re-enable ? This would convey that the test > would enable two times and a read after the second enable ? "read" is sort of obvious, e.g. OA uses "blocking" and "non-blocking" as the names, without "read". So, in the interest of keeping the names short, I would just name them "non-blocking-re-enable" and "blocking-re-enable". But anyway, the final choice of the names is yours, the patch already has a R-b :) > > > > Otherwise this is: > > > > Reviewed-by: Ashutosh Dixit > > > > Let me know if you are going to change the names. Thanks. > > > > > * SUBTEST: unprivileged-access > > > * Description: Verify unprivileged open of a EU stall data stream fd > > > * > > > @@ -33,6 +39,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > > > > #include "igt.h" > > > @@ -460,13 +467,13 @@ static void print_eu_stall_data(uint32_t devid, uint8_t *buf, size_t size) > > > * while the parent process reads the stall counters data, disables EU stall > > > * counters once the workload completes execution. > > > */ > > > -static void test_eustall(int drm_fd, uint32_t devid, bool blocking_read) > > > +static void test_eustall(int drm_fd, uint32_t devid, bool blocking_read, int iter) > > > { > > > - uint32_t num_samples = 0, num_drops = 0; > > > + uint32_t num_samples, num_drops; > > > struct igt_helper_process work_load = {}; > > > struct sigaction sa = { 0 }; > > > int ret, flags, stream_fd; > > > - uint64_t total_size = 0; > > > + uint64_t total_size; > > > uint8_t *buf; > > > > > > uint64_t properties[] = { > > > @@ -520,7 +527,7 @@ static void test_eustall(int drm_fd, uint32_t devid, bool blocking_read) > > > flags = O_CLOEXEC; > > > > > > set_fd_flags(stream_fd, flags); > > > - > > > +enable: > > > do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0); > > > > > > sa.sa_handler = sighandler; > > > @@ -540,6 +547,9 @@ static void test_eustall(int drm_fd, uint32_t devid, bool blocking_read) > > > _exit(run_gpgpu_fill(drm_fd, devid)); > > > } > > > } > > > + total_size = 0; > > > + num_samples = 0; > > > + num_drops = 0; > > > /* Parent process reads the EU stall counters data */ > > > do { > > > if (!blocking_read) { > > > @@ -574,14 +584,16 @@ static void test_eustall(int drm_fd, uint32_t devid, bool blocking_read) > > > igt_info("Number of samples: %u\n", num_samples); > > > igt_info("Number of drops reported: %u\n", num_drops); > > > > > > + ret = wait_child(&work_load); > > > + igt_assert_f(ret == 0, "waitpid() - ret: %d, errno: %d\n", ret, errno); > > > + igt_assert_f(num_samples, "No EU stalls detected during the workload\n"); > > > + > > > do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_DISABLE, 0); > > > + if (--iter) > > > + goto enable; > > > > > > close(stream_fd); > > > free(buf); > > > - > > > - ret = wait_child(&work_load); > > > - igt_assert_f(ret == 0, "waitpid() - ret: %d, errno: %d\n", ret, errno); > > > - igt_assert_f(num_samples, "No EU stalls detected during the workload\n"); > > > } > > > > > > static int opt_handler(int opt, int opt_index, void *data) > > > @@ -634,6 +646,7 @@ igt_main_args("e:g:o:r:u:w:", long_options, help_str, opt_handler, NULL) > > > { > > > int drm_fd; > > > uint32_t devid; > > > + struct stat sb; > > > bool blocking_read = true; > > > > > > igt_fixture { > > > @@ -642,6 +655,7 @@ igt_main_args("e:g:o:r:u:w:", long_options, help_str, opt_handler, NULL) > > > devid = intel_get_drm_devid(drm_fd); > > > igt_require(IS_PONTEVECCHIO(devid) || intel_graphics_ver(devid) >= IP_VER(20, 0)); > > > igt_require_f(igt_get_gpgpu_fillfunc(devid), "no gpgpu-fill function\n"); > > > + igt_require(!stat(OBSERVATION_PARANOID, &sb)); > > > if (output_file) { > > > output = fopen(output_file, "w"); > > > igt_require(output); > > > @@ -650,12 +664,22 @@ igt_main_args("e:g:o:r:u:w:", long_options, help_str, opt_handler, NULL) > > > > > > igt_describe("Verify non-blocking read of EU stall data during a workload run"); > > > igt_subtest("non-blocking-read") { > > > - test_eustall(drm_fd, devid, !blocking_read); > > > + test_eustall(drm_fd, devid, !blocking_read, 1); > > > + } > > > + > > > + igt_describe("Run non-blocking read test twice with disable and enable between the runs"); > > > + igt_subtest("non-blocking-read-twice") { > > > + test_eustall(drm_fd, devid, !blocking_read, 2); > > > } > > > > > > igt_describe("Verify blocking read of EU stall data during a workload run"); > > > igt_subtest("blocking-read") { > > > - test_eustall(drm_fd, devid, blocking_read); > > > + test_eustall(drm_fd, devid, blocking_read, 1); > > > + } > > > + > > > + igt_describe("Run blocking read test twice with disable and enable between the runs"); > > > + igt_subtest("blocking-read-twice") { > > > + test_eustall(drm_fd, devid, blocking_read, 2); > > > } > > > > > > igt_describe("Verify that unprivileged open of a EU stall data fd fails"); > > > -- > > > 2.48.1 > > >