Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 2/5] drm/xe: Introduce SR-IOV logging macros
Date: Tue, 28 Nov 2023 16:15:04 +0100	[thread overview]
Message-ID: <20231128151507.1015-3-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20231128151507.1015-1-michal.wajdeczko@intel.com>

To simplify logging and help identify SR-IOV specific messages
define set of helper macros that will prefix messages based on
the current SR-IOV mode.

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

diff --git a/drivers/gpu/drm/xe/xe_sriov_printk.h b/drivers/gpu/drm/xe/xe_sriov_printk.h
new file mode 100644
index 000000000000..117e1d541692
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sriov_printk.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _XE_SRIOV_PRINTK_H_
+#define _XE_SRIOV_PRINTK_H_
+
+#include <drm/drm_print.h>
+
+#include "xe_device_types.h"
+#include "xe_sriov_types.h"
+
+#define xe_sriov_printk_prefix(xe) \
+	((xe)->sriov.__mode == XE_SRIOV_MODE_PF ? "PF: " : \
+	 (xe)->sriov.__mode == XE_SRIOV_MODE_VF ? "VF: " : "")
+
+#define xe_sriov_printk(xe, _level, fmt, ...) \
+	drm_##_level(&(xe)->drm, "%s" fmt, xe_sriov_printk_prefix(xe), ##__VA_ARGS__)
+
+#define xe_sriov_err(xe, fmt, ...) \
+	xe_sriov_printk((xe), err, fmt, ##__VA_ARGS__)
+
+#define xe_sriov_err_ratelimited(xe, fmt, ...) \
+	xe_sriov_printk((xe), err_ratelimited, fmt, ##__VA_ARGS__)
+
+#define xe_sriov_warn(xe, fmt, ...) \
+	xe_sriov_printk((xe), warn, fmt, ##__VA_ARGS__)
+
+#define xe_sriov_notice(xe, fmt, ...) \
+	xe_sriov_printk((xe), notice, fmt, ##__VA_ARGS__)
+
+#define xe_sriov_info(xe, fmt, ...) \
+	xe_sriov_printk((xe), info, fmt, ##__VA_ARGS__)
+
+#define xe_sriov_dbg(xe, fmt, ...) \
+	xe_sriov_printk((xe), dbg, fmt, ##__VA_ARGS__)
+
+/* for low level noisy debug messages */
+#ifdef CONFIG_DRM_XE_DEBUG_SRIOV
+#define xe_sriov_dbg_verbose(xe, fmt, ...) xe_sriov_dbg(xe, fmt, ##__VA_ARGS__)
+#else
+#define xe_sriov_dbg_verbose(xe, fmt, ...) typecheck(struct xe_device *, (xe))
+#endif
+
+#endif
-- 
2.25.1


  parent reply	other threads:[~2023-11-28 15:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 15:15 [Intel-xe] [PATCH 0/5] Introduce Local Memory Translation Table Michal Wajdeczko
2023-11-28 15:15 ` [Intel-xe] [PATCH 1/5] drm/xe: Define DRM_XE_DEBUG_SRIOV config Michal Wajdeczko
2023-12-07 14:17   ` Lucas De Marchi
2023-11-28 15:15 ` Michal Wajdeczko [this message]
2023-12-07 14:17   ` [Intel-xe] [PATCH 2/5] drm/xe: Introduce SR-IOV logging macros Lucas De Marchi
2023-11-28 15:15 ` [Intel-xe] [PATCH 3/5] drm/xe/pf: Introduce Local Memory Translation Table Michal Wajdeczko
2023-12-07  0:43   ` Michał Winiarski
2023-12-07 14:55     ` Michal Wajdeczko
2023-11-28 15:15 ` [Intel-xe] [PATCH 4/5] drm/xe/kunit: Enable CONFIG_PCI_IOV in .kunitconfig Michal Wajdeczko
2023-12-07  0:24   ` Michał Winiarski
2023-11-28 15:15 ` [Intel-xe] [PATCH 5/5] drm/xe/kunit: Add test for LMTT operations Michal Wajdeczko
2023-12-07  0:23   ` Michał Winiarski
2023-11-28 16:30 ` [Intel-xe] ✓ CI.Patch_applied: success for Introduce Local Memory Translation Table Patchwork
2023-11-28 16:30 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-11-28 16:31 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-11-28 16:39 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-11-28 16:39 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-11-28 16:41 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
2023-11-28 17:14 ` [Intel-xe] ✓ CI.BAT: " Patchwork
2023-12-11 21:21 ` [Intel-xe] [PATCH 0/5] " Rodrigo Vivi

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=20231128151507.1015-3-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@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