[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 7/7] tcg: add trace events for [exit|goto]_tb and goto_ptr
From: |
Alex Bennée |
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 |
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
- [PATCH v1 0/7] plugins/next (windows, leaks, tcg tracing), Alex Bennée, 2021/05/05
- [PATCH v1 1/7] plugins: Update qemu-plugins.symbols to match qemu-plugins.h, Alex Bennée, 2021/05/05
- [PATCH v1 4/7] plugins/hotpages: Properly freed the hash table values, Alex Bennée, 2021/05/05
- [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
- [PATCH v1 3/7] plugins/hotblocks: Properly freed the hash table values, Alex Bennée, 2021/05/05
- [PATCH v1 7/7] tcg: add trace events for [exit|goto]_tb and goto_ptr,
Alex Bennée <=
- [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Alex Bennée, 2021/05/05
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Daniel P . Berrangé, 2021/05/05
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Alex Bennée, 2021/05/05
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Alex Bennée, 2021/05/05
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Daniel P . Berrangé, 2021/05/05
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Alex Bennée, 2021/05/17
- Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality, Stefan Hajnoczi, 2021/05/17
[PATCH v1 6/7] scripts/tracetool: don't barf validating TCG types, Alex Bennée, 2021/05/05