qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Wu, Fei" <fei2.wu@intel.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	<alex.bennee@linaro.org>, <qemu-devel@nongnu.org>
Cc: "Vanderson M . do Rosario" <vandersonmr2@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH v13 04/10] accel/tcg: add jit stats and time to TBStatistics
Date: Tue, 30 May 2023 13:01:06 +0800	[thread overview]
Message-ID: <ddc552ba-c95d-4b31-01d2-a6d70a978f1c@intel.com> (raw)
In-Reply-To: <98196efc-213f-3351-1564-5008ccd90f36@linaro.org>

On 5/30/2023 12:07 PM, Richard Henderson wrote:
> On 5/29/23 04:49, Fei Wu wrote:
>> +/*
>> + * The TCGProfile structure holds data for analysing the quality of
>> + * the code generation. The data is split between stuff that is valid
>> + * for the lifetime of a single translation and things that are valid
>> + * for the lifetime of the translator. As the former is reset for each
>> + * new translation so it should be copied elsewhere if you want to
>> + * keep it.
>> + *
>> + * The structure is safe to access within the context of translation
>> + * but accessing the data from elsewhere should be done with safe
>> + * work.
>> + */
>> +typedef struct TCGProfile {
>> +
>> +    struct {
>> +        int nb_guest_insns;
>> +        int nb_spills;
>> +        int nb_ops_pre_opt;
>> +
>> +        int del_op_count;
>> +        int temp_count;
>> +    } translation;
>> +
>> +    int64_t cpu_exec_time;
>> +    int64_t op_count; /* total insn count */
>> +    int64_t code_in_len;
>> +    int64_t code_out_len;
>> +    int64_t search_out_len;
>> +
>> +    /* Timestamps during translation  */
>> +    uint64_t gen_start_time;
>> +    uint64_t gen_ir_done_time;
>> +    uint64_t gen_opt_done_time;
>> +    uint64_t gen_la_done_time;
>> +    uint64_t gen_code_done_time;
>> +
>> +    /* Lifetime count of TCGOps per TCGContext */
>> +    uint64_t table_op_count[NB_OPS];
>> +} TCGProfile;
>> +
> 
> Why have you added this back?
> 
> The whole point of removing CONFIG_PROFILE to begin was to have all new
> code.  Not to remove it then reintroduce it unchanged.
> 
> In tcg_gen_code, you have access to the TranslationBlock as s->gen_tb. 
> There is zero point to accumulating into TCGProfile, when you could be
> accumulating into TCGStatistics directly.
> 
TCGProfile contains global wide (per TCGContext) stats, but TBStatistics
is TB specific, some info in TCGProfile such as table_op_count is not
able to be summed up from TBStatistics. The per-translation stats in
TCGProfile may be removed indeed.

Thanks,
Fei.

> 
> r~



  reply	other threads:[~2023-05-30  5:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 11:49 [PATCH v13 00/10] TCG code quality tracking Fei Wu
2023-05-29 11:49 ` [PATCH v13 01/10] accel/tcg: remove CONFIG_PROFILER Fei Wu
2023-05-29 21:12   ` Richard Henderson
2023-05-29 11:49 ` [PATCH v13 02/10] accel/tcg: introduce TBStatistics structure Fei Wu
2023-05-29 11:49 ` [PATCH v13 03/10] accel: collecting TB execution count Fei Wu
2023-05-29 11:49 ` [PATCH v13 04/10] accel/tcg: add jit stats and time to TBStatistics Fei Wu
2023-05-30  4:07   ` Richard Henderson
2023-05-30  5:01     ` Wu, Fei [this message]
2023-05-30  6:16       ` Wu, Fei
2023-05-30 10:08         ` Alex Bennée
2023-05-31  0:46           ` Wu, Fei
2023-05-31  2:05           ` Wu, Fei
2023-06-01 11:51             ` Alex Bennée
2023-06-01 12:48               ` Wu, Fei
2023-06-01 15:26                 ` Richard Henderson
2023-05-29 11:49 ` [PATCH v13 05/10] debug: add -d tb_stats to control TBStatistics collection: Fei Wu
2023-05-29 11:49 ` [PATCH v13 06/10] monitor: adding tb_stats hmp command Fei Wu
2023-05-29 11:49 ` [PATCH v13 07/10] tb-stats: reset the tracked TBs on a tb_flush Fei Wu
2023-05-29 11:49 ` [PATCH v13 08/10] Adding info [tb-list|tb] commands to HMP (WIP) Fei Wu
2023-05-29 11:49 ` [PATCH v13 09/10] tb-stats: dump hot TBs at the end of the execution Fei Wu
2023-05-29 11:49 ` [PATCH v13 10/10] docs: add tb-stats how to Fei Wu

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=ddc552ba-c95d-4b31-01d2-a6d70a978f1c@intel.com \
    --to=fei2.wu@intel.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=vandersonmr2@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).