public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix remainder of "make check-perf" bit rot
@ 2021-07-06 11:43 Pedro Alves
  2021-07-06 11:43 ` [PATCH 1/3] Fix all DUPLICATE problems in testsuite/gdb.perf/ Pedro Alves
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pedro Alves @ 2021-07-06 11:43 UTC (permalink / raw)
  To: gdb-patches

These commits fix all PATH, DUPLICATE and FAIL problems seen when
running "make check-perf", on GNU/Linux.

Before:

  # of expected passes            20082
  # of unexpected failures        1
  # of paths in test names        14
  # of duplicate test names       6008

After:

  # of expected passes            20083

Pedro Alves (3):
  Fix all DUPLICATE problems in testsuite/gdb.perf/
  Fix all PATH problems in testsuite/gdb.perf/
  Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()'

 gdb/testsuite/gdb.perf/disassemble.py   |  7 ++++---
 gdb/testsuite/gdb.perf/skip-command.exp |  9 ++++++---
 gdb/testsuite/lib/perftest.exp          | 12 +++++++++---
 3 files changed, 19 insertions(+), 9 deletions(-)


base-commit: 46f2c22eabb3d2b13ed56f528a4f45dc5e8f3a32
-- 
2.26.2


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

* [PATCH 1/3] Fix all DUPLICATE problems in testsuite/gdb.perf/
  2021-07-06 11:43 [PATCH 0/3] Fix remainder of "make check-perf" bit rot Pedro Alves
@ 2021-07-06 11:43 ` Pedro Alves
  2021-07-06 11:43 ` [PATCH 2/3] Fix all PATH " Pedro Alves
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2021-07-06 11:43 UTC (permalink / raw)
  To: gdb-patches

Currently running "make check-perf" shows:

 ...
 # of duplicate test names       6008
 ...

All those duplicate test names come from gdb.perf/skip-command.exp.
This commit fixes them, using with_test_prefix.

gdb/testsuite/
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* gdb.perf/skip-command.exp (run_skip_bench): Wrap each for
	iteration in with_test_prefix.

Change-Id: I38501cf70bc6b60306ee7228996ee7bcd858dc1b
---
 gdb/testsuite/gdb.perf/skip-command.exp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.perf/skip-command.exp b/gdb/testsuite/gdb.perf/skip-command.exp
index e396262af06..d9f31a7e8f5 100644
--- a/gdb/testsuite/gdb.perf/skip-command.exp
+++ b/gdb/testsuite/gdb.perf/skip-command.exp
@@ -101,9 +101,12 @@ proc run_skip_bench { kind text } {
     gdb_test_no_output "set variable flag = 1"
 
     for { set i 0 } { $i < 5 } { incr i } {
-	set nr_skips [expr $i * $SKIP_DIRECTIVE_COUNT]
-	install_skips $kind $text $nr_skips
-	gdb_test_python_run "SkipCommand\(\"skip-$kind-$nr_skips\", ${SKIP_STEP_COUNT}\)"
+	with_test_prefix "iter $i" {
+	    set nr_skips [expr $i * $SKIP_DIRECTIVE_COUNT]
+	    install_skips $kind $text $nr_skips
+	    gdb_test_python_run \
+		"SkipCommand\(\"skip-$kind-$nr_skips\", ${SKIP_STEP_COUNT}\)"
+	}
     }
 
     gdb_test "set variable flag = 0"
-- 
2.26.2


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

* [PATCH 2/3] Fix all PATH problems in testsuite/gdb.perf/
  2021-07-06 11:43 [PATCH 0/3] Fix remainder of "make check-perf" bit rot Pedro Alves
  2021-07-06 11:43 ` [PATCH 1/3] Fix all DUPLICATE problems in testsuite/gdb.perf/ Pedro Alves
@ 2021-07-06 11:43 ` Pedro Alves
  2021-07-06 11:43 ` [PATCH 3/3] Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()' Pedro Alves
  2021-07-28 17:58 ` [PATCH 0/3] Fix remainder of "make check-perf" bit rot Tom Tromey
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2021-07-06 11:43 UTC (permalink / raw)
  To: gdb-patches

Currently "make check-perf" triggers ~40 PATH messages in gdb.sum:

  ...
  PATH: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
  PATH: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
  ...

This commit fixes them.  E.g. before/after gdb.sum diff:

 -PASS: gdb.perf/backtrace.exp: python import os, sys
 -PASS: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build-master/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
 -PATH: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build-master/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
 -PASS: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build-master/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
 -PATH: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build-master/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
 +PASS: gdb.perf/backtrace.exp: setup perftest: python import os, sys
 +PASS: gdb.perf/backtrace.exp: setup perftest: python sys.path.insert(0, os.path.abspath("${srcdir}/gdb.perf/lib"))
 +PASS: gdb.perf/backtrace.exp: setup perftest: python exec (open ('${srcdir}/gdb.perf/backtrace.py').read ())

gdb/testsuite/
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* lib/perftest.exp (PerfTest::_setup_perftest): Use
	with_test_prefix.  Add explicit test names to python invocations,
	with "$srcdir" not expanded.

Change-Id: I50a31b04b7abdea754139509e4a34ae9263118a4
---
 gdb/testsuite/lib/perftest.exp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/lib/perftest.exp b/gdb/testsuite/lib/perftest.exp
index de995188090..205bcb5f0e3 100644
--- a/gdb/testsuite/lib/perftest.exp
+++ b/gdb/testsuite/lib/perftest.exp
@@ -25,9 +25,15 @@ namespace eval PerfTest {
 	set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 
 	# Set sys.path for module perftest.
-	gdb_test_no_output "python import os, sys"
-	gdb_test_no_output "python sys.path.insert\(0, os.path.abspath\(\"${srcdir}/${subdir}/lib\"\)\)"
-	gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+	with_test_prefix "setup perftest" {
+	    gdb_test_no_output "python import os, sys"
+	    gdb_test_no_output \
+		"python sys.path.insert\(0, os.path.abspath\(\"${srcdir}/${subdir}/lib\"\)\)" \
+		"python sys.path.insert\(0, os.path.abspath\(\"\${srcdir}/${subdir}/lib\"\)\)"
+	    gdb_test_no_output \
+		"python exec (open ('${remote_python_file}').read ())" \
+		"python exec (open ('\${srcdir}/${subdir}/${testfile}.py').read ())"
+	}
     }
 
     # A private method to do some cleanups when performance test is
-- 
2.26.2


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

* [PATCH 3/3] Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()'
  2021-07-06 11:43 [PATCH 0/3] Fix remainder of "make check-perf" bit rot Pedro Alves
  2021-07-06 11:43 ` [PATCH 1/3] Fix all DUPLICATE problems in testsuite/gdb.perf/ Pedro Alves
  2021-07-06 11:43 ` [PATCH 2/3] Fix all PATH " Pedro Alves
@ 2021-07-06 11:43 ` Pedro Alves
  2021-07-28 17:58 ` [PATCH 0/3] Fix remainder of "make check-perf" bit rot Tom Tromey
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2021-07-06 11:43 UTC (permalink / raw)
  To: gdb-patches

We currently have one FAIL while running "make check-perf":

  PerfTest::assemble, run ...
  python Disassemble().run()
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/perftest.py", line 64, in run
      self.warm_up()
    File "<string>", line 25, in warm_up
  gdb.error: No symbol "ada_evaluate_subexp" in current context.
  Error while executing Python code.
  (gdb) FAIL: gdb.perf/disassemble.exp: python Disassemble().run()
  ...

The gdb.perf/disassemble.exp testcase debugs GDB with itself, runs to
main, and then disassembles a few GDB functions.  The problem is that
most(!) functions it is trying to disassemble are now gone...

This commit fixes the issue by simply picking some other functions to
disassemble.

It would perhaps be better to come up with some test program to
disassemble, one that would stay the same throughout the years,
instead of disassembling GDB itself.  I don't know why that wasn't
done to begin with.  I'll have to leave that for another rainy day,
though.

gdb/testsuite/
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* gdb.perf/disassemble.py (Disassemble::warm_up): Disassemble
	evaluate_subexp_do_call instead of ada_evaluate_subexp.
	(Disassemble::warm_up): Disassemble "captured_main",
	"run_inferior_call" and "update_global_location_list" instead of
	"evaluate_subexp_standard" and "c_parse_internal".

Change-Id: I89d1cca89ce2e495dea5096e439685739cc0d3df
---
 gdb/testsuite/gdb.perf/disassemble.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.perf/disassemble.py b/gdb/testsuite/gdb.perf/disassemble.py
index 89634912fba..bbb2a16fda1 100644
--- a/gdb/testsuite/gdb.perf/disassemble.py
+++ b/gdb/testsuite/gdb.perf/disassemble.py
@@ -21,14 +21,15 @@ class Disassemble(perftest.TestCaseWithBasicMeasurements):
         super(Disassemble, self).__init__("disassemble")
 
     def warm_up(self):
-        do_test_command = "disassemble ada_evaluate_subexp"
+        do_test_command = "disassemble evaluate_subexp_do_call"
         gdb.execute(do_test_command, False, True)
 
     def _do_test(self, c):
         for func in [
-            "evaluate_subexp_standard",
+            "captured_main",
             "handle_inferior_event",
-            "c_parse_internal",
+            "run_inferior_call",
+            "update_global_location_list",
         ]:
             do_test_command = "disassemble %s" % func
             for _ in range(c + 1):
-- 
2.26.2


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

* Re: [PATCH 0/3] Fix remainder of "make check-perf" bit rot
  2021-07-06 11:43 [PATCH 0/3] Fix remainder of "make check-perf" bit rot Pedro Alves
                   ` (2 preceding siblings ...)
  2021-07-06 11:43 ` [PATCH 3/3] Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()' Pedro Alves
@ 2021-07-28 17:58 ` Tom Tromey
  2021-09-24 16:44   ` Pedro Alves
  3 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2021-07-28 17:58 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> These commits fix all PATH, DUPLICATE and FAIL problems seen when
Pedro> running "make check-perf", on GNU/Linux.

These all look fine to me.

Tom

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

* Re: [PATCH 0/3] Fix remainder of "make check-perf" bit rot
  2021-07-28 17:58 ` [PATCH 0/3] Fix remainder of "make check-perf" bit rot Tom Tromey
@ 2021-09-24 16:44   ` Pedro Alves
  0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2021-09-24 16:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2021-07-28 6:58 p.m., Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:
> 
> Pedro> These commits fix all PATH, DUPLICATE and FAIL problems seen when
> Pedro> running "make check-perf", on GNU/Linux.
> 
> These all look fine to me.

Thanks much, Tromey.  Finally managed to merge this.

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

end of thread, other threads:[~2021-09-24 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 11:43 [PATCH 0/3] Fix remainder of "make check-perf" bit rot Pedro Alves
2021-07-06 11:43 ` [PATCH 1/3] Fix all DUPLICATE problems in testsuite/gdb.perf/ Pedro Alves
2021-07-06 11:43 ` [PATCH 2/3] Fix all PATH " Pedro Alves
2021-07-06 11:43 ` [PATCH 3/3] Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()' Pedro Alves
2021-07-28 17:58 ` [PATCH 0/3] Fix remainder of "make check-perf" bit rot Tom Tromey
2021-09-24 16:44   ` Pedro Alves

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 read-only IMAP folder(s) and NNTP newsgroup(s).