From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 25/28] xe/oa/mdapi-xml-convert: Add support for 576B_PEC64LL format
Date: Thu, 20 Jun 2024 16:43:35 -0700 [thread overview]
Message-ID: <ZnS+p0LW5Yc5pIDl@orsosgc001> (raw)
In-Reply-To: <20240620200054.3550653-26-ashutosh.dixit@intel.com>
On Thu, Jun 20, 2024 at 01:00:50PM -0700, Ashutosh Dixit wrote:
>From: José Roberto de Souza <jose.souza@intel.com>
>
>Xe2 don't use the 256bytes long format, instead it uses a 576bytes
>long with 64 PEC fields that are 64 bits long.
>This patch fixes the xe2 definition and add the parser for this format.
>
>Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>---
> lib/xe/oa-configs/codegen.py | 5 ++
> lib/xe/oa-configs/mdapi-xml-convert.py | 76 +++++++++++++++++++++-----
> lib/xe/xe_oa.h | 1 +
> 3 files changed, 67 insertions(+), 15 deletions(-)
>
>diff --git a/lib/xe/oa-configs/codegen.py b/lib/xe/oa-configs/codegen.py
>index f078ef9498..51498f803d 100644
>--- a/lib/xe/oa-configs/codegen.py
>+++ b/lib/xe/oa-configs/codegen.py
>@@ -128,6 +128,7 @@ class Set:
> return self.xml.find(path)
>
>
>+#TODO add SqidiTotalCount, L3BankTotalCount, L3NodeTotalCount
> hw_vars_mapping = {
> "$EuCoresTotalCount": { 'c': "perf->devinfo.n_eus", 'desc': "The total number of execution units" },
> "$EuSlicesTotalCount": { 'c': "perf->devinfo.n_eu_slices" },
>@@ -159,6 +160,10 @@ hw_vars_mapping = {
> "$GpuMaxFrequency": { 'c': "perf->devinfo.gt_max_freq" },
> "$SkuRevisionId": { 'c': "perf->devinfo.revision" },
> "$QueryMode": { 'c': "perf->devinfo.query_mode" },
>+
>+ "$ComputeEngineTotalCount": { 'c': "perf->devinfo.n_eus", 'desc': "The total number of execution units" },
>+
>+ "$CopyEngineTotalCount": { 'c': "perf->devinfo.n_eus", 'desc': "The total number of execution units" },
> }
>
> def is_hw_var(name):
>diff --git a/lib/xe/oa-configs/mdapi-xml-convert.py b/lib/xe/oa-configs/mdapi-xml-convert.py
>index 575b53e955..602a3965af 100755
>--- a/lib/xe/oa-configs/mdapi-xml-convert.py
>+++ b/lib/xe/oa-configs/mdapi-xml-convert.py
>@@ -149,12 +149,10 @@ mtl_chipset_oam_samedia_params = {
> }
> }
>
>-# FIXME: everything except oa_report_size is incorrect here
>-xe2_chipset_params = {
>- 'a_offset': 16,
>- 'b_offset': 192,
>- 'c_offset': 224,
>+xe2_chipset_params_pec = {
>+ 'pec_offset': 32,
> 'oa_report_size': 576,
>+ # TODO: Not sure about the configs below
> 'config_reg_blacklist': {
> 0x2364, # OACTXID
> },
>@@ -183,7 +181,11 @@ mtl_chipset_oa_formats = {
> }
>
> xe2_chipset_oa_formats = {
>- '256B_GENERIC_NOA16': xe2_chipset_params,
>+ '576B_PEC64LL': xe2_chipset_params_pec,
>+ # We only care about 576B_PEC64LL metrics in Xe2, entries below is just to
>+ # surpress warnings
>+ '256B_GENERIC_NOA16': xehpsdv_chipset_params,
>+ '128B_MPEC8_NOA16': mtl_chipset_oam_samedia_params,
> }
>
> chipsets = {
>@@ -209,8 +211,6 @@ chipsets = {
>
> xehp_plus = ( 'ACM', 'MTL' )
>
>-xe2_plus = ( 'LNL' )
>-
> register_types = { 'OA', 'NOA', 'FLEX', 'PM' }
>
> default_set_blacklist = { "RenderDX1x", # TODO: rename to something non 'DX'
>@@ -298,6 +298,46 @@ def read_token_to_rpn_read_oam(chipset, token, raw_offsets, oa_format):
>
> assert 0
>
>+def read_token_to_rpn_read_pec(chipset, token, raw_offsets, oa_format):
>+ width, offset_str = token.split('@')
>+ offset = int(offset_str, 16)
>+
>+ if width != 'qw':
>+ assert 0
>+
>+ if raw_offsets:
>+ pec_offset = chipsets[chipset][oa_format]['pec_offset']
>+
>+ if offset < pec_offset:
>+ if offset == 8:
>+ return "GPU_TIME 0 READ"
>+ elif offset == 24:
>+ return "GPU_CLOCK 0 READ"
>+ else:
>+ assert 0
>+ else:
>+ pec_cnt_offset = int((offset - pec_offset) / 8)
>+
>+ return "PEC " + str(pec_cnt_offset) + " READ"
>+ else:
>+ # Location in the accumulated deltas
>+ idx = int(offset / 8)
>+
>+ if idx == 0:
>+ return "GPU_TIME 0 READ"
>+ elif idx == 1:
>+ return "GPU_CLOCK 0 READ"
>+ else:
>+ idx = idx - 2;
>+ pec_cnt_offset = str(idx)
>+ pec_high_low_text = "low"
>+ if (offset % 8) > 0:
>+ pec_high_low_text = "high"
>+
>+ return "PEC " + pec_cnt_offset + " READ"
>+
>+ assert 0
>+
> def read_token_to_rpn_read_oag(chipset, token, raw_offsets, oa_format):
> width, offset_str = token.split('@')
>
>@@ -374,9 +414,6 @@ def read_token_to_rpn_read_oag(chipset, token, raw_offsets, oa_format):
> return "C " + str(idx - 48) + " READ"
> else:
> return "{0} READ".format(read_value(chipset, offset, oa_format))
>- elif chipset in xe2_plus:
>- # FIXME: skip all metrics to retain just the registers
>- return "GPU_TIME 0 READ"
> else:
> # For Gen8+ the array of accumulated counters is
> # assumed to start with a GPU_TIME then GPU_CLOCK,
>@@ -405,6 +442,9 @@ def read_token_to_rpn_read(chipset, token, raw_offsets, oa_format):
> if oa_format in ['192B_MPEC8LL_NOA16', '128B_MPEC8_NOA16']:
> return read_token_to_rpn_read_oam(chipset, token, raw_offsets, oa_format)
>
>+ if oa_format in ['576B_PEC64LL']:
>+ return read_token_to_rpn_read_pec(chipset, token, raw_offsets, oa_format)
>+
> assert 0
>
> def replace_read_tokens_with_rpn_read_ops(chipset, oa_format, equation, raw_offsets):
>@@ -905,6 +945,8 @@ for arg in args.xml:
> mdapi_counter.set('NormalizationEquation', '$GpuCoreClocks 1000000000 UMUL $GpuTime UDIV')
> #mdapi_counter.set('DeltaReportReadEquation', '$GpuCoreClocks $GpuTime UDIV')
>
>+ if mdapi_counter.get('SymbolName') == "ResultUncertainty":
>+ continue
>
> symbol_name = oa_registry.Registry.sanitize_symbol_name(mdapi_counter.get('SymbolName'))
>
>@@ -992,11 +1034,15 @@ for arg in args.xml:
> # XXX: As a special case, we override the raw and delta report
> # equations for the GpuTime counters, which seem inconsistent
> if mdapi_counter.get('SymbolName') == "GpuTime":
>- mdapi_counter.set('DeltaReportReadEquation', "qw@0x0 1000000000 UMUL $GpuTimestampFrequency UDIV")
>- if chipset == 'MTL' and oa_format != '256B_GENERIC_NOA16':
>- mdapi_counter.set('SnapshotReportReadEquation', "qw@0x08 1000000000 UMUL $GpuTimestampFrequency UDIV")
>+ if oa_format == '576B_PEC64LL':
>+ mdapi_counter.set('DeltaReportReadEquation', "qw@0x0 1000000000 UMUL $GpuTimestampFrequency UDIV")
>+ mdapi_counter.set('SnapshotReportReadEquation', "qw@0x08 1000000000 UMUL $GpuTimestampFrequency UDIV")
> else:
>- mdapi_counter.set('SnapshotReportReadEquation', "dw@0x04 1000000000 UMUL $GpuTimestampFrequency UDIV")
>+ mdapi_counter.set('DeltaReportReadEquation', "qw@0x0 1000000000 UMUL $GpuTimestampFrequency UDIV")
>+ if chipset == 'MTL' and oa_format != '256B_GENERIC_NOA16':
>+ mdapi_counter.set('SnapshotReportReadEquation', "qw@0x08 1000000000 UMUL $GpuTimestampFrequency UDIV")
>+ else:
>+ mdapi_counter.set('SnapshotReportReadEquation', "dw@0x04 1000000000 UMUL $GpuTimestampFrequency UDIV")
>
> availability = fixup_equation(mdapi_counter.get('AvailabilityEquation'))
> if availability == "":
>diff --git a/lib/xe/xe_oa.h b/lib/xe/xe_oa.h
>index c16177ec8e..f6f2768b00 100644
>--- a/lib/xe/xe_oa.h
>+++ b/lib/xe/xe_oa.h
>@@ -275,6 +275,7 @@ struct intel_xe_perf_metric_set {
> int b_offset;
> int c_offset;
> int perfcnt_offset;
>+ int pec_offset;
>
> const struct intel_xe_perf_register_prog *b_counter_regs;
> uint32_t n_b_counter_regs;
>--
>2.41.0
>
next prev parent reply other threads:[~2024-06-20 23:43 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 20:00 [PATCH v4 i-g-t 00/28] Intel Xe OA IGT's Ashutosh Dixit
2024-06-20 20:00 ` [PATCH i-g-t 01/28] lib/xe/oa: Import OA metric generation files from i915 Ashutosh Dixit
2024-06-20 21:54 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 02/28] lib/xe/oa: Add LNL metric guids Ashutosh Dixit
2024-06-20 21:54 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 03/28] lib/xe/oa: Add OA LNL metrics (oa_lnl.xml) Ashutosh Dixit
2024-06-20 21:55 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 04/28] lib/xe/oa: Add truncated legacy Xe1 metrics XML's Ashutosh Dixit
2024-06-20 21:57 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 05/28] lib/xe/oa: Generate LNL metrics/registers files Ashutosh Dixit
2024-06-20 21:52 ` Umesh Nerlige Ramappa
2024-06-20 23:05 ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 06/28] lib/xe/oa: Switch generated files to Xe namespace Ashutosh Dixit
2024-06-20 23:24 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 07/28] drm-uapi/xe: Sync with Perf/OA changes Ashutosh Dixit
2024-06-20 23:24 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 08/28] lib/xe: Complete xe_oa lib functionality Ashutosh Dixit
2024-06-20 23:24 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 09/28] tests/intel/xe_query: Add OA units query test Ashutosh Dixit
2024-06-20 23:25 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 10/28] tests/intel/xe_oa: Add first tests Ashutosh Dixit
2024-06-20 23:11 ` Umesh Nerlige Ramappa
2024-06-30 22:42 ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 11/28] tests/intel/xe_oa: Add some negative tests Ashutosh Dixit
2024-06-20 23:12 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 12/28] tests/intel/xe_oa: Add "oa-formats" subtest Ashutosh Dixit
2024-06-20 23:15 ` Umesh Nerlige Ramappa
2024-06-30 22:43 ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 13/28] tests/intel/xe_oa: Add oa exponent tests Ashutosh Dixit
2024-06-20 23:18 ` Umesh Nerlige Ramappa
2024-06-30 22:43 ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 14/28] tests/intel/xe_oa: buffer-fill, non-zero-reason, enable-disable Ashutosh Dixit
2024-06-20 23:19 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 15/28] tests/intel/xe_oa: blocking and polling tests Ashutosh Dixit
2024-06-20 23:20 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 16/28] tests/intel/xe_oa: OAR/OAC tests Ashutosh Dixit
2024-06-20 23:46 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 17/28] tests/intel/xe_oa: Exclusive/concurrent access, rc6 and stress open close Ashutosh Dixit
2024-06-20 23:37 ` Umesh Nerlige Ramappa
2024-06-30 22:43 ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 18/28] tests/intel/xe_oa: add remove OA config tests Ashutosh Dixit
2024-06-20 23:38 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 19/28] tests/intel/xe_oa: OA buffer mmap tests Ashutosh Dixit
2024-06-20 23:39 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 20/28] tests/intel/xe_oa: Register whitelisting and MMIO trigger tests Ashutosh Dixit
2024-06-20 23:39 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 21/28] lib/xe/oa: Add xe_oa_data_reader to IGT lib Ashutosh Dixit
2024-06-20 23:40 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 22/28] tools/xe-perf: Add xe_perf_recorder Ashutosh Dixit
2024-06-20 23:41 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 23/28] tools/xe-perf: xe_perf_reader, xe_perf_control and xe_perf_configs Ashutosh Dixit
2024-06-20 23:41 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 24/28] xe/oa: Fix invalid escape warnings Ashutosh Dixit
2024-06-20 23:43 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 25/28] xe/oa/mdapi-xml-convert: Add support for 576B_PEC64LL format Ashutosh Dixit
2024-06-20 23:43 ` Umesh Nerlige Ramappa [this message]
2024-06-20 20:00 ` [PATCH i-g-t 26/28] xe/oa: Regenerate oa-lnl.xml now parsing all counters Ashutosh Dixit
2024-06-20 23:43 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 27/28] xe/oa/oa-metricset-codegen: Fix XE_OA_FORMAT_PEC64u64 offsets Ashutosh Dixit
2024-06-20 23:44 ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 28/28] HAX: Add Xe OA tests to xe-fast-feedback.testlist Ashutosh Dixit
2024-06-20 23:45 ` Umesh Nerlige Ramappa
2024-06-30 22:43 ` Dixit, Ashutosh
2024-06-20 20:19 ` ✗ GitLab.Pipeline: warning for Intel Xe OA IGT's (rev4) Patchwork
2024-06-20 20:36 ` ✓ CI.xeBAT: success " Patchwork
2024-06-20 20:43 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-20 23:01 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-21 5:51 ` ✗ Fi.CI.IGT: " 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=ZnS+p0LW5Yc5pIDl@orsosgc001 \
--to=umesh.nerlige.ramappa@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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