Lines Matching defs:chunk
187 static void ac_sqtt_fill_cpu_info(struct sqtt_file_chunk_cpu_info *chunk)
194 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_CPU_INFO;
195 chunk->header.chunk_id.index = 0;
196 chunk->header.major_version = 0;
197 chunk->header.minor_version = 0;
198 chunk->header.size_in_bytes = sizeof(*chunk);
200 chunk->cpu_timestamp_freq = 1000000000; /* tick set to 1ns */
202 strncpy((char *)chunk->vendor_id, "Unknown", sizeof(chunk->vendor_id));
203 strncpy((char *)chunk->processor_brand, "Unknown", sizeof(chunk->processor_brand));
204 chunk->clock_speed = 0;
205 chunk->num_logical_cores = 0;
206 chunk->num_physical_cores = 0;
207 chunk->system_ram_size = 0;
209 chunk->system_ram_size = system_ram_size / (1024 * 1024);
222 char *ptr = (char *)chunk->vendor_id;
225 strncpy(ptr, v + 1, sizeof(chunk->vendor_id) - 1);
226 ptr[sizeof(chunk->vendor_id) - 1] = '\0';
232 char *ptr = (char *)chunk->processor_brand;
235 strncpy(ptr, v + 1, sizeof(chunk->processor_brand) - 1);
236 ptr[sizeof(chunk->processor_brand) - 1] = '\0';
252 chunk->num_logical_cores = v;
260 chunk->num_physical_cores = v;
264 if (chunk->num_logical_cores)
265 chunk->clock_speed = cpu_clock_speed_total / chunk->num_logical_cores;
439 struct sqtt_file_chunk_asic_info *chunk)
443 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_ASIC_INFO;
444 chunk->header.chunk_id.index = 0;
445 chunk->header.major_version = 0;
446 chunk->header.minor_version = 4;
447 chunk->header.size_in_bytes = sizeof(*chunk);
449 chunk->flags = 0;
455 chunk->flags |= SQTT_FILE_CHUNK_ASIC_INFO_FLAG_SC_PACKER_NUMBERING;
459 chunk->flags |= SQTT_FILE_CHUNK_ASIC_INFO_FLAG_PS1_EVENT_TOKENS_ENABLED;
461 chunk->trace_shader_core_clock = rad_info->max_shader_clock * 1000000;
462 chunk->trace_memory_clock = rad_info->max_memory_clock * 1000000;
466 if (!chunk->trace_shader_core_clock)
467 chunk->trace_shader_core_clock = 1e9;
468 if (!chunk->trace_memory_clock)
469 chunk->trace_memory_clock = 1e9;
471 chunk->device_id = rad_info->pci_id;
472 chunk->device_revision_id = rad_info->pci_rev_id;
473 chunk->vgprs_per_simd = rad_info->num_physical_wave64_vgprs_per_simd * (has_wave32 ? 2 : 1);
474 chunk->sgprs_per_simd = rad_info->num_physical_sgprs_per_simd;
475 chunk->shader_engines = rad_info->max_se;
476 chunk->compute_unit_per_shader_engine = rad_info->min_good_cu_per_sa * rad_info->max_sa_per_se;
477 chunk->simd_per_compute_unit = rad_info->num_simd_per_compute_unit;
478 chunk->wavefronts_per_simd = rad_info->max_wave64_per_simd;
480 chunk->minimum_vgpr_alloc = rad_info->min_wave64_vgpr_alloc;
481 chunk->vgpr_alloc_granularity = rad_info->wave64_vgpr_alloc_granularity * (has_wave32 ? 2 : 1);
482 chunk->minimum_sgpr_alloc = rad_info->min_sgpr_alloc;
483 chunk->sgpr_alloc_granularity = rad_info->sgpr_alloc_granularity;
485 chunk->hardware_contexts = 8;
486 chunk->gpu_type =
488 chunk->gfxip_level = ac_chip_class_to_sqtt_gfxip_level(rad_info->chip_class);
489 chunk->gpu_index = 0;
491 chunk->max_number_of_dedicated_cus = 0;
492 chunk->ce_ram_size = rad_info->ce_ram_size;
493 chunk->ce_ram_size_graphics = 0;
494 chunk->ce_ram_size_compute = 0;
496 chunk->vram_bus_width = rad_info->vram_bit_width;
497 chunk->vram_size = rad_info->vram_size;
498 chunk->l2_cache_size = rad_info->l2_cache_size;
499 chunk->l1_cache_size = rad_info->l1_cache_size;
500 chunk->lds_size = rad_info->lds_size_per_workgroup;
503 chunk->lds_size /= 2;
506 strncpy(chunk->gpu_name, rad_info->name, SQTT_GPU_NAME_MAX_SIZE - 1);
508 chunk->alu_per_clock = 0.0;
509 chunk->texture_per_clock = 0.0;
510 chunk->prims_per_clock = rad_info->max_se;
512 chunk->prims_per_clock *= 2;
513 chunk->pixels_per_clock = 0.0;
515 chunk->gpu_timestamp_frequency = rad_info->clock_crystal_freq * 1000;
516 chunk->max_shader_core_clock = rad_info->max_shader_clock * 1000000;
517 chunk->max_memory_clock = rad_info->max_memory_clock * 1000000;
518 chunk->memory_ops_per_clock = ac_memory_ops_per_clock(rad_info->vram_type);
519 chunk->memory_chip_type = ac_vram_type_to_sqtt_memory_type(rad_info->vram_type);
520 chunk->lds_granularity = rad_info->lds_encode_granularity;
524 chunk->cu_mask[se][sa] = rad_info->cu_mask[se][sa];
601 static void ac_sqtt_fill_api_info(struct sqtt_file_chunk_api_info *chunk)
603 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_API_INFO;
604 chunk->header.chunk_id.index = 0;
605 chunk->header.major_version = 0;
606 chunk->header.minor_version = 1;
607 chunk->header.size_in_bytes = sizeof(*chunk);
609 chunk->api_type = SQTT_API_TYPE_VULKAN;
610 chunk->major_version = 0;
611 chunk->minor_version = 0;
612 chunk->profiling_mode = SQTT_PROFILING_MODE_PRESENT;
613 chunk->instruction_trace_mode = SQTT_INSTRUCTION_TRACE_DISABLED;
630 struct sqtt_file_chunk_code_object_database *chunk,
633 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_CODE_OBJECT_DATABASE;
634 chunk->header.chunk_id.index = 0;
635 chunk->header.major_version = 0;
636 chunk->header.minor_version = 0;
637 chunk->header.size_in_bytes = chunk_size;
638 chunk->offset = file_offset;
639 chunk->flags = 0;
640 chunk->size = chunk_size;
641 chunk->record_count = rgp_code_object->record_count;
662 struct sqtt_file_chunk_code_object_loader_events *chunk,
665 chunk->header.chunk_id.type =
667 chunk->header.chunk_id.index = 0;
668 chunk->header.major_version = 1;
669 chunk->header.minor_version = 0;
670 chunk->header.size_in_bytes = (rgp_loader_events->record_count *
672 sizeof(*chunk);
673 chunk->offset = file_offset;
674 chunk->flags = 0;
675 chunk->record_size = sizeof(struct sqtt_code_object_loader_events_record);
676 chunk->record_count = rgp_loader_events->record_count;
694 struct sqtt_file_chunk_pso_correlation *chunk,
697 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_PSO_CORRELATION;
698 chunk->header.chunk_id.index = 0;
699 chunk->header.major_version = 0;
700 chunk->header.minor_version = 0;
701 chunk->header.size_in_bytes = (rgp_pso_correlation->record_count *
703 sizeof(*chunk);
704 chunk->offset = file_offset;
705 chunk->flags = 0;
706 chunk->record_size = sizeof(struct sqtt_pso_correlation_record);
707 chunk->record_count = rgp_pso_correlation->record_count;
753 struct sqtt_file_chunk_sqtt_desc *chunk, int32_t chunk_index,
756 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_SQTT_DESC;
757 chunk->header.chunk_id.index = chunk_index;
758 chunk->header.major_version = 0;
759 chunk->header.minor_version = 2;
760 chunk->header.size_in_bytes = sizeof(*chunk);
762 chunk->sqtt_version =
764 chunk->shader_engine_index = shader_engine_index;
765 chunk->v1.instrumentation_spec_version = 1;
766 chunk->v1.instrumentation_api_version = 0;
767 chunk->v1.compute_unit_index = compute_unit_index;
782 static void ac_sqtt_fill_sqtt_data(struct sqtt_file_chunk_sqtt_data *chunk, int32_t chunk_index,
785 chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_SQTT_DATA;
786 chunk->header.chunk_id.index = chunk_index;
787 chunk->header.major_version = 0;
788 chunk->header.minor_version = 0;
789 chunk->header.size_in_bytes = sizeof(*chunk) + size;
791 chunk->offset = sizeof(*chunk) + offset;
792 chunk->size = size;
850 /* SQTT cpu chunk. */
855 /* SQTT asic chunk. */
860 /* SQTT api chunk. */
865 /* SQTT code object database chunk. */
897 /* SQTT code object loader events chunk. */
914 /* SQTT pso correlation chunk. */
940 /* SQTT desc chunk. */
945 /* SQTT data chunk. */