mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
tcg: add perfmap and jitdump
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>
This commit is contained in:
parent
7c10cb38cc
commit
5584e2dbe8
10 changed files with 505 additions and 0 deletions
11
softmmu/vl.c
11
softmmu/vl.c
|
@ -96,6 +96,9 @@
|
|||
#include "fsdev/qemu-fsdev.h"
|
||||
#endif
|
||||
#include "sysemu/qtest.h"
|
||||
#ifdef CONFIG_TCG
|
||||
#include "accel/tcg/perf.h"
|
||||
#endif
|
||||
|
||||
#include "disas/disas.h"
|
||||
|
||||
|
@ -2926,6 +2929,14 @@ void qemu_init(int argc, char **argv)
|
|||
case QEMU_OPTION_DFILTER:
|
||||
qemu_set_dfilter_ranges(optarg, &error_fatal);
|
||||
break;
|
||||
#if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
|
||||
case QEMU_OPTION_perfmap:
|
||||
perf_enable_perfmap();
|
||||
break;
|
||||
case QEMU_OPTION_jitdump:
|
||||
perf_enable_jitdump();
|
||||
break;
|
||||
#endif
|
||||
case QEMU_OPTION_seed:
|
||||
qemu_guest_random_seed_main(optarg, &error_fatal);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue