From patchwork Tue Oct 6 12:08:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 271971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 879ADC4363D for ; Tue, 6 Oct 2020 12:11:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2D5620663 for ; Tue, 6 Oct 2020 12:11:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mDptSu/T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2D5620663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlos-00055V-Sx for qemu-devel@archiver.kernel.org; Tue, 06 Oct 2020 08:11:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPln7-0003JJ-PU for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:01 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:43634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPln6-0004DX-3U for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:01 -0400 Received: by mail-pl1-x641.google.com with SMTP id o9so1118920plx.10 for ; Tue, 06 Oct 2020 05:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oA6lwA9DRk6v/CqH7e4pibYzUGFI9UFOt7RD8ATdFPQ=; b=mDptSu/TJAdlaMSV4SNo6oO7zBvbrg9VaD+Lp4itrNOG4kSwyhdP1gkThzcy6gsgIx mlgnFY5C05NbZj3A9rENKLr9agYiCETEGtbWILmNGKUKOnM2uUAPZsVtkCSBRo0n2t19 GHHmjwVIkdptlO94nriY6w6vpGcGjcuLiiEDj9BpMYSG3Uc5YH7ojAcWlCevFmmSr0IX HP3RkFKM9K9dhQhEGB5hy+uDOMaq0vLY5YxhVUiZ2hltSe34uGdVEF8osrJ8C1kw9uQn nSkQY/F7abB0UksjP1Bo6HFQjwqARy9CRZjfbraKMAKBZyAT0xr4oO3o3dyZPFzcg6bB 2BvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oA6lwA9DRk6v/CqH7e4pibYzUGFI9UFOt7RD8ATdFPQ=; b=ITexIU1U7Ku0NWWbERhVFZAO/sdmmhdtxLyLalnTotdGKbBYF11SjHpe3+L5xTNwNM 4w+zZGZLBr8TUnwmKfY8J2alXFIe5mJJSG9dVdQJhG6CK/BxpiZ9FQnhWB1uYjtHlCtl EHSsss4nBlQdosJ28PBOb/hU22aEM5TBvbyTUE1idWtHfcAZIR7DdJ/HKOSXuRIZvrut QPTZI9lBtS8kDVFvVcMWoTl2U+UxkBlFehpVorsgWDGmxxEzfN0zJp3SwNjzt4YGDnu5 4nddeh7iNPhWJl85ebVbPt9a0J1s4QUViK7rwZPHaVJVo/8OzycGHj4x1WNluxNEoeE6 cROQ== X-Gm-Message-State: AOAM533h8gjLJqmEvU6RyZfT02UGEIhV+EaFUEEgkRcKpANsKsr4M2MY eI5wQ3DNE4j/2vgCU5AJ0uiVdes5vzCk2Q== X-Google-Smtp-Source: ABdhPJyD9ujyUCXnBno29fF1GG6x0UMJ5ZgVq7ozFDQdePY9E0BTIbjngJNSk+5nI4sj/rhMdpIv2Q== X-Received: by 2002:a17:90a:d983:: with SMTP id d3mr3493516pjv.144.1601986198006; Tue, 06 Oct 2020 05:09:58 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:09:57 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 2/7] plugin: Fixes compiling errors on msys2/mingw Date: Tue, 6 Oct 2020 20:08:55 +0800 Message-Id: <20201006120900.1579-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- contrib/plugins/hotblocks.c | 2 +- tests/plugin/bb.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 3942a2ca54..37435a3fc7 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -102,7 +102,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { ExecCount *cnt; uint64_t pc = qemu_plugin_tb_vaddr(tb); - unsigned long insns = qemu_plugin_tb_n_insns(tb); + size_t insns = qemu_plugin_tb_n_insns(tb); uint64_t hash = pc ^ insns; g_mutex_lock(&lock); diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index e4cc7fdd6e..de09bdde4e 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -72,7 +72,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *udata) CPUCount *count = max_cpus ? g_ptr_array_index(counts, cpu_index) : &inline_count; - unsigned long n_insns = (unsigned long)udata; + uintptr_t n_insns = (uintptr_t)udata; g_mutex_lock(&count->lock); count->insn_count += n_insns; count->bb_count++; @@ -81,7 +81,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *udata) static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { - unsigned long n_insns = qemu_plugin_tb_n_insns(tb); + size_t n_insns = qemu_plugin_tb_n_insns(tb); if (do_inline) { qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64,