From patchwork Mon Mar 20 13:00:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yongbok Kim X-Patchwork-Id: 9634101 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 854AF602D6 for ; Mon, 20 Mar 2017 13:04:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ECA527F94 for ; Mon, 20 Mar 2017 13:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6241927F95; Mon, 20 Mar 2017 13:04:25 +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 DCA1D27F7F for ; Mon, 20 Mar 2017 13:04:24 +0000 (UTC) Received: from localhost ([::1]:32890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwz2-0006Oo-2G for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Mar 2017 09:04:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0003uf-N1 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvS-00070z-Uc for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:46339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvS-00070W-M3 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:42 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id BDABB9FA0E1C5; Mon, 20 Mar 2017 13:00:37 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:40 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:21 +0000 Message-ID: <1490014826-4472-6-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 05/10] target-mips: replace few LOG_DISAS() with trace points 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- Makefile.objs | 1 + target/mips/trace-events | 5 +++++ target/mips/translate.c | 25 +++++++++++-------------- 3 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 target/mips/trace-events diff --git a/Makefile.objs b/Makefile.objs index e740500..6167e7b 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -157,6 +157,7 @@ trace-events-subdirs += audio trace-events-subdirs += net trace-events-subdirs += target/arm trace-events-subdirs += target/i386 +trace-events-subdirs += target/mips trace-events-subdirs += target/sparc trace-events-subdirs += target/s390x trace-events-subdirs += target/ppc diff --git a/target/mips/trace-events b/target/mips/trace-events new file mode 100644 index 0000000..4382408 --- /dev/null +++ b/target/mips/trace-events @@ -0,0 +1,5 @@ +# See docs/tracing.txt for syntax documentation. + +# target/mips/translate.c +mips_translate_c0(const char *instr, const char *rn, int reg, int sel) "%s %s (reg %d sel %d)" +mips_translate_tr(const char *instr, int rt, int u, int sel, int h) "%s (reg %d u %d sel %d h %d)" diff --git a/target/mips/translate.c b/target/mips/translate.c index fc11e15..78b7264 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -33,6 +33,7 @@ #include "sysemu/kvm.h" #include "exec/semihost.h" +#include "target/mips/trace.h" #include "trace-tcg.h" #include "exec/log.h" @@ -4866,9 +4867,7 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } - - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mfhc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mfhc0", rn, reg, sel); return; cp0_unimplemented: @@ -4941,8 +4940,8 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } + trace_mips_translate_c0("mthc0", rn, reg, sel); - (void)rn; /* avoid a compiler warning */ cp0_unimplemented: qemu_log_mask(LOG_UNIMP, "mthc0 %s (reg %d sel %d)\n", rn, reg, sel); } @@ -5622,8 +5621,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mfc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mfc0", rn, reg, sel); return; cp0_unimplemented: @@ -6284,8 +6282,8 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mtc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mtc0", rn, reg, sel); + /* For simplicity assume that all writes can cause interrupts. */ if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); @@ -6923,8 +6921,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("dmfc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("dmfc0", rn, reg, sel); return; cp0_unimplemented: @@ -7583,8 +7580,8 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("dmtc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("dmtc0", rn, reg, sel); + /* For simplicity assume that all writes can cause interrupts. */ if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); @@ -7803,7 +7800,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd, default: goto die; } - LOG_DISAS("mftr (reg %d u %d sel %d h %d)\n", rt, u, sel, h); + trace_mips_translate_tr("mftr", rt, u, sel, h); gen_store_gpr(t0, rd); tcg_temp_free(t0); return; @@ -8008,7 +8005,7 @@ static void gen_mttr(CPUMIPSState *env, DisasContext *ctx, int rd, int rt, default: goto die; } - LOG_DISAS("mttr (reg %d u %d sel %d h %d)\n", rd, u, sel, h); + trace_mips_translate_tr("mttr", rd, u, sel, h); tcg_temp_free(t0); return;