[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
Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-<pid>.map files
Sat, 29 Mar 2014 00:04:41 +0400
On 28.03.2014 20:34, Alex Bennée wrote:
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:
@@ -2575,6 +2579,8 @@ static inline int
tcg_gen_code_common(TCGContext *s, uint64_t target_pc,
/* Generate TB finalization at the end of block */
+ tcg_write_perfmap(gen_code_buf, s->code_ptr - gen_code_buf,
I think a part of the patch is missing here. tcg_gen_code_common does
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.
diff --git a/vl.c b/vl.c
index c036367..f1c3c3d 100644
@@ -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
* 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
* 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