Re: [PATCH 03/15] drm/i915: Framework for capturing command stream based OA reports

sourab gupta
2016-06-02T06:26:13Z

On Thu, 2016-06-02 at 11:30 +0530, Martin Peres wrote:
> On 02/06/16 08:18, sourab.gupta@intel.com wrote:
> > From: Sourab Gupta <sourab.gupta@intel.com>
> >
> > This patch introduces a framework to enable OA counter reports associated
> > with Render command stream. We can then associate the reports captured
> > through this mechanism with their corresponding context id's. This can be
> > further extended to associate any other metadata information with the
> > corresponding samples (since the association with Render command stream
> > gives us the ability to capture these information while inserting the
> > corresponding capture commands into the command stream).
> >
> > The OA reports generated in this way are associated with a corresponding
> > workload, and thus can be used the delimit the workload (i.e. sample the
> > counters at the workload boundaries), within an ongoing stream of periodic
> > counter snapshots.
> >
> > There may be usecases wherein we need more than periodic OA capture mode
> > which is supported currently. This mode is primarily used for two usecases:
> > - Ability to capture system wide metrics, alongwith the ability to map
> > the reports back to individual contexts (particularly for HSW).
> > - Ability to inject tags for work, into the reports. This provides
> > visibility into the multiple stages of work within single context.
> >
> > The userspace will be able to distinguish between the periodic and CS based
> > OA reports by the virtue of source_info sample field.
> >
> > The command MI_REPORT_PERF_COUNT can be used to capture snapshots of OA
> > counters, and is inserted at BB boundaries.
>
> So, it is possible to trigger a read of a set of counters (all?) from
> the pushbuffer buffer?
>
> If so, I like this because I was wondering how would this work break
> when we move to the GuC-submission model.
>
> Thanks for working on this!
> Martin

Yeah, we can trigger the capture of counter snapshot using command
MI_REPORT_PERF_COUNT inserted in the ringbuffer. The capture is
initiated on encountering this command, at an address specified in the
command arguments. The exact details of counters captured (report format
etc.) depends on the OA unit configuration done earlier.

-Sourab