Browse Source

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.
Gunnar Beutner 4 năm trước cách đây
mục cha
commit
f2eb759901
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Userland/DevTools/Profiler/DisassemblyModel.cpp

+ 1 - 1
Userland/DevTools/Profiler/DisassemblyModel.cpp

@@ -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 });