qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-<pid>.ma


From: Kirill Batuzov
Subject: Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-<pid>.map files
Date: Sat, 29 Mar 2014 00:04:41 +0400
User-agent: Roundcube Webmail/0.8.5

On 28.03.2014 20:34, Alex Bennée wrote:

@@ -2575,6 +2579,8 @@ static inline int tcg_gen_code_common(TCGContext *s, uint64_t target_pc,
   the_end:
      /* Generate TB finalization at the end of block */
      tcg_out_tb_finalize(s);
+
+ tcg_write_perfmap(gen_code_buf, s->code_ptr - gen_code_buf, target_pc);
      return -1;
  }

I think a part of the patch is missing here. tcg_gen_code_common does not
have target_pc argument in current master.

Ahh yes - it's currently sitting on-top of my qemu-log series which
pulled target_pc into the tcg_gen_code_common loop for the -dfilter
patch. I'll be sending the updated series in a moment.

<snip>

diff --git a/vl.c b/vl.c
index c036367..f1c3c3d 100644
--- a/vl.c
+++ b/vl.c
@@ -123,6 +123,9 @@ int main(int argc, char **argv)
  #define MAX_VIRTIO_CONSOLES 1
  #define MAX_SCLP_CONSOLES 1

+/* seems better than pulling in all the tcg headers? */
+extern void qemu_tcg_enable_perfmap(void);
+

I'm surprised no one has pulled me up on this yet, perhaps it is just
less ugly!

I think I have a better solution for this. You can move qemu_tcg_enable_refmap and tcg_write_refmap away from tcg to translate-all.c (you'll need to rename them obviously). write_refmap should be called from cpu_gen_code. It has number of advantages:

* For writing refmap you do not need any backend details. The only thing you need is to know that some guest address has been translated to some host range. That is exactly what cpu_gen_code does. * In cpu_gen_code you have all needed information. No need to pull target_pc specifically. * Declaration could be moved somewhere into exec folder. To exec-all.h probably, but I'm not sure here. Anyway, you will not need tcg staff in unrelated areas any more. * You'll avoid writing map entries for tcg_gen_code_search_pc calls. This is good because tcg_gen_code_search_pc does not create new translation blocks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]