Lines Matching defs:file

70 store_exec_begin(struct aub_file *file)
72 if (unlikely(file->n_execs >= file->n_allocated_execs)) {
73 file->n_allocated_execs = MAX2(2U * file->n_allocated_execs,
74 4096 / sizeof(file->execs[0]));
75 file->execs = (decltype(file->execs))
76 realloc(static_cast<void *>(file->execs),
77 file->n_allocated_execs * sizeof(file->execs[0]));
80 file->execs[file->n_execs++].start = file->cursor;
84 store_exec_end(struct aub_file *file)
86 if (file->n_execs > 0 && file->execs[file->n_execs - 1].end == NULL)
87 file->execs[file->n_execs - 1].end = file->cursor;
94 struct aub_file *file = (struct aub_file *) user_data;
95 file->idx_reg_write = 0;
96 store_exec_end(file);
103 struct aub_file *file = (struct aub_file *) user_data;
104 file->idx_reg_write = 0;
105 store_exec_begin(file);
111 struct aub_file *file = (struct aub_file *) user_data;
116 if (file->idx_reg_write++ == 0)
117 store_exec_begin(file);
123 struct aub_file *file = (struct aub_file *) user_data;
124 store_exec_end(file);
126 file->pci_id = pci_id;
127 snprintf(file->app_name, sizeof(app_name), "%s", app_name);
129 if (!intel_get_device_info_from_pci_id(file->pci_id, &file->devinfo)) {
130 fprintf(stderr, "can't find device information: pci_id=0x%x\n", file->pci_id);
133 brw_init_isa_info(&file->isa, &file->devinfo);
134 file->spec = intel_spec_load(&file->devinfo);
146 struct aub_file *file;
150 file = xtzalloc(*file);
162 file->map = (uint8_t *) mmap(NULL, sb.st_size,
164 if (file->map == MAP_FAILED) {
171 file->cursor = file->map;
172 file->end = file->map + sb.st_size;
175 aub_read.user_data = file;
186 while (file->cursor < file->end &&
187 (consumed = aub_read_command(&aub_read, file->cursor,
188 file->end - file->cursor)) > 0) {
189 file->cursor += consumed;
193 if (file->n_execs > 0 && file->execs[file->n_execs - 1].end == NULL)
194 file->execs[file->n_execs - 1].end = file->end;
196 return file;
202 update_mem_for_exec(struct aub_mem *mem, struct aub_file *file, int exec_idx)
211 /* Replay the aub file from the beginning up to just before the
214 const uint8_t *iter = file->map;
215 while (iter < file->execs[exec_idx].start) {
216 iter += aub_read_command(&read, iter, file->execs[exec_idx].start - iter);
307 struct aub_file *file;
397 intel_disassemble(&context.file->isa,
693 window->exec_idx = MAX2(MIN2(context.file->n_execs - 1, exec_idx), 0);
694 update_mem_for_exec(&window->mem, context.file, window->exec_idx);
771 const uint8_t *iter = context.file->execs[window->exec_idx].start;
772 while (iter < context.file->execs[window->exec_idx].end) {
774 context.file->execs[window->exec_idx].end - iter);
821 &context.file->devinfo,
822 context.file->spec,
845 hash_table_foreach(context.file->spec->registers_by_name, entry) {
900 hash_table_foreach(context.file->spec->commands, entry) {
922 hash_table_foreach(context.file->spec->structs, entry) {
1007 ImGui::Text("File size: %s", human_size(context.file->end - context.file->map));
1008 ImGui::Text("Execbufs %u", context.file->n_execs);
1009 ImGui::Text("PCI ID: 0x%x", context.file->pci_id);
1010 ImGui::Text("Application name: %s", context.file->app_name);
1011 ImGui::Text("%s", context.file->devinfo.name);
1051 "Aubinator Viewer: Intel AUB file decoder/editor");
1163 print_help(const char *progname, FILE *file)
1165 fprintf(file,
1167 "Decode aub file contents from FILE.\n\n"
1204 context.file = aub_file_open(context.input_file);