[Beignet] [PATCH 2/2] Add aub dump support
Zhenyu Wang
zhenyuw at linux.intel.com
Wed Dec 24 18:57:29 PST 2014
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
More information about the Beignet
mailing list