From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTVuw-0007X4-1B for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:29:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTVuq-0001SW-35 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:29:49 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:56244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTVup-0001S3-Rw for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:29:44 -0400 Date: Fri, 28 Mar 2014 16:29:37 +0400 (MSK) From: Kirill Batuzov In-Reply-To: <1395938253-9225-1-git-send-email-alex.bennee@linaro.org> Message-ID: References: <1395938253-9225-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1611182837-1396009779=:4071" Subject: Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-.map files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Alex_Benn=E9e?= Cc: Yeongkyoon Lee , qemu-devel@nongnu.org, Alexander Graf , Blue Swirl , Stefan Weil , Anthony Liguori , Amit Shah , Matthew Fernandez , Richard Henderson This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1611182837-1396009779=:4071 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 27 Mar 2014, alex.bennee@linaro.org wrote: > From: Alex Benn=C3=A9e >=20 > This allows the perf tool to map samples to each individual translation > block. This could be expanded for user space but currently it gives > enough information to find any hotblocks by other means. I'm in favor of this patch. Being able to profile guest code with perf will be very helpful for developing and tweaking optimizations in tcg. > @@ -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. > 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 > =20 > +/* seems better than pulling in all the tcg headers? */ > +extern void qemu_tcg_enable_perfmap(void); > + > static const char *data_dir[16]; > static int data_dir_idx; > const char *bios_name =3D NULL; > @@ -3345,6 +3348,9 @@ int main(int argc, char **argv, char **envp) > case QEMU_OPTION_DFILTER: > qemu_set_dfilter_ranges(optarg); > break; > + case QEMU_OPTION_PERFMAP: > + qemu_tcg_enable_perfmap(); > + break; > case QEMU_OPTION_s: > add_device_config(DEV_GDB, "tcp::" DEFAULT_GDBSTUB_POR= T); > break; >=20 Is there any particular reason it is not enabled for linux-user mode? I think it should work just fine in both modes. linux-user handles command line options by itself in a different manner (and it has it's own set of options, different from softmmu targets). The corresponding code is in linux-user/main.c. --=20 Kirill --8323329-1611182837-1396009779=:4071--