From patchwork Mon Mar 13 19:55:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 9621979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B4BE60244 for ; Mon, 13 Mar 2017 20:01:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F8F828236 for ; Mon, 13 Mar 2017 20:01:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24A1A2848E; Mon, 13 Mar 2017 20:01:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C115A28236 for ; Mon, 13 Mar 2017 20:01:07 +0000 (UTC) Received: from localhost ([::1]:54125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnW9S-0004mR-Q9 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 Mar 2017 16:01:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnW4b-0000gf-AS for qemu-devel@nongnu.org; Mon, 13 Mar 2017 15:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnW4Y-0002RH-GL for qemu-devel@nongnu.org; Mon, 13 Mar 2017 15:56:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47172) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnW4Y-0002Qj-AP for qemu-devel@nongnu.org; Mon, 13 Mar 2017 15:56:02 -0400 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3385A342C44; Mon, 13 Mar 2017 19:56:02 +0000 (UTC) Received: from red.redhat.com (unknown [10.10.121.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 394CB2D5C1; Mon, 13 Mar 2017 19:56:01 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 13 Mar 2017 14:55:25 -0500 Message-Id: <20170313195547.21466-9-eblake@redhat.com> In-Reply-To: <20170313195547.21466-1-eblake@redhat.com> References: <20170313195547.21466-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Mar 2017 19:56:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 08/30] trace: Fix parameter types in top level X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , stefanha@redhat.com, Peter Crosthwaite Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP An upcoming patch will let the compiler warn us when we are silently losing precision in traces; update the trace definitions to pass through the full value at the callsite. Some of the callers use the variable-length target_ulong, which cannot portably be mentioned in headers that are included from target-independent code; in those cases, use casts to force a type that will work through varargs to match the declaration already in trace-events. Signed-off-by: Eric Blake --- cpu-exec.c | 6 +++--- translate-all.c | 2 +- trace-events | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index d04dd91..109f502 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -210,7 +210,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles, tb_unlock(); /* execute the generated code */ - trace_exec_tb_nocache(tb, tb->pc); + trace_exec_tb_nocache(tb, (uintptr_t) tb->pc); cpu_tb_exec(cpu, tb); tb_lock(); @@ -240,7 +240,7 @@ static void cpu_exec_step(CPUState *cpu) cc->cpu_exec_enter(cpu); /* execute the generated code */ - trace_exec_tb_nocache(tb, pc); + trace_exec_tb_nocache(tb, (uintptr_t) pc); cpu_tb_exec(cpu, tb); cc->cpu_exec_exit(cpu); @@ -571,7 +571,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, uintptr_t ret; int32_t insns_left; - trace_exec_tb(tb, tb->pc); + trace_exec_tb(tb, (uintptr_t) tb->pc); ret = cpu_tb_exec(cpu, tb); tb = (TranslationBlock *)(ret & ~TB_EXIT_MASK); *tb_exit = ret & TB_EXIT_MASK; diff --git a/translate-all.c b/translate-all.c index 34480ae..68f31cd 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1294,7 +1294,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, gen_intermediate_code(env, tb); tcg_ctx.cpu = NULL; - trace_translate_block(tb, tb->pc, tb->tc_ptr); + trace_translate_block(tb, (uintptr_t) tb->pc, tb->tc_ptr); /* generate machine code */ tb->jmp_reset_offset[0] = TB_JMP_RESET_OFFSET_INVALID; diff --git a/trace-events b/trace-events index b07a09b..4f72cf2 100644 --- a/trace-events +++ b/trace-events @@ -42,7 +42,7 @@ qemu_system_shutdown_request(void) "" qemu_system_powerdown_request(void) "" # spice-qemu-char.c -spice_vmc_write(ssize_t out, int len) "spice wrote %zd of requested %d" +spice_vmc_write(ssize_t out, ssize_t len) "spice wrote %zd of requested %zd" spice_vmc_read(int bytes, int len) "spice read %d of requested %d" spice_vmc_register_interface(void *scd) "spice vmc registered interface %p" spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p"