From patchwork Thu Jan 16 16:02:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 857903 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp278734wrb; Thu, 16 Jan 2025 08:09:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUl0VU54i7mAFOvaIXhbcnrjalFcI5wKI+HygGvlGmgPliQSeFOT32ntwHQcnkK7r2EqnQl0Q==@linaro.org X-Google-Smtp-Source: AGHT+IH+i7sgUa5J+5IDsP4B9s88DhzeirrpeAvZ9PcGKi4xlNt89h3kljxwbZV7Ev+h8UKgKoFx X-Received: by 2002:a05:620a:1913:b0:7b6:d710:228c with SMTP id af79cd13be357-7bcd9717d97mr5149699985a.31.1737043748551; Thu, 16 Jan 2025 08:09:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737043748; cv=none; d=google.com; s=arc-20240605; b=HVuzokhEwB7ouFgyGHhumS9QmRDSiyL/fIOXwbc8F+gB/wOTxkc65SzBuuQroWVqPt JW6g8ihSUgqh+Q8YHv+88UYENbNET5rSwIo9enQ89Du+2TuBtA80mbK7PadIce1hn7Cw gePFl3EXXBWXIkgRaIWs0ZpPDxmEaYhsOXPV92EJ7E4A5jwhlVIFi9yCyVyQqzrzCttE BqDjOKZCJPLj823BGXv2zdXk+lqXGw4fUwUfJRze8gQDXm2fm/GxOpKfmTgQh47xCSYN 3amhiZnZRIRDYAz22EVJAB5Q66+PtQIEj/84326AynXiGNvQIa3Y0OgHUTocpVsapwpX L/rg== 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; fh=LWJxUxOPIoAG7kV40OipmNLMiNyFM+gQ1dWz4vBqJQ4=; b=VX6cpNK+ND3ZSbfqQmHrHzVi6XU0mqreHnpAunMhAsZCCtnObxDUx0HFAVz4m/QHYL MAzFzJ2pAGRPhatmK0i40SwqhG0aUgsI2U4FbcfJpYCO/+2HXxL7LV0qNRb1/4SLpO8B IEir9Ph8SWOYYTFA+VFMJBRIfGP0ZuFOfEm+76HCC2hfYya5SgUuV5pXQCtZ7G0KUIqn /LQI1Cj6Zcpv/mFrkySMAL+T9GKHM0V+d9v46wZNTP1+1eqWWehoSRuprPDJiHk2te9E s7NAMYfblYP6+RidXa6loWSVMfNr1jOm3PUKqn0pANtd1xI1P3Tck6Ej3zUa9qF0QzDr 4C7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1kSBipU; 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 6a1803df08f44-6e1afd1974esi2336016d6.464.2025.01.16.08.09.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jan 2025 08:09:08 -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=r1kSBipU; 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 1tYSLh-00046r-R0; Thu, 16 Jan 2025 11:04:01 -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 1tYSL8-0003Wt-Eq for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:03:30 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYSKz-0001Hj-Le for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:03:25 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-385eed29d17so664331f8f.0 for ; Thu, 16 Jan 2025 08:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737043396; x=1737648196; 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; b=r1kSBipU0ujRFmyH8y1nN+NWxqVQz2rdfFzY8sRtX42+0b6rSiwafsle7hPcMJ0B36 Qw6i7SIBYDZ9Pnetg5G3SrE8mOjkqao2h1Ibh7EZE4MDaZ2oe0xOm7RIIx2FEo9b/pqd 8pbiSptJnJr+YkHovJ06L+jkDSg+so21EzgosH7qPOJ0zjceyvHkxfJH5JrQInDGJTPd s16u+3LasDyNvQJlTjzC7MFEu/e+o6vLnn04V95jjOmFdd/s2Rh7lKg8+BnHzWJBM6aO 0IOtP6RHpTcz3EIRd62xGJuGIWY+8ypepYPC0Fc+CQ7diNzLMJY3VFA1RPn+vnGEyD87 FP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737043396; x=1737648196; 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; b=FKQm3pA2vPIGeRNvrEOEYs0w0OnaR3fnf4F0OmOWVqWWz5eUma5pOB4Jw+YNxmUZuq SubEJDciU699jIUX3Xde0P5/vA9n56fdjeAQQ5va2mY+rViLXYm7MGOT0vhmZcJl92Pa FFtQe0I+FFZapl5t+aCES0l27xlRwg7WGlDscsZWtoP0JMZ+7nfgjdlE4QSCVWGJLUoT A+EKmbC9fLdKX+C4PVSyNXciUNRtdLQlMhtlKpYBJNAvC63xx9UuUbm3Apm44xaEwPCK TWSZSN+PZa+C2MiyNd+RVmtYWoFJaVK3vfuQI+heprXu0ntC0x6qHNF09yhKeRDhJt5Q 2Riw== X-Gm-Message-State: AOJu0YzGHTSYeIYVUHjVedxq+QBisDGBZ3oaCo2fCKrDJuYsLyOrPJ5Q CCtJRR2Zht8LeEIynVwfrQbzylW4u0NSfgesF43sAzzj/hfDMkDODaSeTVk8vms= X-Gm-Gg: ASbGncu+tF0VvD6s4u0z4VjAJM5lDrVG+VQBeWzOG+YdefYL4eJwcEO5c2O8R+hm/hC +0KzfAYZmF0pOgzSpTVX4sgiw5reTMo5l2wLgACr3Wj13EGHNc6arLByNMSt0bo+yGI4iLRAZ55 RN6sUWYbzKLkZdL3v2Q3hU+QLNtRIv4wxxZOEvKSK4EvNwwMVi7Tcp8alS8pBW4aOQHXFwUwSGy 42avBrcOqIWuc5P36o7fhAQirm8cThcEF38PpalbfEC6DYFG+CxxS0= X-Received: by 2002:a05:6000:1f85:b0:385:e411:c894 with SMTP id ffacd0b85a97d-38a873377b2mr31016041f8f.43.1737043395954; Thu, 16 Jan 2025 08:03:15 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf322a859sm215673f8f.43.2025.01.16.08.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 08:03:11 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9A73A6087C; Thu, 16 Jan 2025 16:03:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Yuri Benditovich , Jason Wang , Cleber Rosa , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Stefano Garzarella , qemu-arm@nongnu.org, Michael Roth , Laurent Vivier , Mahmoud Mandour , Andrew Melnychenko , Konstantin Kostiuk , Kyle Evans , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , John Snow , David Hildenbrand , Fabiano Rosas , Alexandre Iooss , Eric Blake , =?utf-8?q?Alex_Benn=C3=A9e?= , Vladimir Sementsov-Ogievskiy , Pierrick Bouvier , Kevin Wolf , Peter Maydell , Laurent Vivier , "Michael S. Tsirkin" , Thomas Huth , Warner Losh , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= Subject: [PATCH v3 12/37] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Thu, 16 Jan 2025 16:02:41 +0000 Message-Id: <20250116160306.1709518-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250116160306.1709518-1-alex.bennee@linaro.org> References: <20250116160306.1709518-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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 From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- contrib/plugins/howvec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 9be67f7453..2aa9029c3f 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -253,6 +253,8 @@ static struct qemu_plugin_scoreboard *find_counter( int i; uint64_t *cnt = NULL; uint32_t opcode = 0; + /* if opcode is greater than 32 bits, we should refactor insn hash table. */ + G_STATIC_ASSERT(sizeof(opcode) == sizeof(uint32_t)); InsnClassExecCount *class = NULL; /* @@ -284,7 +286,7 @@ static struct qemu_plugin_scoreboard *find_counter( g_mutex_lock(&lock); icount = (InsnExecCount *) g_hash_table_lookup(insns, - GUINT_TO_POINTER(opcode)); + (gpointer)(intptr_t) opcode); if (!icount) { icount = g_new0(InsnExecCount, 1); @@ -295,8 +297,7 @@ static struct qemu_plugin_scoreboard *find_counter( qemu_plugin_scoreboard_new(sizeof(uint64_t)); icount->count = qemu_plugin_scoreboard_u64(score); - g_hash_table_insert(insns, GUINT_TO_POINTER(opcode), - (gpointer) icount); + g_hash_table_insert(insns, (gpointer)(intptr_t) opcode, icount); } g_mutex_unlock(&lock);