[Beignet] [PATCH 2/2] Add aub dump support
Zhigang Gong
zhigang.gong at linux.intel.com
Wed Dec 24 22:30:40 PST 2014
One normal case is that the application will enqueue many kernels one by one.
Could you enhance this patch to output per kernel aub file, something like
kernel_a.aub, kernel_b.aub, etc.
Thanks,
Zhigang Gong.
On Thu, Dec 25, 2014 at 10:57:29AM +0800, Zhenyu Wang wrote:
> Use current libdrm interface to dump aub file for debug in emulator.
> This adds new driver environment of OCL_DUMP_AUB=1 to enable this.
>
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
> src/intel/intel_driver.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
> index bdfa768..4ed1e25 100644
> --- a/src/intel/intel_driver.c
> +++ b/src/intel/intel_driver.c
> @@ -109,13 +109,28 @@ error:
> /* just used for maximum relocation number in drm_intel */
> #define BATCH_SIZE 0x4000
>
> +/* set OCL_DUMP_AUB=1 to get aub file */
> +static void
> +intel_driver_aub_dump(intel_driver_t *driver)
> +{
> + char *val;
> + val = getenv("OCL_DUMP_AUB");
> + if (!val)
> + return;
> + if (atoi(val) != 0) {
> + drm_intel_bufmgr_gem_set_aub_filename(driver->bufmgr,
> + "beignet.aub");
> + drm_intel_bufmgr_gem_set_aub_dump(driver->bufmgr, 1);
> + }
> +}
> +
> static void
> intel_driver_memman_init(intel_driver_t *driver)
> {
> driver->bufmgr = drm_intel_bufmgr_gem_init(driver->fd, BATCH_SIZE);
> assert(driver->bufmgr);
> - //drm_intel_bufmgr_gem_set_aub_dump(driver->bufmgr, 1);
> drm_intel_bufmgr_gem_enable_reuse(driver->bufmgr);
> + intel_driver_aub_dump(driver);
> }
>
> static void
> --
> 2.1.4
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list