All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	minyihh@uci.edu, robhenry@microsoft.com, vilanova@imperial.ac.uk,
	mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com,
	cota@braap.org, stefanha@redhat.com, mohamad.gebai@gmail.com,
	kuhn.chenqun@huawei.com, matheus.ferst@eldorado.org.br
Subject: [PATCH v1 7/7] tcg: add trace events for [exit|goto]_tb and goto_ptr
Date: Wed,  5 May 2021 10:22:59 +0100	[thread overview]
Message-ID: <20210505092259.8202-8-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org>

These are generic trace points in common helper functions used by all
front ends. They mainly serve as additional in-tree examples of TCG
trace points and can be used to compare and contrast with getting
similar information from the TCG plugins.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tcg/tcg-op.c |  8 ++++++++
 trace-events | 12 ++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 70475773f4..46b00f6e9b 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -2687,6 +2687,8 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx)
         tcg_debug_assert(idx == TB_EXIT_REQUESTED);
     }
 
+    trace_exit_tb_tcg(val & ~TB_EXIT_MASK, val & TB_EXIT_MASK);
+
     plugin_gen_disable_mem_helpers();
     tcg_gen_op1i(INDEX_op_exit_tb, val);
 }
@@ -2703,6 +2705,9 @@ void tcg_gen_goto_tb(unsigned idx)
     plugin_gen_disable_mem_helpers();
     /* When not chaining, we simply fall through to the "fallback" exit.  */
     if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
+
+        trace_goto_tb_tcg(idx);
+
         tcg_gen_op1i(INDEX_op_goto_tb, idx);
     }
 }
@@ -2715,6 +2720,9 @@ void tcg_gen_lookup_and_goto_ptr(void)
         plugin_gen_disable_mem_helpers();
         ptr = tcg_temp_new_ptr();
         gen_helper_lookup_tb_ptr(ptr, cpu_env);
+
+        trace_goto_ptr_tcg(ptr);
+
         tcg_gen_op1i(INDEX_op_goto_ptr, tcgv_ptr_arg(ptr));
         tcg_temp_free_ptr(ptr);
     } else {
diff --git a/trace-events b/trace-events
index ac7cef9335..1fcb8c4dda 100644
--- a/trace-events
+++ b/trace-events
@@ -136,6 +136,18 @@ vcpu guest_cpu_reset(void)
 # Targets: TCG(all)
 vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d"
 
+# Mode: user, softmmu
+# Targets: TCG(all)
+tcg exit_tb(uint64_t ptr, uint64_t idx) "tb=0x%016"PRIx64"/%"PRId64"", "tb=0x%016"PRIx64"/%"PRId64""
+
+# Mode: user, softmmu
+# Targets: TCG(all)
+tcg goto_tb(uint64_t idx) "idx=%"PRId64"", "idx=%"PRId64""
+
+# Mode: user, softmmu
+# Targets: TCG(all)
+tcg goto_ptr(TCGv_ptr ptr) "", "ptr=%p"
+
 # include/user/syscall-trace.h
 
 # @num: System call number.
-- 
2.20.1



      parent reply	other threads:[~2021-05-05  9:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  9:22 [PATCH v1 0/7] plugins/next (windows, leaks, tcg tracing) Alex Bennée
2021-05-05  9:22 ` [PATCH v1 1/7] plugins: Update qemu-plugins.symbols to match qemu-plugins.h Alex Bennée
2021-05-05  9:22 ` [PATCH v1 2/7] plugins: Move all typedef and type declaration to the front of the qemu-plugin.h Alex Bennée
2021-05-05  9:22 ` [PATCH v1 3/7] plugins/hotblocks: Properly freed the hash table values Alex Bennée
2021-05-05  9:22 ` [PATCH v1 4/7] plugins/hotpages: " Alex Bennée
2021-05-05  9:22 ` [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality Alex Bennée
2021-05-05  9:33   ` Daniel P. Berrangé
2021-05-05 10:35     ` Alex Bennée
2021-05-05 10:41       ` Alex Bennée
2021-05-05 10:52         ` Daniel P. Berrangé
2021-05-17 10:47           ` Alex Bennée
2021-05-17 13:44             ` Stefan Hajnoczi
2021-05-05  9:22 ` [PATCH v1 6/7] scripts/tracetool: don't barf validating TCG types Alex Bennée
2021-05-05  9:22 ` Alex Bennée [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210505092259.8202-8-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aaron@os.amperecomputing.com \
    --cc=cota@braap.org \
    --cc=kuhn.chenqun@huawei.com \
    --cc=mahmoudabdalghany@outlook.com \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=minyihh@uci.edu \
    --cc=mohamad.gebai@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=robhenry@microsoft.com \
    --cc=stefanha@redhat.com \
    --cc=vilanova@imperial.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.