From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Tvrtko Ursulin <tursulin@ursulin.net>,
Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Skip logging impossible slices
Date: Wed, 21 Mar 2018 13:47:06 +0200 [thread overview]
Message-ID: <87a7v1k5vp.fsf@intel.com> (raw)
In-Reply-To: <152162976010.4865.2644648493606974765@mail.alporthouse.com>
On Wed, 21 Mar 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Chris Wilson (2018-03-21 10:41:37)
>> Quoting Tvrtko Ursulin (2018-03-21 10:32:28)
>> > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> >
>> > Log up to sseu->max_slices instead basing on ARRAY_SIZE since to avoid
>> > printing impossible and empty slices for a platform.
>> >
>> > Also compact slice total and slice mask into one log line.
>> >
>> > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> > Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> > ---
>> > drivers/gpu/drm/i915/intel_device_info.c | 8 ++++----
>> > 1 file changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
>> > index 4babfc6ee45b..68aa9746d0e1 100644
>> > --- a/drivers/gpu/drm/i915/intel_device_info.c
>> > +++ b/drivers/gpu/drm/i915/intel_device_info.c
>> > @@ -83,11 +83,11 @@ static void sseu_dump(const struct sseu_dev_info *sseu, struct drm_printer *p)
>> > {
>> > int s;
>> >
>> > - drm_printf(p, "slice mask: %04x\n", sseu->slice_mask);
>> > - drm_printf(p, "slice total: %u\n", hweight8(sseu->slice_mask));
>> > + drm_printf(p, "slice total: %u, mask=%04x\n",
>> > + hweight8(sseu->slice_mask), sseu->slice_mask);
>> > drm_printf(p, "subslice total: %u\n", sseu_subslice_total(sseu));
>> > - for (s = 0; s < ARRAY_SIZE(sseu->subslice_mask); s++) {
>> > - drm_printf(p, "slice%d %u subslices mask=%04x\n",
>> > + for (s = 0; s < sseu->max_slices; s++) {
>> > + drm_printf(p, "slice%d: %u subslices, mask=%04x\n",
>> > s, hweight8(sseu->subslice_mask[s]),
>> > sseu->subslice_mask[s]);
>>
>> Just idly testing the waters...
>>
>> In yaml, this would be
>> "<indent>- slice%d: { subslices: %u, mask: 0x%04x }\n"
>
> Or if we keep the node name the same for easier parsing:
>
> "<indent>- slice: { id:%u, subslices:%u, mask:0x%04x }\n"
I'm not against doing this, especially for gpu dumps.
Wouldn't json be easier to generate and parse? Or do you prefer the
slightly better human readability of yaml?
I think it would be pretty straighforward to write drm printer helpers
for printing valid json without having to actually manually print the
colons and braces etc. And the struct drm_printer could even have checks
for ensuring you don't burp verbatim stuff to a printer that's supposed
to be json.
Any considerations for the transition? Massive wholesale patch bomb
conversion? Yikes.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-03-21 11:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 10:32 [PATCH] drm/i915: Skip logging impossible slices Tvrtko Ursulin
2018-03-21 10:41 ` Chris Wilson
2018-03-21 10:56 ` Chris Wilson
2018-03-21 11:47 ` Jani Nikula [this message]
2018-03-21 11:54 ` Chris Wilson
2018-03-21 12:16 ` Jani Nikula
2018-03-23 12:29 ` Joonas Lahtinen
2018-03-23 12:38 ` Chris Wilson
2018-03-21 10:52 ` Lionel Landwerlin
2018-03-21 11:21 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-03-21 12:25 ` ✗ Fi.CI.IGT: warning " 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=87a7v1k5vp.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--cc=tursulin@ursulin.net \
/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