From patchwork Tue Dec 17 01:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851407 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110622wrq; Mon, 16 Dec 2024 17:09:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPn0eoXBqJyJFGzchm8IQYB25YcH7wWnhgqZxVbg0tihMCXfDb5+LfP04Crhe1J8pkCJ/ZMg==@linaro.org X-Google-Smtp-Source: AGHT+IECzOj9CIgWJdZn9qd07wL0pjNLSAWgQ9Itn3Yc3Nz4UVsG1+wbz0b2P3RAKHd3rRxUHJ5L X-Received: by 2002:a05:622a:4a0e:b0:467:7401:ce95 with SMTP id d75a77b69052e-467a577d966mr247791321cf.21.1734397793717; Mon, 16 Dec 2024 17:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397793; cv=none; d=google.com; s=arc-20240605; b=cgFzIU0qqDbHEnBI2aa3zM1KIKbbwvGjWlIgv4ozbvSU22viPlD2erBhC9uyvlcBCP aEYWnyAtI/oSo2FzdF+WmWUJ4eCGLdXeqqPzFFJ/0zjv/pjonHfNariAQjrwjyk5GrNa TtM7PBCreTjto/xsTmcyr34M91ajuG2DsRegaiPpNNjnJrvziSGQIGt2aPe+pKoIn9M0 0hRlyoF5eZz1j5svpb97Oi42WYGuSTuz0pyrSdnAybcd3ghRrLGRZvpHvZHLAB0450jB N0zyH/T9PJTgjVGL+uHgnjvANTTxP5FKlTVV73pxRrhMLKxt5orub/P751TeB3h5Mzky IDLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=eupOeWiMK32yQfSFHAEmqlLdwAAhUxngsAwFIUN75jjyu6enu5Tw732OcBFQnNi13W srte7wQCCyJHqfipXQB6fUmScppk1HxYYrUo06NFiqWEo/Cuhfd7okONn2v+FdtghjUX DR+CLNln/dEAJmWG7FRZq92KkHygHG9c8AJu06hjKqgMlyD52NhALto0bbnBFymA2X7d gAi5FwI8ivSRBBNjKGpRyP8pnyjoBNRtnMksTx7Whru0NpM0Uh9v45GLxXtpdDxe+z9o PY2awq2WNrAjMUVvJ7nwNkN6iDYDUGUxtoVj3U5dLGhIfXTCr6E1lgd7vj14jOWu81+K t99w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2xmaP9P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2c96956si86268471cf.42.2024.12.16.17.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2xmaP9P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3h-0008I2-Lp; Mon, 16 Dec 2024 20:07:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3d-0008HV-4p for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:29 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3b-0004yS-Hk for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:28 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee9a780de4so3113031a91.3 for ; Mon, 16 Dec 2024 17:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397646; x=1735002446; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; b=K2xmaP9Pw9PUacevACZWtRYiwodluRfZl2IVVNxG8lxLUbAVz1cWygBlkccjBUVO9n IA1FM5IuzD9AzUTKPQ1gZWext2UWeUjh5kJQK3JEK4DwmNHqLc7+GYrFYZqNTKIZHjd/ yIKPSTUiZWOfXd0gQhW9n5zANhm86lmyXnt7JjrwLbHu01t4lfERtQCh8qOpXc5/UeZF MZdhLmMOT/el1VVNoLTxSyi1r085UOu9i++Z6KnvFM+HqP7t2b0NhFP9xjSR0GZpkBLm 9DXUYMwrvDLiFM33yzm86x3UCdKP+n7gh5i1KG6DJTGBpMNXqaP5Qi9IxRG81eCaWIDZ bBAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397646; x=1735002446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; b=vjoaPGNmTM8+pDfYAu+7O0+QMGWdGWlmK4rPyd98GsJ8+Xc7YWnJYtQSE1HtKo8v0+ zzmAroN8+zSXO9AV9GAUce/1NX0ehZZSW656AsZ7mmsLf5xfUO9x/g9hygIAyUUliKgf BJ6tMWnhlcdg6arwe858bVtQCEVBRAoHmO4fMcJReV86row57FMzqPOoFHIRV8nhEGDp 1a/qeVLVGYrUlmAs4Xq+RCh7TroixljON4wAXZiimBIcdfqyjiWURdgIW/q8KoViF681 DD/WuEPerYYEggO+B7g5sCh3g0GQKxpVxCUlGtdcMiDnYk+AMhQIebbuidmFURME8yKl aQ5Q== X-Gm-Message-State: AOJu0Ywdwx+ZZjwwkySs2RGt2aHRslZp6kXSNUCApyCqXzF1x8Q18fkE YDREDq5cFwDsZyqA4s8Hoi4cKcmrqCyn04lH+3r2Sw4M15p4Vjo4qkHc8F+lgEt0ulLF/olMshp i2xY= X-Gm-Gg: ASbGncteXVu8axb+EAGYR6FD5FQdU5FvX44HXNhpBA3eiUQJGcMLzZswJ1m06Se+6al xu68HgAe8jZ1J/zRPMe4olw872yuqbGbZce0UrjwjFvWxJ1W0mVHh4+0Ia121ISR99VKvqOQ35T B4zZQaDhW+OWw5AcqmrufZE9vbTd4wqXkr2HxeFwEpqdPHDD+sMAIM7H/jmypYMDVL88eiVbnWd cZNRzSdo5c/3fArejWLUwyfXtM2x6DIuPJuYh5Z9g9jUivIQuIl8G8YBL7BiYxgsbvmYfyCz3JE esMbmPrKFgYQb2w= X-Received: by 2002:a17:90b:2fcd:b0:2ee:b2be:f390 with SMTP id 98e67ed59e1d1-2f28ffa7e4dmr18261917a91.28.1734397645981; Mon, 16 Dec 2024 17:07:25 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:25 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 09/13] contrib/plugins/hotblocks: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:03 -0800 Message-Id: <20241217010707.2557258-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- 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); } static void vcpu_tb_exec(unsigned int cpu_index, void *udata) @@ -114,16 +115,17 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) uint64_t hash = pc ^ insns; g_mutex_lock(&lock); - cnt = (ExecCount *) g_hash_table_lookup(hotblocks, (gconstpointer) hash); + cnt = (ExecCount *) g_hash_table_lookup(hotblocks, &hash); if (cnt) { cnt->trans_count++; } else { cnt = g_new0(ExecCount, 1); cnt->start_addr = pc; + cnt->hash = hash; cnt->trans_count = 1; cnt->insns = insns; cnt->exec_count = qemu_plugin_scoreboard_new(sizeof(uint64_t)); - g_hash_table_insert(hotblocks, (gpointer) hash, (gpointer) cnt); + g_hash_table_insert(hotblocks, &cnt->hash, cnt); } g_mutex_unlock(&lock);