This option allows for smaller aub files to be generated by only
storing the BOs flagged with EXEC_OBJECT_CAPTURE.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
static FILE *output_file = NULL;
static int verbose = 0;
static bool device_override = false;
static FILE *output_file = NULL;
static int verbose = 0;
static bool device_override = false;
+static bool capture_only = false;
#define MAX_FD_COUNT 64
#define MAX_BO_COUNT 64 * 1024
#define MAX_FD_COUNT 64
#define MAX_BO_COUNT 64 * 1024
+ bool write = !capture_only || (obj->flags & EXEC_OBJECT_CAPTURE);
+
+ if (write && bo->dirty) {
if (bo == batch_bo) {
aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_BATCH,
GET_PTR(data), bo->size, bo->offset);
if (bo == batch_bo) {
aub_write_trace_block(&aub_file, AUB_TRACE_TYPE_BATCH,
GET_PTR(data), bo->size, bo->offset);
fail_if(output_file == NULL,
"failed to open file '%s'\n",
output_filename);
fail_if(output_file == NULL,
"failed to open file '%s'\n",
output_filename);
+ } else if (!strcmp(key, "capture_only")) {
+ capture_only = atoi(value);
} else {
fprintf(stderr, "unknown option '%s'\n", key);
}
} else {
fprintf(stderr, "unknown option '%s'\n", key);
}
-p, --platform=NAME Override PCI ID using a platform name
-p, --platform=NAME Override PCI ID using a platform name
+ -c, --only-capture Only write objects flagged with EXEC_OBJECT_CAPTURE into
+ the output aub file. This helps reducing output file
+ size greatly but won't produce a file replayable
+
-v Enable verbose output
-vv Enable extra verbosity - dumps gtt mappings
-v Enable verbose output
-vv Enable extra verbosity - dumps gtt mappings
function add_arg() {
arg=$1
function add_arg() {
arg=$1
+ -c)
+ add_arg "capture_only=1"
+ shift
+ ;;
+ --only-capture)
+ add_arg "capture_only=1"
+ shift
+ ;;