qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 3/5] tcg: add perfmap and jitdump


From: Philippe Mathieu-Daudé
Subject: Re: [PULL 3/5] tcg: add perfmap and jitdump
Date: Thu, 29 Jun 2023 13:31:46 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

Hi Richard, Alex,

On 16/1/23 23:36, Richard Henderson wrote:
From: Ilya Leoshkevich <iii@linux.ibm.com>

Add ability to dump /tmp/perf-<pid>.map and jit-<pid>.dump.
The first one allows the perf tool to map samples to each individual
translation block. The second one adds the ability to resolve symbol
names, line numbers and inspect JITed code.

Example of use:

     perf record qemu-x86_64 -perfmap ./a.out
     perf report

or

     perf record -k 1 qemu-x86_64 -jitdump ./a.out
     DEBUGINFOD_URLS= perf inject -j -i perf.data -o perf.data.jitted
     perf report -i perf.data.jitted

Co-developed-by: Vanderson M. do Rosario <vandersonmr2@gmail.com>
Co-developed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230112152013.125680-4-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  docs/devel/tcg.rst        |  23 +++
  accel/tcg/perf.h          |  49 +++++
  accel/tcg/perf.c          | 375 ++++++++++++++++++++++++++++++++++++++
  accel/tcg/translate-all.c |   7 +
  linux-user/exit.c         |   2 +
  linux-user/main.c         |  15 ++
  softmmu/vl.c              |  11 ++
  tcg/tcg.c                 |   2 +
  accel/tcg/meson.build     |   1 +
  qemu-options.hx           |  20 ++
  10 files changed, 505 insertions(+)
  create mode 100644 accel/tcg/perf.h
  create mode 100644 accel/tcg/perf.c


diff --git a/tcg/tcg.c b/tcg/tcg.c
index da91779890..9b7df71e7a 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -61,6 +61,7 @@
  #include "exec/log.h"
  #include "tcg/tcg-ldst.h"
  #include "tcg-internal.h"
+#include "accel/tcg/perf.h"

Is it OK to include an header from QEMU's accel/tcg/ here?
I thought we wanted to keep tcg/ kinda independant (or maybe
this is already too late and this isn't a concern anymore).

  /* Forward declarations for functions declared in tcg-target.c.inc and
     used here. */
@@ -913,6 +914,7 @@ void tcg_prologue_init(TCGContext *s)
  #endif
prologue_size = tcg_current_code_size(s);
+    perf_report_prologue(s->code_gen_ptr, prologue_size);




reply via email to

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