Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH 1/2] drm/xe: Introduce GT oriented log messages
@ 2023-03-13  8:03 Michal Wajdeczko
  2023-03-13  8:03 ` [Intel-xe] [PATCH 2/2] drm/xe: Use GT oriented log messages in xe_gt.c Michal Wajdeczko
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Michal Wajdeczko @ 2023-03-13  8:03 UTC (permalink / raw)
  To: intel-xe

While debugging GT related problems, it's good to know which GT was
reporting problems. Introduce helper macros to allow prefix GT logs
with GT idetifier. We will use them in upcoming patches.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_printk.h | 45 +++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/xe_gt_printk.h

diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
new file mode 100644
index 000000000000..b12a92024126
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_gt_printk.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _XE_GT_PRINTK_H_
+#define _XE_GT_PRINTK_H_
+
+#include <drm/drm_print.h>
+#include "xe_gt_types.h"
+
+#define gt_printk(_gt, _level, _fmt, ...) \
+	drm_##_level(&(_gt)->xe->drm, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_err(_gt, _fmt, ...) \
+	gt_printk((_gt), err, _fmt, ##__VA_ARGS__)
+
+#define gt_warn(_gt, _fmt, ...) \
+	gt_printk((_gt), warn, _fmt, ##__VA_ARGS__)
+
+#define gt_notice(_gt, _fmt, ...) \
+	gt_printk((_gt), notice, _fmt, ##__VA_ARGS__)
+
+#define gt_info(_gt, _fmt, ...) \
+	gt_printk((_gt), info, _fmt, ##__VA_ARGS__)
+
+#define gt_dbg(_gt, _fmt, ...) \
+	gt_printk((_gt), dbg, _fmt, ##__VA_ARGS__)
+
+#define gt_err_ratelimited(_gt, _fmt, ...) \
+	gt_printk((_gt), err_ratelimited, _fmt, ##__VA_ARGS__)
+
+#define gt_WARN(_gt, _condition, _fmt, ...) \
+	drm_WARN(&(_gt)->xe->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_WARN_ONCE(_gt, _condition, _fmt, ...) \
+	drm_WARN_ONCE(&(_gt)->xe->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_WARN_ON(_gt, _condition) \
+	gt_WARN((_gt), _condition, "%s(%s)", "gt_WARN_ON", __stringify(_condition))
+
+#define gt_WARN_ON_ONCE(_gt, _condition) \
+	gt_WARN_ONCE((_gt), _condition, "%s(%s)", "gt_WARN_ON_ONCE", __stringify(_condition))
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [Intel-xe] [PATCH 1/2] drm/xe: Introduce GT oriented log messages
@ 2023-03-12 19:14 Michal Wajdeczko
  2023-03-24 18:36 ` Rodrigo Vivi
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Wajdeczko @ 2023-03-12 19:14 UTC (permalink / raw)
  To: intel-xe

While debugging GT related problems, it's good to know which GT was
reporting problems. Introduce helper macros to allow prefix GT logs
with GT idetifier. We will use them in upcoming patches.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_printk.h | 45 +++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/xe_gt_printk.h

diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
new file mode 100644
index 000000000000..b12a92024126
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_gt_printk.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _XE_GT_PRINTK_H_
+#define _XE_GT_PRINTK_H_
+
+#include <drm/drm_print.h>
+#include "xe_gt_types.h"
+
+#define gt_printk(_gt, _level, _fmt, ...) \
+	drm_##_level(&(_gt)->xe->drm, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_err(_gt, _fmt, ...) \
+	gt_printk((_gt), err, _fmt, ##__VA_ARGS__)
+
+#define gt_warn(_gt, _fmt, ...) \
+	gt_printk((_gt), warn, _fmt, ##__VA_ARGS__)
+
+#define gt_notice(_gt, _fmt, ...) \
+	gt_printk((_gt), notice, _fmt, ##__VA_ARGS__)
+
+#define gt_info(_gt, _fmt, ...) \
+	gt_printk((_gt), info, _fmt, ##__VA_ARGS__)
+
+#define gt_dbg(_gt, _fmt, ...) \
+	gt_printk((_gt), dbg, _fmt, ##__VA_ARGS__)
+
+#define gt_err_ratelimited(_gt, _fmt, ...) \
+	gt_printk((_gt), err_ratelimited, _fmt, ##__VA_ARGS__)
+
+#define gt_WARN(_gt, _condition, _fmt, ...) \
+	drm_WARN(&(_gt)->xe->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_WARN_ONCE(_gt, _condition, _fmt, ...) \
+	drm_WARN_ONCE(&(_gt)->xe->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
+
+#define gt_WARN_ON(_gt, _condition) \
+	gt_WARN((_gt), _condition, "%s(%s)", "gt_WARN_ON", __stringify(_condition))
+
+#define gt_WARN_ON_ONCE(_gt, _condition) \
+	gt_WARN_ONCE((_gt), _condition, "%s(%s)", "gt_WARN_ON_ONCE", __stringify(_condition))
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-04-03  8:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-13  8:03 [Intel-xe] [PATCH 1/2] drm/xe: Introduce GT oriented log messages Michal Wajdeczko
2023-03-13  8:03 ` [Intel-xe] [PATCH 2/2] drm/xe: Use GT oriented log messages in xe_gt.c Michal Wajdeczko
2023-03-13 16:51 ` [Intel-xe] [PATCH 1/2] drm/xe: Introduce GT oriented log messages Lucas De Marchi
2023-03-13 20:01   ` Jani Nikula
2023-03-13 18:32 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [1/2] " Patchwork
2023-03-13 18:33 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-03-13 18:36 ` [Intel-xe] ✓ CI.Build: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-03-12 19:14 [Intel-xe] [PATCH 1/2] " Michal Wajdeczko
2023-03-24 18:36 ` Rodrigo Vivi
2023-04-03  8:02   ` Michal Wajdeczko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox