All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mohamad.gebai@gmail.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] trace: instrument and trace tcg tb flush activity
Date: Tue, 15 Jul 2014 14:12:13 +0100	[thread overview]
Message-ID: <8738e2yd40.fsf@linaro.org> (raw)
In-Reply-To: <53C51B56.6010509@suse.de>


Andreas Färber writes:

> Hi,
>
> Am 15.07.2014 13:42, schrieb Alex Bennée:
<snip>
>> index df977c8..8376678 100644
>> --- a/include/qom/cpu.h
>> +++ b/include/qom/cpu.h
>> @@ -243,6 +243,10 @@ struct CPUState {
>>      void *env_ptr; /* CPUArchState */
>>      struct TranslationBlock *current_tb;
>>      struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];
>> +    struct {
>> +        int     hits;
>> +        int     misses;
>
> Is anything else going to be added here? If not, the indentation can be
> dropped.

At the moment probably not.

>
>> +    } tb_jmp_cache_stats;
>
> This is lacking documentation. Should be trivial to add for this field
> (not here, above the struct). To document the subfields we may need to
> name the struct.

Would not a simple comment be enough?

>
>>      struct GDBRegisterState *gdb_regs;
>>      int gdb_num_regs;
>>      int gdb_num_g_regs;
>> @@ -584,6 +588,15 @@ void cpu_exit(CPUState *cpu);
>>   */
>>  void cpu_resume(CPUState *cpu);
>>  
>> +
>> +/**
>> + * tb_flush_all_jmp_cache:
>> + * @cpu: The CPU jmp cache to flush
>> + *
>> + * Flush all the entries from the cpu fast jump cache
>
> "CPU" for consistency

OK

>
<snip>
>> +#ifndef CONFIG_TRACE_NOP
>> +static inline void trace_inc_counter(int *counter) {
>> +    int cnt = *counter;
>> +    cnt++;
>> +    *counter = cnt;
>> +}
>> +#else
>> +static inline void trace_inc_counter(int *counter) { /* do nothing */ }
>> +#endif
>> +
>>  #endif  /* TRACE_H */
>
> Coding Style issues with the first function. For simplicity just keep
> the first implementation but with the proper brace placement, and then
> just put the #ifdef into the function body. That avoids the signatures
> getting out of sync.

mea-culpa, I forgot to run checkpatch.pl....
>>  
>>      memset(tcg_ctx.tb_ctx.tb_phys_hash, 0, sizeof(tcg_ctx.tb_ctx.tb_phys_hash));
>> @@ -1520,6 +1530,8 @@ void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
>>      i = tb_jmp_cache_hash_page(addr);
>>      memset(&cpu->tb_jmp_cache[i], 0,
>>             TB_JMP_PAGE_SIZE * sizeof(TranslationBlock *));
>
> Can this one be dropped, too?

No, this is only a partial invalidation. I did toy with instrumenting
how many entries are flushed but it didn't seem the be worth it given
with the current architecture there is not much we can do.

>
>> +
>> +    trace_tb_flush_jump_cache(addr);
>>  }
>>  
>>  void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
>
> Cheers,
> Andreas

-- 
Alex Bennée

  reply	other threads:[~2014-07-15 13:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 11:42 [Qemu-devel] [PATCH v2 0/3] some TCG related trace patches Alex Bennée
2014-07-15 11:42 ` [Qemu-devel] [PATCH v2 1/3] trace: teach lttng backend to use format strings Alex Bennée
2014-08-01  9:05   ` Alex Bennée
2014-08-01 12:54     ` Stefan Hajnoczi
2014-07-15 11:42 ` [Qemu-devel] [PATCH v2 2/3] trace: add some tcg tracing support Alex Bennée
2014-07-15 11:42 ` [Qemu-devel] [PATCH v2 3/3] trace: instrument and trace tcg tb flush activity Alex Bennée
2014-07-15 12:15   ` Andreas Färber
2014-07-15 13:12     ` Alex Bennée [this message]
2014-07-15 12:23   ` Peter Maydell
2014-07-15 13:07     ` Peter Maydell
2014-07-15 13:10     ` Alex Bennée
2014-07-15 13:19   ` Paolo Bonzini
2014-07-15 14:16     ` Alex Bennée
2014-07-15 20:11       ` Paolo Bonzini
2014-07-15 20:29         ` Peter Maydell
2014-07-15 20:38           ` Paolo Bonzini

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=8738e2yd40.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=afaerber@suse.de \
    --cc=mohamad.gebai@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 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.