Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/7] gdb.perf/: Add JIT performance test
@ 2022-05-30 22:11 Ilya Leoshkevich via Gdb-patches
  2022-05-30 22:11 ` [PATCH v2 1/7] gdb.perf/: Fix tcl_string_list_to_python_list {x} Ilya Leoshkevich via Gdb-patches
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Ilya Leoshkevich via Gdb-patches @ 2022-05-30 22:11 UTC (permalink / raw)
  To: Tom Tromey, Andrew Burgess
  Cc: Ulrich Weigand, Andreas Arnez, gdb-patches, Pedro Alves,
	Ilya Leoshkevich

Hi,

This series implements a JIT performance test as discussed in [1].
Patch 1 is a small fix, patches 2-6 are preparations and patch 7 is
the test itself.

ChangeLog:
v1: https://sourceware.org/pipermail/gdb-patches/2022-May/189427.html
v1 -> v2:
* Make sure shared objects contain virtual addresses they are loaded
  at by reusing parts of jit-elf-helpers.exp.  By default, virtual
  addresses in all shared objects are relative to 0 - this creates a
  lots of overlaps and forces sort_cmp () to go through the slow "Sort
  on sequence number of the objfile in the chain" path, which is not a
  useful performance testing scenario.
* Fix DEFAULT_BINARY_LINK_WITH_SHLIBS style (Andrew).
* Rename SHLIB to TOTAL_NR_SHLIBS (Andrew).
* Add SOLIB_COUNT (Andrew).
* Drop "gdb.perf/: Compile the binary with -DSHLIB", it's superseded by
  "Allow adjusting GenPerfTest compile options".

The test can be used as follows:

$ make build-perf -j"$(nproc)" RUNTESTFLAGS=jit.exp
$ make check-perf RUNTESTFLAGS=jit-check.exp GDB_PERFTEST_MODE=run

The results can be converted to gnuplot-friendly format as follows:

$ perl -ne 'if (/:register_times:(\d+) (.+)/) { print "$1 $2\n"; }' \
      <gdb.perf/outputs/jit/pieces/perftest.sum >jit.txt

I've uploaded the results to [2].  They are similar to the ones from
Andrew and show that [1] is an improvement.  The third result shown on
the chart is from [3] - with it I can pass the 10k JITed objects mark
and debug CoreCLR JIT with GDB.  It's still WIP though - the testsuite
shows a couple of failures.

Best regards,
Ilya

[1] https://sourceware.org/pipermail/gdb-patches/2022-May/189341.html
[2] https://github.com/iii-i/binutils-gdb/blob/section-map-20220530-2/gdb/testsuite/jit.png
[3] https://github.com/iii-i/binutils-gdb/commits/section-map-20220530-2

Ilya Leoshkevich (7):
  gdb.perf/: Fix tcl_string_list_to_python_list {x}
  gdb.perf/: Add binary_link_with_shlibs setting to GenPerfTest
  gdb.perf/: Allow adjusting GenPerfTest compile options
  gdb.base/: Introduce jit-protocol-util.h
  gdb.base/: Introduce jit_compile_options
  gdb.base/: Introduce n_jit_so_address
  gdb.perf/: Add JIT performance test

 gdb/testsuite/gdb.base/jit-elf-fork-main.c | 48 ++----------
 gdb/testsuite/gdb.base/jit-elf-main.c      | 48 ++----------
 gdb/testsuite/gdb.base/jit-elf-util.h      | 17 +++++
 gdb/testsuite/gdb.base/jit-protocol-util.h | 74 ++++++++++++++++++
 gdb/testsuite/gdb.base/jit-reader-host.c   |  8 +-
 gdb/testsuite/gdb.perf/jit-check.exp       | 25 +++++++
 gdb/testsuite/gdb.perf/jit-check.py        | 60 +++++++++++++++
 gdb/testsuite/gdb.perf/jit-solib.c         | 27 +++++++
 gdb/testsuite/gdb.perf/jit.c               | 87 ++++++++++++++++++++++
 gdb/testsuite/gdb.perf/jit.exp             | 79 ++++++++++++++++++++
 gdb/testsuite/lib/gen-perf-test.exp        | 54 +++++++++++---
 gdb/testsuite/lib/jit-elf-helpers.exp      | 22 ++++--
 gdb/testsuite/lib/perftest.exp             |  2 +-
 13 files changed, 439 insertions(+), 112 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/jit-protocol-util.h
 create mode 100644 gdb/testsuite/gdb.perf/jit-check.exp
 create mode 100644 gdb/testsuite/gdb.perf/jit-check.py
 create mode 100644 gdb/testsuite/gdb.perf/jit-solib.c
 create mode 100644 gdb/testsuite/gdb.perf/jit.c
 create mode 100644 gdb/testsuite/gdb.perf/jit.exp

-- 
2.35.3


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-03 10:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 22:11 [PATCH v2 0/7] gdb.perf/: Add JIT performance test Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 1/7] gdb.perf/: Fix tcl_string_list_to_python_list {x} Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 2/7] gdb.perf/: Add binary_link_with_shlibs setting to GenPerfTest Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 3/7] gdb.perf/: Allow adjusting GenPerfTest compile options Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 4/7] gdb.base/: Introduce jit-protocol-util.h Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 5/7] gdb.base/: Introduce jit_compile_options Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 6/7] gdb.base/: Introduce n_jit_so_address Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 7/7] gdb.perf/: Add JIT performance test Ilya Leoshkevich via Gdb-patches
2022-06-22  8:48 ` [PING] [PATCH v2 0/7] " Ilya Leoshkevich via Gdb-patches
2022-08-03 10:52 ` [PING^2] " Ilya Leoshkevich via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox