From patchwork Tue Jan 14 11:37:56 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: 857236 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1872602wrc; Tue, 14 Jan 2025 03:41:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUmDAr52uE0bXW1xJuMLUc/b/qqyJN1MeNAPH6OoBb9StIl0L6FgWnZBAKpIDGeeSNyJ0yb4A==@linaro.org X-Google-Smtp-Source: AGHT+IF32W5677sDgobUOHgvbhtUilPdeAjNZI02zNOJZwrbu+p8o7pobIJntK+5djMlCKJvGEak X-Received: by 2002:a05:620a:2991:b0:7b6:d28b:42b4 with SMTP id af79cd13be357-7bcd973b19dmr3638789185a.19.1736854891002; Tue, 14 Jan 2025 03:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736854890; cv=none; d=google.com; s=arc-20240605; b=Nr7pxANPtF/59hiiRpGnHfrBcxbaUZDqrK6XYblc15ve8Rrth4FWCwOVnAgXG6mvd7 ms0M7EP7TfuPPLMl6ZCHLcAIoLK2PaLnWjGLobkBJo+i6R2gu1n1wp6kG1mcsveXz+pP u0gG5E/YBYyOCkLZ6VbOqb0BUdve2GonzOExW09RMfot9EmOC8sBuQO+fh0aXUSaTabo SE6hDe2MIhLXsciFAAk7Og9434yOA8D+LmoSuX7zNUWQNPTwUU/Fimt5/KBOKLm7vF7D 41f6clCvB+s4cuGzIWALFWXF+Hiazj7n7uA7v/A1Z56ch0etQtYxzg17YRE7Dz6MpqzW GnbQ== 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=kybcMgHu6G3G1kz+Iwx2Y7lVQ4lMSqWHrwHMI/PcVVA=; b=UKneGmoaPnwuo1BgBnlWTr9tKQxYm2gxJNpK/i7FYfmoEmPSGJHs9V7y25GCUGIWNk odVee8ipu+ctM1QITbpjphqss15uaOAXUaE/1QeuKMRv/oX/MUvSE8WC66wdlLBc//vr ROj7MlphaL1Mn1BwKUu8yXM0xtfH/OycCJVlw3/ZHElXa1yiozRkegGwgel9Biu4vx3P 2zrVjKbB9zh8eHehMqWsqV3kFOmaO/QI9e57zCJr/GYJXbO+Y5H4LIdacWgNR6pZA+c5 2IK/zt/WKKzmijAKWAqnSNyvLWrEfVFnoZg2GQMmNWf7niU0qWtC7HhKuL0PoAFsUs9W KN5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VqkFhMAL; 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 af79cd13be357-7bce3307d0dsi1474388185a.232.2025.01.14.03.41.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jan 2025 03:41:30 -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=VqkFhMAL; 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 1tXfFq-0005BF-Qk; Tue, 14 Jan 2025 06:38:42 -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 1tXfFi-00057V-8x for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFf-0005QT-Jm for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:33 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3f28a4fccso7797200a12.2 for ; Tue, 14 Jan 2025 03:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854710; x=1737459510; 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=VqkFhMALgP58Nuydp6Z2aP9VzLtD88mUC4O2U+UmVRIdTNnutRo+szxDgsW0mzO+rb wBOksxD0PkyHEk3aRbziqeuTwGjESpmoJi6UQYfx2CbvXv260j9eCAAccaEyC50WZE3V TGSuix+YIZXuMW6y+DGySdYyjfcoXs7wfaHEm3MWirQ+5BbKvYOTMNcSAliXqeP0LAH4 ytadk0c2xP5yB2YjD9Yj3ZMj3GruUFLz0e8JH1s3oC5S6ROdD4fwGiB35R68PA7DDWrC zIqc1A70g715vRZ66x7MNIc6xRze9v0GpE1gWcQAsTp/QLu1ALoDzMldpHLMxl+bDRKc qxxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854710; x=1737459510; 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=jpJt8VcA5LrU08m2DkMhdTWQuw+hqm9obrWobGdMW+xOXcADg+IqFj4tQc9vSENTph oOv1WynWRsHPT95s9TJfLdPA9DOsFjA7fMVlct5lSjGhR/7fueIRnG2h2aa59NHoAdKm uhMRZ6hnCNtaZOFWr7THkl2mJfcaqOLwlIA6Y1QDNxE1Jti+aXP8bR7v4gmHxpZSvbn+ EZaBFAcNwr1S6aAMBPcRpGWefGYLymq7rNUGmm8y/Q1E9p1v/DuuWqayDUcJue9IKVbi So03MBiu0NentH/sST6eW17/HqcQwrFeKpsRT+w4A8zkLoo+Qy8nK4WxYAlTEw50BGLF zggw== X-Gm-Message-State: AOJu0Yx0rRjrtYginajGYIL2/zQa/ilTyvRAm0DC/HQV3Hhadbzk1FGR es6ZLZW7K4qJ2HTvJRJtigJZVM4GTauEujOJGVK0eOX+ZdvT/BuoX4NF1/R4WdM= X-Gm-Gg: ASbGnctwDuNwk/gXNyPeUop2vRiVacLmZkRPMpm4caCv5sAYINnO4DaJWbqC1TY8VU5 +aw48U8YyT27WBXb7Mex7sWO2ubZyJ3keaaGHDXPCSfCzfeBZk9gC/ktW7lGGq5jOf0AY6nkXbw cY4UGVev4aW3jXRPA3Cp0oruPtabZ9FvonYF3/FJj6p9vwatSEfY9gwnNvd5Q5cv7nc8ICtvqM5 3t9e+ZJmg4rSOXX7ybS/oHTXVYwrP+G9ixAG+WUMuAdbEMMNVHHOx0= X-Received: by 2002:a17:907:3d9f:b0:aae:ef24:888d with SMTP id a640c23a62f3a-ab2abc92349mr2514136166b.55.1736854709927; Tue, 14 Jan 2025 03:38:29 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b09b2sm624652966b.146.2025.01.14.03.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DC4B05F9E9; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 12/37] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Tue, 14 Jan 2025 11:37:56 +0000 Message-Id: <20250114113821.768750-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.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);