[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v17 02/16] tcg: Record orig_nb_ops TCGContext
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v17 02/16] tcg: Record orig_nb_ops TCGContext |
|
Date: |
Tue, 3 Oct 2023 11:30:44 -0700 |
Remember the value of nb_ops before optimization.
To be copied into TBStatistics when desired.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 3 +++
tcg/tcg.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 82b4625773..e49574b7c7 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -564,6 +564,9 @@ struct TCGContext {
uint16_t gen_insn_end_off[TCG_MAX_INSNS];
uint64_t *gen_insn_data;
+ /* Used by TBStatistics */
+ int orig_nb_ops;
+
/* Exit to translator on overflow. */
sigjmp_buf jmp_trans;
};
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 71c25f1974..e90b0a0c69 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -5924,6 +5924,8 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb,
uint64_t pc_start)
int i, start_words, num_insns;
TCGOp *op;
+ s->orig_nb_ops = s->nb_ops;
+
if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP)
&& qemu_log_in_addr_range(pc_start))) {
FILE *logfile = qemu_log_trylock();
--
2.34.1
- [PATCH v17 00/16] TCG code quality tracking, Richard Henderson, 2023/10/03
- [PATCH v17 01/16] accel/tcg: Move HMP info jit and info opcount code, Richard Henderson, 2023/10/03
- [PATCH v17 03/16] tcg: Record nb_deleted_ops in TCGContext, Richard Henderson, 2023/10/03
- [PATCH v17 02/16] tcg: Record orig_nb_ops TCGContext,
Richard Henderson <=
- [PATCH v17 08/16] accel/tcg: Add tb_stats hmp command, Richard Henderson, 2023/10/03
- [PATCH v17 05/16] accel/tcg: Add TBStatistics structure, Richard Henderson, 2023/10/03
- [PATCH v17 07/16] accel/tcg: Collect TB jit statistics, Richard Henderson, 2023/10/03
- [PATCH v17 04/16] tcg: Record nb_spills in TCGContext, Richard Henderson, 2023/10/03
- [PATCH v17 06/16] accel/tcg: Collect TB execution statistics, Richard Henderson, 2023/10/03
- [PATCH v17 11/16] accel/tcg: Add tb_stats_collect and tb_stats_dump, Richard Henderson, 2023/10/03