qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/13] contrib/plugins/hotblocks: fix 32-bit build


From: Richard Henderson
Subject: Re: [PATCH 09/13] contrib/plugins/hotblocks: fix 32-bit build
Date: Tue, 17 Dec 2024 09:34:13 -0600
User-agent: Mozilla Thunderbird

On 12/16/24 19:07, Pierrick Bouvier wrote:
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
  contrib/plugins/hotblocks.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c
index 02bc5078bdd..09b0932275c 100644
--- a/contrib/plugins/hotblocks.c
+++ b/contrib/plugins/hotblocks.c
@@ -34,6 +34,7 @@ static guint64 limit = 20;
   */
  typedef struct {
      uint64_t start_addr;
+    uint64_t hash;
      struct qemu_plugin_scoreboard *exec_count;
      int trans_count;
      unsigned long insns;
@@ -91,7 +92,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
static void plugin_init(void)
  {
-    hotblocks = g_hash_table_new(NULL, g_direct_equal);
+    hotblocks = g_hash_table_new(g_int64_hash, g_int64_equal);
  }

I think this one should be using a proper comparison function: compare both pc and insns, the inputs to the simplistic hash function:

      uint64_t hash = pc ^ insns;

An existing bug with the plugin, obviously.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]