From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9367610E9F9 for ; Wed, 15 Mar 2023 21:52:43 +0000 (UTC) Date: Wed, 15 Mar 2023 14:52:31 -0700 Message-ID: <87sfe5wulc.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <20230215004648.2100655-16-umesh.nerlige.ramappa@intel.com> References: <20230215004648.2100655-1-umesh.nerlige.ramappa@intel.com> <20230215004648.2100655-16-umesh.nerlige.ramappa@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t 15/31] i915/perf: Add OAM support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, Lionel G Landwerlin Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Tue, 14 Feb 2023 16:46:32 -0800, Umesh Nerlige Ramappa wrote: > > @@ -5306,10 +5345,27 @@ test_sysctl_defaults(void) > igt_assert_eq(max_freq, 100000); > } > > -#define __for_each_perf_enabled_engine(fd__, e__) \ > - for_each_physical_engine(fd__, e__) \ > - if (perf_supports_engine(e__)) \ > - igt_dynamic_f("%s", e__->name) > +static struct intel_execution_engine2 * > +__ci_to_e2(const intel_ctx_t *ctx, struct i915_engine_class_instance *ci) > +{ > + static struct intel_execution_engine2 e2; > + struct intel_execution_engine2 *e; > + > + for_each_ctx_engine(drm_fd, ctx, e) { > + if (e->class == ci->engine_class && e->instance == ci->engine_instance) { > + e2 = *e; > + break; > + } > + } > + > + return &e2; > +} > + > +#define __for_random_engine_in_each_group(groups_, ctx_, e_) \ > + for (int i_ = 0; \ > + i_ < num_perf_oa_groups && !!(e_ = __ci_to_e2(ctx_, random_engine(&groups_[i_]))); \ Sorry, missed that e2 is static. Basically here we are only checking for "i_ < num_perf_oa_groups". Maybe get rid of the "!!" above, it's implicit. With that this is: Reviewed-by: Ashutosh Dixit