From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: cota@braap.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH v9 00/13] TCG code quality tracking and perf integration
Date: Mon, 7 Oct 2019 16:28:26 +0100 [thread overview]
Message-ID: <20191007152839.30804-1-alex.bennee@linaro.org> (raw)
Hi,
These are the bits of Vanderson's GSoC project which I think are ready
for merge(^) and would like get up-streamed before the code freeze
kicks in. It effectively removes the CONFIG_PROFILER support in favour
of a more dynamic and configurable TB Statistics subsystem. While not
in use it has no impact on the system apart a small amount of wasted
space in the TCGContext for each thread which is used to collect stats
during translation. When in use a TBStats structure is created for
each set of TBs that have the same address/flags combination. The most
basic tracking involves counting executions of each TB. You can also
enable JIT stats and sort by features such as spill count and
host/guest expansion ration.
For full performance analysis you can use -perf to output a JIT dump
that is compatible with the linux perf tool. This allows you to see
exactly which TBs are responsible for the majority of real execution
time. With the additional TB stats involved it will also include basic
information about the quality of that code.
The main changes from Vanderson's last post apart from general
clean-ups and g_autoptr'ing is I've dropped the "cfg" and "coverset"
commands. I dropped "cfg" because I wasn't happy about it navigated
the next TB in the chain. "coverset" tends to dump quite a lot of TBs
on a full system emulation so I wanted to think about a slightly
smoother UI experience.
^ and finally I think I'll also drop the "tb" command for the next
iteration because although useful it fails when the guest has
un-mapped pages and results in a exception getting delivered to the
guest which is less than ideal. See the comments for get_code_string.
However I've left it in this iteration so you can see a taste of the
future.
There are more notes on the project at the wiki page:
https://wiki.qemu.org/Features/TCGCodeQuality
Please review.
Alex Bennée (2):
tb-stats: reset the tracked TBs on a tb_flush
configure: remove the final bits of --profiler support
Vanderson M. do Rosario (11):
accel/tcg: introduce TBStatistics structure
accel: collecting TB execution count
accel: collecting JIT statistics
accel: replacing part of CONFIG_PROFILER with TBStats
accel: adding TB_JIT_TIME and full replacing CONFIG_PROFILER
debug: add -d tb_stats to control TBStatistics collection:
monitor: adding tb_stats hmp command
Adding info [tb-list|tb] commands to HMP (WIP)
tb-stats: dump hot TBs at the end of the execution
accel/tcg: adding integration with linux perf
tb-stats: adding TBStatistics info into perf dump
accel/tcg/Makefile.objs | 4 +-
accel/tcg/cpu-exec.c | 4 +
accel/tcg/perf/Makefile.objs | 1 +
accel/tcg/perf/jitdump.c | 206 +++++++++++
accel/tcg/perf/jitdump.h | 36 ++
accel/tcg/tb-stats.c | 662 ++++++++++++++++++++++++++++++++++
accel/tcg/tcg-runtime.c | 7 +
accel/tcg/tcg-runtime.h | 2 +
accel/tcg/translate-all.c | 173 +++++++--
accel/tcg/translator.c | 4 +
configure | 8 -
cpus.c | 14 +-
disas.c | 31 +-
docs/devel/tcg.rst | 15 +
hmp-commands-info.hx | 16 +
hmp-commands.hx | 17 +
include/exec/exec-all.h | 15 +-
include/exec/gen-icount.h | 10 +
include/exec/tb-context.h | 12 +
include/exec/tb-hash.h | 7 +
include/exec/tb-stats-dump.h | 21 ++
include/exec/tb-stats-flags.h | 31 ++
include/exec/tb-stats.h | 165 +++++++++
include/qemu-common.h | 3 +
include/qemu/log-for-trace.h | 4 +
include/qemu/log.h | 3 +
include/qemu/timer.h | 5 +-
linux-user/exit.c | 2 +
linux-user/main.c | 7 +
monitor/misc.c | 127 +++++--
os-posix.c | 5 +
qemu-options.hx | 11 +
stubs/Makefile.objs | 1 +
stubs/tb-stats.c | 32 ++
tcg/tcg.c | 221 +++---------
tcg/tcg.h | 34 +-
util/log.c | 89 ++++-
vl.c | 10 +-
38 files changed, 1727 insertions(+), 288 deletions(-)
create mode 100644 accel/tcg/perf/Makefile.objs
create mode 100644 accel/tcg/perf/jitdump.c
create mode 100644 accel/tcg/perf/jitdump.h
create mode 100644 accel/tcg/tb-stats.c
create mode 100644 include/exec/tb-stats-dump.h
create mode 100644 include/exec/tb-stats-flags.h
create mode 100644 include/exec/tb-stats.h
create mode 100644 stubs/tb-stats.c
--
2.20.1
next reply other threads:[~2019-10-07 15:34 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-07 15:28 Alex Bennée [this message]
2019-10-07 15:28 ` [PATCH v9 01/13] accel/tcg: introduce TBStatistics structure Alex Bennée
2019-10-08 12:35 ` Richard Henderson
2019-12-13 11:14 ` Alex Bennée
2019-10-07 15:28 ` [PATCH v9 02/13] accel: collecting TB execution count Alex Bennée
2019-10-08 13:10 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 03/13] accel: collecting JIT statistics Alex Bennée
2019-10-08 13:38 ` Richard Henderson
2019-12-13 11:51 ` Alex Bennée
2019-10-07 15:28 ` [PATCH v9 04/13] accel: replacing part of CONFIG_PROFILER with TBStats Alex Bennée
2019-10-08 13:58 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 05/13] accel: adding TB_JIT_TIME and full replacing CONFIG_PROFILER Alex Bennée
2019-10-08 15:25 ` Richard Henderson
2019-12-13 21:49 ` Alex Bennée
2019-12-16 20:34 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 06/13] debug: add -d tb_stats to control TBStatistics collection: Alex Bennée
2019-10-08 15:34 ` Richard Henderson
2019-10-08 15:49 ` Alex Bennée
2019-10-07 15:28 ` [PATCH v9 07/13] monitor: adding tb_stats hmp command Alex Bennée
2019-10-08 15:48 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 08/13] tb-stats: reset the tracked TBs on a tb_flush Alex Bennée
2019-10-08 18:00 ` Richard Henderson
2019-10-08 19:18 ` Alex Bennée
2019-10-07 15:28 ` [PATCH v9 09/13] Adding info [tb-list|tb] commands to HMP (WIP) Alex Bennée
2019-10-08 18:50 ` Richard Henderson
2019-10-08 19:36 ` Alex Bennée
2019-10-09 9:44 ` Dr. David Alan Gilbert
2019-10-07 15:28 ` [PATCH v9 10/13] tb-stats: dump hot TBs at the end of the execution Alex Bennée
2019-10-08 19:05 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 11/13] accel/tcg: adding integration with linux perf Alex Bennée
2019-10-08 19:33 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 12/13] tb-stats: adding TBStatistics info into perf dump Alex Bennée
2019-10-08 19:46 ` Richard Henderson
2019-10-07 15:28 ` [PATCH v9 13/13] configure: remove the final bits of --profiler support Alex Bennée
2019-10-08 19:39 ` Richard Henderson
2019-10-07 18:14 ` [PATCH v9 00/13] TCG code quality tracking and perf integration no-reply
2019-10-07 18:47 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191007152839.30804-1-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).