All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: akash.goel@intel.com, Johannes Berg <johannes.berg@intel.com>
Cc: intel-gfx@lists.freedesktop.org, sourab.gupta@intel.com
Subject: Re: [RFC 00/12] Support for sustained capturing of GuC firmware logs
Date: Thu, 2 Jun 2016 12:16:18 +0200	[thread overview]
Message-ID: <20160602101618.GE7231@phenom.ffwll.local> (raw)
In-Reply-To: <1464378183-9433-1-git-send-email-akash.goel@intel.com>

On Sat, May 28, 2016 at 01:12:51AM +0530, akash.goel@intel.com wrote:
> From: Akash Goel <akash.goel@intel.com>
> 
> GuC firmware log its debug messages into a Host-GuC shared memory buffer
> and when the buffer is half full it sends a Flush interrupt to Host.
> GuC firmware expects that while it is writing to 2nd half of the buffer,
> first half would get consumed by Host and then get a flush completed
> acknowledgement from Host, so that it does not end up doing any overwrite
> causing loss of logs.
> So far Flush interrupt wasn't enabled on Host side & User could capture the
> contents/snapshot of log buffer through 'i915_guc_log_dump' debugfs iface.
> But this couldn't meet couple of key requirements, especially of Validation,
> first is to ensure capturing of all boot time logs even with high verbosity
> level and second is to enable capturing of logs in a sustained manner like
> for the entire duration of a workload.
> Now Driver will enable Flush interrupt and on receving it, would copy the
> contents of log buffer into its local buffer. The size of local buffer would
> be big enough to contain multiple snapshots of the log buffer giving ample
> time to User to pull boot time messages. Also reads from User space will be
> blocked if there isn't any data left in the local buffer until another
> Flush interrupt is received and new logs are copied into the local buffer,
> enabling capturing of logs in a streaming manner.
> 
> Have added 3 interfaces for capturing logs.
> Patch 5 & 6 avails relay framework to store logs and export that to User,
> in which Driver just needs to use a relay API to copy logs into the relay
> buffer and behavior is equivalent to 'dmesg -c'. But there are certain
> requirements with relay which in most likelihood can be met only for a
> debugfs file. But since debugfs may not be always available in production
> kernels, added support for other interfaces as a fall back, where Driver
> only will have to do allocation/mapping of local buffer pages, handle file
> read calls, read/write pointer management, overflow handling etc.
> One is a sysfs interface '/sys/class/drm/card0/guc_log', which is generally
> the preferred location. This mimics '/proc/kmsg' behavior, so meets the
> streaming requirement but at a time only single client can pull the logs
> in a consistent manner.
> Other is a character device file interface '/dev/dri/guc_log', this mimics
> '/dev/kmsg' behavior, so can meet the streaming requirement and also allow
> multiple clients to consume logs at the same time.
> Based on the comments and considering the relative merits, can decide which
> interface to actually use.

I still kinda like relayfs, except that it's not available in non-debug
builds. But so are plenty of other really interesting files we have hidden
in there.

sysfs isn't the solution, I already have a black eye from the sysfs
maintainer for our error state.

char dev feels like it's bad at discoverability, no one would guess you
can just cat it. Also, the relationship between driver instance and
chardev logging is a bit messy.

No idea really where to put stuff. One option might be to have an official
debug directory (like we have power already) in sysfs as the canonical
place where drivers can dump stuff. We're not the only ones with too much
data to get to userspace for debugging driver/hw issues, e.g. wireless
firmware has pretty similar solutions.

Adding Johannes, he's worked on something like this for the intel wireless
drivers iirc.

Cheers, Daniel

> 
> Akash Goel (7):
>   drm/i915: Add a relay backed debugfs interface for capturing GuC logs
>   drm/i915: Store GuC ukernel logs in the relay buffer
>   drm/i915: Allocate local buffer to store GuC ukernel logs
>   drm/i915: Store GuC ukernel logs in the local buffer
>   drm/i915: Add a char device file interface to capture GuC ukernel logs
>   drm/i915: Support to capture GuC logs by multiple clients via device
>     file iface
>   drm/i915: Add sysfs interface to capture the GuC ukernel logs
> 
> Sagar Arun Kamble (5):
>   drm/i915: Decouple GuC log setup from verbosity parameter
>   drm/i915: Add GuC ukernel logging related fields to fw interface file
>   drm/i915: Support for GuC interrupts
>   drm/i915: Handle log buffer flush interrupt event from GuC
>   drm/i915: Forcefully flush GuC log buffer on reset
> 
>  drivers/gpu/drm/i915/i915_drv.h            |   1 +
>  drivers/gpu/drm/i915/i915_guc_submission.c | 483 ++++++++++++++++++++++++++++-
>  drivers/gpu/drm/i915/i915_irq.c            | 120 ++++++-
>  drivers/gpu/drm/i915/i915_reg.h            |  11 +
>  drivers/gpu/drm/i915/i915_sysfs.c          |  40 +++
>  drivers/gpu/drm/i915/intel_drv.h           |   3 +
>  drivers/gpu/drm/i915/intel_guc.h           |  30 ++
>  drivers/gpu/drm/i915/intel_guc_fwif.h      |  42 +++
>  drivers/gpu/drm/i915/intel_guc_loader.c    |   9 +-
>  9 files changed, 730 insertions(+), 9 deletions(-)
> 
> -- 
> 1.9.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-02 10:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 19:42 [RFC 00/12] Support for sustained capturing of GuC firmware logs akash.goel
2016-05-27 19:42 ` [RFC 01/12] drm/i915: Decouple GuC log setup from verbosity parameter akash.goel
2016-05-27 19:42 ` [RFC 02/12] drm/i915: Add GuC ukernel logging related fields to fw interface file akash.goel
2016-05-27 19:42 ` [RFC 03/12] drm/i915: Support for GuC interrupts akash.goel
2016-05-27 19:43   ` Chris Wilson
2016-05-28  8:46     ` Goel, Akash
2016-05-27 19:56   ` Chris Wilson
2016-05-28  9:22     ` Goel, Akash
2016-05-28 12:13       ` Chris Wilson
2016-05-28 13:45         ` Goel, Akash
2016-05-28 14:35           ` Chris Wilson
2016-05-28 17:33             ` Goel, Akash
2016-05-27 19:42 ` [RFC 04/12] drm/i915: Handle log buffer flush interrupt event from GuC akash.goel
2016-05-27 19:42 ` [RFC 05/12] drm/i915: Add a relay backed debugfs interface for capturing GuC logs akash.goel
2016-05-27 19:42 ` [RFC 06/12] drm/i915: Store GuC ukernel logs in the relay buffer akash.goel
2016-05-27 19:42 ` [RFC 07/12] drm/i915: Allocate local buffer to store GuC ukernel logs akash.goel
2016-05-27 19:42 ` [RFC 08/12] drm/i915: Store GuC ukernel logs in the local buffer akash.goel
2016-05-27 19:43 ` [RFC 09/12] drm/i915: Add a char device file interface to capture GuC ukernel logs akash.goel
2016-05-27 19:48   ` Chris Wilson
2016-05-28  8:51     ` Goel, Akash
2016-05-27 19:43 ` [RFC 10/12] drm/i915: Support to capture GuC logs by multiple clients via device file iface akash.goel
2016-05-27 19:43 ` [RFC 11/12] drm/i915: Add sysfs interface to capture the GuC ukernel logs akash.goel
2016-05-27 19:43 ` [RFC 12/12] drm/i915: Forcefully flush GuC log buffer on reset akash.goel
2016-05-28  6:09 ` ✗ Ro.CI.BAT: failure for Support for sustained capturing of GuC firmware logs Patchwork
2016-06-02 10:16 ` Daniel Vetter [this message]
2016-06-02 10:21   ` [RFC 00/12] " Johannes Berg
2016-06-03  7:15     ` Daniel Vetter
2016-06-03 10:14       ` Goel, Akash
2016-06-03 10:20         ` Chris Wilson
2016-06-08  8:30           ` Daniel Vetter

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=20160602101618.GE7231@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=akash.goel@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=johannes.berg@intel.com \
    --cc=sourab.gupta@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.