From: Jani Nikula <jani.nikula@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
John Harrison <john.c.harrison@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
"Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>,
Intel-GFX@Lists.FreeDesktop.Org
Cc: DRI-Devel@Lists.FreeDesktop.Org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/gt: Add GT oriented dmesg output
Date: Thu, 10 Nov 2022 12:33:24 +0200 [thread overview]
Message-ID: <87wn835caz.fsf@intel.com> (raw)
In-Reply-To: <02454937-4213-c558-590f-e1e7c83083e3@intel.com>
On Wed, 09 Nov 2022, Michal Wajdeczko <michal.wajdeczko@intel.com> wrote:
> Instead of merging this patch now, oriented on GT only, I would rather
> wait until we discuss and plan solution for the all sub-components.
>
> Once that's done (with agreement on naming and output) we can start
> converting exiting messages.
>
> My proposal would be:
> - use wrappers per component
> - use lower case names
> - don't add colon
>
> #define i915_xxx(_i915, _fmt, ...) \
> drm_xxx(&(_i915)->drm, _fmt, ##__VA_ARGS__)
>
> #define gt_xxx(_gt, _fmt, ...) \
> i915_xxx((_gt)->i915, "GT%u " _fmt, (_gt)->info.id, ..
>
> #define guc_xxx(_guc, _fmt, ...) \
> gt_xxx(guc_to_gt(_guc), "GuC " _fmt, ..
>
> #define ct_xxx(_ct, _fmt, ...) \
> guc_xxx(ct_to_guc(_ct), "CTB " _fmt, ..
>
> where
> xxx = { err, warn, notice, info, dbg }
>
> and then for calls like:
>
> i915_err(i915, "Foo failed (%pe)\n", ERR_PTR(err));
> gt_err(gt, "Foo failed (%pe)\n", ERR_PTR(err));
> guc_err(guc, "Foo failed (%pe)\n", ERR_PTR(err));
> ct_err(ct, "Foo failed (%pe)\n", ERR_PTR(err));
>
> the output would look like:
>
> [ ] i915 0000:00:02.0: [drm] *ERROR* Foo failed (-EIO)
> [ ] i915 0000:00:02.0: [drm] *ERROR* GT0 Foo failed (-EIO)
> [ ] i915 0000:00:02.0: [drm] *ERROR* GT0 GuC Foo failed (-EIO)
> [ ] i915 0000:00:02.0: [drm] *ERROR* GT0 GuC CTB Foo failed (-EIO)
>
> Would that work for all of you?
I think we borderline have too many wrappers already. I've basically
blocked the i915_* variants early on in favour of just using the drm_*
calls directly - which, themselves, are also wrappers on dev_*.
In general, there's aversion in the kernel to adding wrappers that hide
what's actually going on. WYSIWYG.
So I wasn't thrilled to see the GT_* wrappers either.
And indeed part of it is that anything you do sets an example for the
next developer coming along. You add wrappers for this, and sure enough
someone's going to cargo cult and add wrappers for some other
component. We didn't even have to merge this to see that idea pop up.
The thing with logging is that it's not just one wrapper. It's info,
notice, warn, err, multiplied by the "once" variants, with some
duplicated by the "ratelimited" variants. (And yeah, C sucks at this.)
Arguably the display code could use logging wrappers for connectors,
encoders and crtcs, too. Not just i915, but across drm. See:
git grep "\[\(CONNECTOR\|ENCODER\|CRTC\)"
But we've opted not to.
This is just my educated guess, but what I think is more likely to
happen is adding a "debug name" member to the relevant structs that you
could use like:
drm_dbg_kms(connector->dev, "%s foo\n", connector->dbg_id);
---
I'm not going to block this patchset, but I also really *really* don't
want to see a cargo culted copy of this for other components. Which kind
of makes me anxious.
So what if you looked again what you could do to make using the drm_*
logging variants easier?
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-11-10 10:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 17:25 [Intel-gfx] [PATCH 0/2] Add GT oriented dmesg output John.C.Harrison
2022-11-04 17:25 ` [Intel-gfx] [PATCH 1/2] drm/i915/gt: " John.C.Harrison
2022-11-05 1:03 ` Ceraolo Spurio, Daniele
2022-11-07 9:33 ` Tvrtko Ursulin
2022-11-07 16:17 ` Tvrtko Ursulin
2022-11-07 19:14 ` John Harrison
2022-11-08 9:01 ` Tvrtko Ursulin
2022-11-08 20:15 ` John Harrison
2022-11-09 11:05 ` Tvrtko Ursulin
2022-11-09 17:46 ` John Harrison
2022-11-09 19:57 ` Michal Wajdeczko
2022-11-10 9:55 ` Tvrtko Ursulin
2022-11-10 10:35 ` Michal Wajdeczko
2022-11-15 10:23 ` Tvrtko Ursulin
2022-11-10 10:33 ` Jani Nikula [this message]
2022-11-14 22:10 ` John Harrison
2022-11-10 9:43 ` Tvrtko Ursulin
2022-11-14 22:14 ` John Harrison
2022-11-04 17:25 ` [Intel-gfx] [PATCH 2/2] drm/i915/uc: Update the gt/uc code to use GT_ERR and friends John.C.Harrison
2022-11-04 17:47 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add GT oriented dmesg output Patchwork
2022-11-04 18:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-05 9:24 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=87wn835caz.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=DRI-Devel@Lists.FreeDesktop.Org \
--cc=Intel-GFX@Lists.FreeDesktop.Org \
--cc=daniele.ceraolospurio@intel.com \
--cc=john.c.harrison@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tvrtko.ursulin@linux.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