summaryrefslogtreecommitdiff
path: root/tools/aubdump.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>2015-08-10 15:40:04 -0700
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>2015-08-12 08:58:00 -0700
commit33bc41aa4108a0177372004d0b8f689e22bbd5ff (patch)
tree44a4f15992f8ce8d4c24b1afac826ff2a49eabec /tools/aubdump.c
parent3156305aceb790d410580ea44f145119359292e6 (diff)
aubdump: Write header after figuring out the gen
We have to defer figuring out the gen until we have a PCI ID, which we don't have for sure until the first execbuffer2 ioctl. We can't write the file header until we have the gen since we need to know the size of offsets in the file format. Move the call to write_header() into the dump_execbuffer2() where we have the gen. Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Diffstat (limited to 'tools/aubdump.c')
-rw-r--r--tools/aubdump.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c
index df56724f..d52515b4 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -328,6 +328,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
}
if (gen == 0) {
gen = intel_gen(device);
+ write_header();
if (verbose)
printf("[intel_aubdump: running, "
@@ -549,8 +550,6 @@ init(void)
file = fopen(filename, "w+");
fail_if(file == NULL, "intel_aubdump: failed to open file '%s'\n", filename);
-
- write_header();
}
static void __attribute__ ((destructor))