Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
	<lucas.demarchi@intel.com>, <vinay.belgaumkar@intel.com>,
	<ashutosh.dixit@intel.com>, <john.c.harrison@intel.com>,
	<rodrigo.vivi@intel.com>, <aravind.iddamsetty@intel.com>,
	<soham.purkait@intel.com>
Subject: Re: [PATCH v3 07/10] drm/xe/trace: Add trace for engine activity
Date: Thu, 16 Jan 2025 15:08:11 -0800	[thread overview]
Message-ID: <Z4mRWwviAdl0NxPn@orsosgc001> (raw)
In-Reply-To: <20250106075600.852080-8-riana.tauro@intel.com>

On Mon, Jan 06, 2025 at 01:25:56PM +0530, Riana Tauro wrote:
>Add engine activity related information to trace events for
>better debuggability
>
>v2: add trace for engine activity (Umesh)
>
>Signed-off-by: Riana Tauro <riana.tauro@intel.com>

LGTM,

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>

>---
> drivers/gpu/drm/xe/xe_guc_engine_activity.c |  5 +++
> drivers/gpu/drm/xe/xe_trace_guc.h           | 49 +++++++++++++++++++++
> 2 files changed, 54 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.c b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>index 687d90873e97..14950b42d1b1 100644
>--- a/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>+++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>@@ -15,6 +15,7 @@
> #include "xe_hw_engine.h"
> #include "xe_map.h"
> #include "xe_mmio.h"
>+#include "xe_trace_guc.h"
>
> #define TOTAL_QUANTA 0x8000
>
>@@ -165,6 +166,8 @@ static u64 get_engine_active_ticks(struct xe_guc *guc, struct xe_hw_engine *hwe)
> 		}
> 	}
>
>+	trace_xe_guc_engine_activity(xe, ea, hwe->name, hwe->instance);
>+
> 	return ea->total + ea->active;
> }
>
>@@ -198,6 +201,8 @@ static u64 get_engine_total_ticks(struct xe_guc *guc, struct xe_hw_engine *hwe)
> 	ea->quanta_remainder_ns = numerator % TOTAL_QUANTA;
> 	ea->quanta = cpu_ns_to_guc_tsc_tick(ea->quanta_ns, cached_metadata->guc_tsc_frequency_hz);
>
>+	trace_xe_guc_engine_activity(xe, ea, hwe->name, hwe->instance);
>+
> 	return ea->quanta;
> }
>
>diff --git a/drivers/gpu/drm/xe/xe_trace_guc.h b/drivers/gpu/drm/xe/xe_trace_guc.h
>index 23abdd55dc62..156d429d7e79 100644
>--- a/drivers/gpu/drm/xe/xe_trace_guc.h
>+++ b/drivers/gpu/drm/xe/xe_trace_guc.h
>@@ -14,6 +14,7 @@
>
> #include "xe_device_types.h"
> #include "xe_guc_exec_queue_types.h"
>+#include "xe_guc_engine_activity_types.h"
>
> #define __dev_name_xe(xe)	dev_name((xe)->drm.dev)
>
>@@ -100,6 +101,54 @@ DEFINE_EVENT_PRINT(xe_guc_ctb, xe_guc_ctb_g2h,
>
> );
>
>+TRACE_EVENT(xe_guc_engine_activity,
>+	    TP_PROTO(struct xe_device *xe, struct engine_activity *ea, const char *name,
>+		     u16 instance),
>+	    TP_ARGS(xe, ea, name, instance),
>+
>+	    TP_STRUCT__entry(
>+			__string(dev, __dev_name_xe(xe))
>+			__string(name, name)
>+			__field(u32, global_change_num)
>+			__field(u32, guc_tsc_frequency_hz)
>+			__field(u32, lag_latency_usec)
>+			__field(u16, instance)
>+			__field(u16, change_num)
>+			__field(u16, quanta_ratio)
>+			__field(u32, last_update_tick)
>+			__field(u64, active_ticks)
>+			__field(u64, active)
>+			__field(u64, total)
>+			__field(u64, quanta)
>+			__field(u64, last_cpu_ts)
>+	    ),
>+
>+	    TP_fast_assign(
>+			__assign_str(dev);
>+			__assign_str(name);
>+			__entry->global_change_num = ea->metadata.global_change_num;
>+			__entry->guc_tsc_frequency_hz = ea->metadata.guc_tsc_frequency_hz;
>+			__entry->lag_latency_usec = ea->metadata.lag_latency_usec;
>+			__entry->instance = instance;
>+			__entry->change_num = ea->activity.change_num;
>+			__entry->quanta_ratio = ea->activity.quanta_ratio;
>+			__entry->last_update_tick = ea->activity.last_update_tick;
>+			__entry->active_ticks = ea->activity.active_ticks;
>+			__entry->active = ea->active;
>+			__entry->total = ea->total;
>+			__entry->quanta = ea->quanta;
>+			__entry->last_cpu_ts = ea->last_cpu_ts;
>+	    ),
>+
>+	    TP_printk("dev=%s engine %s:%d Active=%llu, quanta=%llu, last_cpu_ts=%llu\n"
>+		      "Activity metadata: global_change_num=%u, guc_tsc_frequency_hz=%u lag_latency_usec=%u\n"
>+		      "Activity data: change_num=%u, quanta_ratio=%u, last_update_tick=%u, active_ticks=%llu\n",
>+		      __get_str(dev), __get_str(name), __entry->instance,
>+		      (__entry->active +  __entry->total), __entry->quanta, __entry->last_cpu_ts,
>+		      __entry->global_change_num, __entry->guc_tsc_frequency_hz,
>+		      __entry->lag_latency_usec, __entry->change_num, __entry->quanta_ratio,
>+		      __entry->last_update_tick, __entry->active_ticks)
>+);
> #endif
>
> /* This part must be outside protection */
>-- 
>2.47.1
>

  reply	other threads:[~2025-01-16 23:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06  7:55 [PATCH v3 00/10] PMU Support for per-engine-class activity Riana Tauro
2025-01-06  7:55 ` [PATCH v3 01/10] [DO NOT REVIEW] drm/xe/pmu: Enable PMU interface Riana Tauro
2025-01-06  7:55 ` [PATCH v3 02/10] [DO NOT REVIEW] drm/xe: Add locks in gtidle code Riana Tauro
2025-01-06  7:55 ` [PATCH v3 03/10] [DO NOT REVIEW] drm/xe/pmu: Add GT C6 events Riana Tauro
2025-01-06  7:55 ` [PATCH v3 04/10] [DO NOT REVIEW] drm/xe/pmu: Add GT frequency events Riana Tauro
2025-01-06  7:55 ` [PATCH v3 05/10] [DO NOT REVIEW] drm/xe/xe_pmu: add fixes for base PMU Riana Tauro
2025-01-06  7:55 ` [PATCH v3 06/10] drm/xe: Add per-engine-class activity support Riana Tauro
2025-01-06  7:55 ` [PATCH v3 07/10] drm/xe/trace: Add trace for engine activity Riana Tauro
2025-01-16 23:08   ` Umesh Nerlige Ramappa [this message]
2025-01-06  7:55 ` [PATCH v3 08/10] drm/xe/guc: Expose engine activity only for supported GuC version Riana Tauro
2025-01-16 23:10   ` Umesh Nerlige Ramappa
2025-01-27 10:05     ` Riana Tauro
2025-01-06  7:55 ` [PATCH v3 09/10] drm/xe/pmu: Add PMU support for per-engine-class activity Riana Tauro
2025-01-14  0:57   ` Umesh Nerlige Ramappa
2025-01-17  1:18   ` Umesh Nerlige Ramappa
2025-01-17 13:26     ` Riana Tauro
2025-01-06  7:55 ` [PATCH v3 10/10] drm/xe/guc: Bump minimum required GuC version to v70.36.0 Riana Tauro
2025-01-06  8:28 ` ✓ CI.Patch_applied: success for PMU Support for per-engine-class activity Patchwork
2025-01-06  8:29 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-06  8:30 ` ✓ CI.KUnit: success " Patchwork
2025-01-06  8:48 ` ✓ CI.Build: " Patchwork
2025-01-06  8:50 ` ✗ CI.Hooks: failure " Patchwork
2025-01-06  8:52 ` ✓ CI.checksparse: success " Patchwork
2025-01-06  9:18 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-06 17:10 ` ✗ Xe.CI.Full: 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=Z4mRWwviAdl0NxPn@orsosgc001 \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=john.c.harrison@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=soham.purkait@intel.com \
    --cc=vinay.belgaumkar@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