From patchwork Sun Sep 10 16:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 9946307 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 11A8B60348 for ; Sun, 10 Sep 2017 16:16:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFCF7289F6 for ; Sun, 10 Sep 2017 16:16:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E327828A1C; Sun, 10 Sep 2017 16:16:00 +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 8F23E289F6 for ; Sun, 10 Sep 2017 16:16:00 +0000 (UTC) Received: from localhost ([::1]:53543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr4tr-0003oH-L4 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Sep 2017 12:15:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr4tH-0003oA-Gx for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr4tC-0001Mu-ID for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:15:23 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:58499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr4tC-0001MZ-70 for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:15:18 -0400 Received: from correu-2.ac.upc.es (correu-2.ac.upc.es [147.83.30.92]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v8AGFGse020250; Sun, 10 Sep 2017 18:15:16 +0200 Received: from localhost (unknown [132.68.137.153]) by correu-2.ac.upc.es (Postfix) with ESMTPSA id EB440133E; Sun, 10 Sep 2017 18:15:10 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Sun, 10 Sep 2017 19:15:09 +0300 Message-Id: <150506010962.19604.7773376130922107594.stgit@frigg.lan> X-Mailer: git-send-email 2.14.1 In-Reply-To: <150505986682.19604.11937392314067517230.stgit@frigg.lan> References: <150505986682.19604.11937392314067517230.stgit@frigg.lan> User-Agent: StGit/0.18 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id v8AGFGse020250 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH 1/7] trace: Add event "guest_bbl_before" 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 , Stefan Hajnoczi , Peter Crosthwaite Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: LluĂ­s Vilanova --- accel/tcg/translator.c | 6 ++++++ trace-events | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index afa3af478a..91b3b0da32 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -13,6 +13,7 @@ #include "cpu.h" #include "tcg/tcg.h" #include "tcg/tcg-op.h" +#include "trace-tcg.h" #include "exec/exec-all.h" #include "exec/gen-icount.h" #include "exec/log.h" @@ -91,6 +92,11 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, } } + /* Tracing before */ + if (db->num_insns == 1) { + trace_guest_bbl_before_tcg(cpu, tcg_ctx.tcg_env, db->pc_first); + } + /* Disassemble one instruction. The translate_insn hook should update db->pc_next and db->is_jmp to indicate what should be done next -- either exiting this loop or locate the start of diff --git a/trace-events b/trace-events index 1f50f56d9d..d242f54254 100644 --- a/trace-events +++ b/trace-events @@ -88,6 +88,17 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) + +## Guest code + +# @vaddr: BBL's starting virtual address +# +# Mark start of BBL execution (before anything gets really executed). +# +# Mode: user, softmmu +# Targets: TCG(all) +vcpu tcg guest_bbl_before(uint64_t vaddr) "vaddr=0x%016"PRIx64, "vaddr=0x%016"PRIx64 + # @vaddr: Access' virtual address. # @info : Access' information (see below). #