Profiler: Use u32 when constructing InstructionData

When constructing values of the InstructionData type we assume that
the event_count field is a size_t while it actually is a u32. On x86_64
this fails because those are different types.
This commit is contained in:
Gunnar Beutner 2021-06-23 21:50:06 +02:00 committed by Andreas Kling
parent dc3cc7368b
commit f2eb759901
Notes: sideshowbarker 2024-07-18 11:35:55 +09:00

View file

@ -85,7 +85,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
auto disassembly = insn.value().to_string(address_in_profiled_program, &symbol_provider);
StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length());
size_t samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0);
u32 samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0);
float percent = ((float)samples_at_this_instruction / (float)m_node.event_count()) * 100.0f;
m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program, samples_at_this_instruction, percent });