All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	John.C.Harrison@Intel.com, Intel-GFX@Lists.FreeDesktop.Org
Cc: DRI-Devel@Lists.FreeDesktop.Org
Subject: Re: [Intel-gfx] [PATCH v2 0/5] Add module oriented dmesg output
Date: Tue, 22 Nov 2022 20:21:45 +0200	[thread overview]
Message-ID: <87y1s2x32e.fsf@intel.com> (raw)
In-Reply-To: <3b7ef198-7aba-8948-6332-9a57d8ee0fb6@intel.com>

On Tue, 22 Nov 2022, Michal Wajdeczko <michal.wajdeczko@intel.com> wrote:
> On 18.11.2022 11:52, Jani Nikula wrote:
>> On Thu, 17 Nov 2022, John.C.Harrison@Intel.com wrote:
>>> From: John Harrison <John.C.Harrison@Intel.com>
>>>
>>> When trying to analyse bug reports from CI, customers, etc. it can be
>>> difficult to work out exactly what is happening on which GT in a
>>> multi-GT system. So add GT oriented debug/error message wrappers. If
>>> used instead of the drm_ equivalents, you get the same output but with
>>> a GT# prefix on it.
>>>
>>> It was also requested to extend this further to submodules in order to
>>> factor out the repeated structure accessing constructs and common
>>> string prefixes. So, add versions for GuC, HuC and GuC CTB as well.
>>>
>>> This patch set updates all the gt/uc files to use the new helpers as a
>>> first step. The intention would be to convert all output messages that
>>> have access to a GT structure.
>>>
>>> v2: Go back to using lower case names, add more wrapper sets (combined
>>> review feedback). Also, wrap up probe injection and WARN entries.
>>>
>>> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
>> 
>> For adding the wrappers in general, I'm going to disagree and
>> commit. I'll leave it up to Tvrtko and Joonas.
>> 
>> Regarding the placement of the macros, I insist you add individual
>> header files for the wrappers and include them only where needed.
>
> do you mean:
>
> 	intel_gt_print.h
> 	intel_guc_print.h
> 	intel_huc_print.h
>
> with just macros or also with all functions that work with drm_printer?

At least for the macros being added now. If adding others does not
require you to pull in a bunch of additional header dependencies, you
can add more. And that can be separate patches.

>
>> 
>> We have a fairly serious problem with everything including everything in
>> i915 that I've been slowly trying to tackle. Touch one thing, rebuild
>> everything. About a third of our headers cause the rebuild of the entire
>> driver when modified. We need to reduce the surface of things that cause
>> rebuilds.
>> 
>> For example, intel_gt.h is included by 97 files, intel_guc.h by 332
>> files, and intel_huc.h by 329 files (counting recursively).
>> 
>> There's absolutely no reason any of the display code, for example, needs
>> to have these logging macros in their build. Long term, the headers
>> should be reorganized to reduce the interdependencies, and this is what
>> I've been doing in i915_drv.h and display/ in general. But the least we
>> can do is not make the problem worse.
>
> to solve this we should really consider splitting out GuC and HuC
> definitions to dedicated _types.h files and only include them in
> i915_drv.h (and print macros are orthogonal for this problem)

It's an orthogonal problem, but IMO with the current headers there's no
reason to make the problem worse by adding somewhat independent new
stuff to the headers.

---

I've looked at untangling this a bunch of times, but I've always felt
that it's really not my area of expertise, and it would inevitably
conflict with someone else's work in progress and someone else's idea of
how the headers should be refactored.

There are chains like this:

i915_drv.h:47:#include "gt/intel_gt_types.h"
gt/intel_gt_types.h:19:#include "uc/intel_uc.h"
gt/uc/intel_uc.h:9:#include "intel_guc.h"
gt/uc/intel_guc.h:15:#include "intel_guc_fwif.h"
gt/uc/intel_guc_fwif.h:14:#include "abi/guc_actions_abi.h"
gt/uc/intel_guc_fwif.h:15:#include "abi/guc_actions_slpc_abi.h"
gt/uc/intel_guc_fwif.h:16:#include "abi/guc_errors_abi.h"
gt/uc/intel_guc_fwif.h:17:#include "abi/guc_communication_mmio_abi.h"
gt/uc/intel_guc_fwif.h:18:#include "abi/guc_communication_ctb_abi.h"
gt/uc/intel_guc_fwif.h:19:#include "abi/guc_klvs_abi.h"
gt/uc/intel_guc_fwif.h:20:#include "abi/guc_messages_abi.h"

They need to be broken up at some point. There are a bunch of headers
where only minimal amount of info is actually needed in other headers,
and the rest is used in a limited number of .c files only.

It's a lot of tedious work to refactor and nobody's going to notice the
impact directly, they'll just be less grumpy about the build being slow
and the organization of the headers being messy. And if they don't build
the driver a lot (like me) or don't refactor the driver a lot (like me)
maybe they'll never notice.


BR,
Jani.


>
> Michal
>
>> 
>> BR,
>> Jani.
>> 
>>>
>>>
>>> John Harrison (5):
>>>   drm/i915/gt: Start adding module oriented dmesg output
>>>   drm/i915/huc: Add HuC specific debug print wrappers
>>>   drm/i915/guc: Add GuC specific debug print wrappers
>>>   drm/i915/guc: Add GuC CT specific debug print wrappers
>>>   drm/i915/uc: Update the gt/uc code to use gt_err and friends
>>>
>>>  drivers/gpu/drm/i915/gt/intel_gt.c            |  96 ++++----
>>>  drivers/gpu/drm/i915/gt/intel_gt.h            |  35 +++
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc.c        |  32 +--
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  35 +++
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |   8 +-
>>>  .../gpu/drm/i915/gt/uc/intel_guc_capture.c    |  48 ++--
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     | 222 +++++++++---------
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c     |  19 +-
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |  37 ++-
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   7 +-
>>>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |  55 ++---
>>>  .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  62 +++--
>>>  drivers/gpu/drm/i915/gt/uc/intel_huc.c        |  31 +--
>>>  drivers/gpu/drm/i915/gt/uc/intel_huc.h        |  23 ++
>>>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         | 108 ++++-----
>>>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c      |  98 ++++----
>>>  drivers/gpu/drm/i915/gt/uc/selftest_guc.c     |  34 +--
>>>  .../drm/i915/gt/uc/selftest_guc_hangcheck.c   |  22 +-
>>>  .../drm/i915/gt/uc/selftest_guc_multi_lrc.c   |  10 +-
>>>  19 files changed, 507 insertions(+), 475 deletions(-)
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-11-22 18:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  1:58 [PATCH v2 0/5] Add module oriented dmesg output John.C.Harrison
2022-11-18  1:58 ` [Intel-gfx] " John.C.Harrison
2022-11-18  1:58 ` [PATCH v2 1/5] drm/i915/gt: Start adding " John.C.Harrison
2022-11-18  1:58   ` [Intel-gfx] " John.C.Harrison
2022-11-22 16:47   ` Michal Wajdeczko
2022-11-22 16:47     ` [Intel-gfx] " Michal Wajdeczko
2022-11-18  1:58 ` [PATCH v2 2/5] drm/i915/huc: Add HuC specific debug print wrappers John.C.Harrison
2022-11-18  1:58   ` [Intel-gfx] " John.C.Harrison
2022-11-22 17:17   ` Michal Wajdeczko
2022-11-22 17:17     ` [Intel-gfx] " Michal Wajdeczko
2022-11-18  1:58 ` [PATCH v2 3/5] drm/i915/guc: Add GuC " John.C.Harrison
2022-11-18  1:58   ` [Intel-gfx] " John.C.Harrison
2022-11-22 17:42   ` Michal Wajdeczko
2022-11-22 17:42     ` [Intel-gfx] " Michal Wajdeczko
2022-11-23  0:56     ` John Harrison
2022-11-23  0:56       ` [Intel-gfx] " John Harrison
2022-11-18  1:58 ` [PATCH v2 4/5] drm/i915/guc: Add GuC CT " John.C.Harrison
2022-11-18  1:58   ` [Intel-gfx] " John.C.Harrison
2022-11-22 17:54   ` Michal Wajdeczko
2022-11-23  1:25     ` John Harrison
2022-11-23 20:45       ` Michal Wajdeczko
2022-12-01  0:41         ` John Harrison
2022-12-01 11:56           ` Michal Wajdeczko
2022-12-01 12:01             ` Tvrtko Ursulin
2022-12-02 20:14               ` John Harrison
2022-12-05 13:16                 ` Tvrtko Ursulin
2022-12-05 18:44                   ` Michal Wajdeczko
2022-12-06 11:06                     ` Tvrtko Ursulin
2023-01-06 18:57                       ` John Harrison
2023-01-06 18:57                         ` John Harrison
2023-01-09  9:38                         ` Jani Nikula
2023-01-09  9:38                           ` Jani Nikula
2023-01-09 20:33                           ` John Harrison
2023-01-09 20:33                             ` John Harrison
2023-01-09  9:39                         ` Tvrtko Ursulin
2023-01-09  9:39                           ` Tvrtko Ursulin
2023-01-09 20:36                           ` John Harrison
2023-01-09 20:36                             ` John Harrison
2022-11-18  1:58 ` [PATCH v2 5/5] drm/i915/uc: Update the gt/uc code to use gt_err and friends John.C.Harrison
2022-11-18  1:58   ` [Intel-gfx] " John.C.Harrison
2022-11-18  2:24 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add module oriented dmesg output Patchwork
2022-11-18  2:24 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-18  2:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-18 10:52 ` [Intel-gfx] [PATCH v2 0/5] " Jani Nikula
2022-11-18 10:52   ` Jani Nikula
2022-11-21 18:21   ` John Harrison
2022-11-21 18:21     ` John Harrison
2022-11-22  8:14     ` Tvrtko Ursulin
2022-11-22 16:35   ` Michal Wajdeczko
2022-11-22 18:21     ` Jani Nikula [this message]
2022-11-18 19:37 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " 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=87y1s2x32e.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=DRI-Devel@Lists.FreeDesktop.Org \
    --cc=Intel-GFX@Lists.FreeDesktop.Org \
    --cc=John.C.Harrison@Intel.com \
    --cc=michal.wajdeczko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.