From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id 4D0BA3858D20; Wed, 31 May 2023 18:51:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D0BA3858D20 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: 29470 The test suite should be made more flexible X-Act-Checkin: binutils-gdb X-Git-Author: Vladimir Mezentsev X-Git-Refname: refs/heads/master X-Git-Oldrev: 739f67599a85d7b809c0407765f8a7304f771e63 X-Git-Newrev: defb734195d055bbb80be04b6067a9bb80ff249d Message-Id: <20230531185118.4D0BA3858D20@sourceware.org> Date: Wed, 31 May 2023 18:51:18 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2023 18:51:18 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Ddefb734195d0= 55bbb80be04b6067a9bb80ff249d commit defb734195d055bbb80be04b6067a9bb80ff249d Author: Vladimir Mezentsev Date: Thu May 25 17:54:53 2023 -0700 gprofng: 29470 The test suite should be made more flexible =20 I add two new targets (check-extra, check-install) for gprofng testing: `make check` runs sanity testing for gprofng and takes ~30 secunds. `make check-extra` runs all gprofng tests and takes ~20 minutus. `make check-install` runs all gprofng tests and uses gprofng installa= tion. =20 On aarch64, there are unwind problems in libgp-collector.so. I set ACCT_FILTER to temporarily ignore problematic functions. =20 gprofng/ChangeLog 2023-05-25 Vladimir Mezentsev =20 PR gprofng/29470 * Makefile.am: Add check-extra, check-install. * Makefile.in: Rebuild * testsuite/config/default.exp: Set the GPROFNG variable. * testsuite/gprofng.display/display.exp: Updated the test list. * testsuite/gprofng.display/jsynprog/Intface.java: Correct copy= right. * testsuite/gprofng.display/jsynprog/Launcher.java: Likewise. * testsuite/gprofng.display/jsynprog/Makefile: Likewise. * testsuite/gprofng.display/jsynprog/Routine.java: Likewise. * testsuite/gprofng.display/jsynprog/Sub_Routine.java: Likewise. * testsuite/gprofng.display/jsynprog/cloop.cc: Likewise. * testsuite/gprofng.display/jsynprog/jsynprog.h: Likewise. * testsuite/gprofng.display/jsynprog/jsynprog.java: Correct cop= yright. Add the -j option to run the selected functions. * testsuite/gprofng.display/synprog/check_results.pl: Remove unused environment variable. * testsuite/gprofng.display/synprog/synprog.c: Updated DEFAULT_= COMMAND. * testsuite/lib/Makefile.skel: Apply $(ACCT_FILTER). * testsuite/lib/acct.pm: Ignore errors when $(ACCT_FILTER) is s= et. * testsuite/lib/display-lib.exp: Add TARGET_FLAGS in make_args. Diff: --- gprofng/Makefile.am | 9 +- gprofng/Makefile.in | 9 +- gprofng/testsuite/config/default.exp | 6 + gprofng/testsuite/gprofng.display/display.exp | 58 ++++---- .../gprofng.display/jsynprog/Intface.java | 21 ++- .../gprofng.display/jsynprog/Launcher.java | 21 ++- .../testsuite/gprofng.display/jsynprog/Makefile | 2 +- .../gprofng.display/jsynprog/Routine.java | 24 ++- .../gprofng.display/jsynprog/Sub_Routine.java | 25 +++- .../testsuite/gprofng.display/jsynprog/cloop.cc | 23 ++- .../testsuite/gprofng.display/jsynprog/jsynprog.h | 22 ++- .../gprofng.display/jsynprog/jsynprog.java | 161 ++++++++++++++---= ---- .../gprofng.display/synprog/check_results.pl | 12 +- .../testsuite/gprofng.display/synprog/synprog.c | 2 +- gprofng/testsuite/lib/Makefile.skel | 3 +- gprofng/testsuite/lib/acct.pm | 27 +++- gprofng/testsuite/lib/display-lib.exp | 5 +- 17 files changed, 311 insertions(+), 119 deletions(-) diff --git a/gprofng/Makefile.am b/gprofng/Makefile.am index 9658efd348c..b0c960a0ae0 100644 --- a/gprofng/Makefile.am +++ b/gprofng/Makefile.am @@ -52,9 +52,12 @@ AM_MAKEFLAGS =3D \ GPROFNG_CPPFLAGS=3D"$(GPROFNG_CPPFLAGS)" =20 if TCL_TRY -check-DEJAGNU: site.exp development.exp +.PHONY: check-small check-extra check-install + +check-DEJAGNU: check-small + +check-small check-extra check-install: site.exp development.exp srcroot=3D`cd $(srcdir) && pwd`; export srcroot; \ - r=3D`pwd`; export r; \ LC_ALL=3DC; export LC_ALL; \ EXPECT=3D$(EXPECT); export EXPECT; \ jdk_inc=3D"$(jdk_inc)"; export jdk_inc; \ @@ -62,6 +65,8 @@ check-DEJAGNU: site.exp development.exp if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ JDK_INC=3D"$(jdk_inc)" \ + CHECK_TARGET=3D$@ \ + PREFIX=3D"$(prefix)" \ GPROFNG_BROKEN_JAVAC=3D"$(GPROFNG_BROKEN_JAVAC)" \ MAKE=3D"$(MAKE)" CC=3D"$(CC)" CFLAGS=3D"$(CFLAGS) $(PTHREAD_CFLAGS)" \ LDFLAGS=3D"$(LDFLAGS)" LIBS=3D"$(PTHREAD_LIBS) $(LIBS)" \ diff --git a/gprofng/Makefile.in b/gprofng/Makefile.in index a2854950e34..582e0bb8716 100644 --- a/gprofng/Makefile.in +++ b/gprofng/Makefile.in @@ -929,9 +929,12 @@ uninstall-am: .PRECIOUS: Makefile =20 =20 -@TCL_TRY_TRUE@check-DEJAGNU: site.exp development.exp +@TCL_TRY_TRUE@.PHONY: check-small check-extra check-install + +@TCL_TRY_TRUE@check-DEJAGNU: check-small + +@TCL_TRY_TRUE@check-small check-extra check-install: site.exp development.= exp @TCL_TRY_TRUE@ srcroot=3D`cd $(srcdir) && pwd`; export srcroot; \ -@TCL_TRY_TRUE@ r=3D`pwd`; export r; \ @TCL_TRY_TRUE@ LC_ALL=3DC; export LC_ALL; \ @TCL_TRY_TRUE@ EXPECT=3D$(EXPECT); export EXPECT; \ @TCL_TRY_TRUE@ jdk_inc=3D"$(jdk_inc)"; export jdk_inc; \ @@ -939,6 +942,8 @@ uninstall-am: @TCL_TRY_TRUE@ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then= \ @TCL_TRY_TRUE@ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsui= te \ @TCL_TRY_TRUE@ JDK_INC=3D"$(jdk_inc)" \ +@TCL_TRY_TRUE@ CHECK_TARGET=3D$@ \ +@TCL_TRY_TRUE@ PREFIX=3D"$(prefix)" \ @TCL_TRY_TRUE@ GPROFNG_BROKEN_JAVAC=3D"$(GPROFNG_BROKEN_JAVAC)" \ @TCL_TRY_TRUE@ MAKE=3D"$(MAKE)" CC=3D"$(CC)" CFLAGS=3D"$(CFLAGS) $(PTHREA= D_CFLAGS)" \ @TCL_TRY_TRUE@ LDFLAGS=3D"$(LDFLAGS)" LIBS=3D"$(PTHREAD_LIBS) $(LIBS)" \ diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/confi= g/default.exp index ca2997b1742..f76047e2a34 100644 --- a/gprofng/testsuite/config/default.exp +++ b/gprofng/testsuite/config/default.exp @@ -32,6 +32,12 @@ if {![info exists CFLAGS]} { set CFLAGS "-g -O2" } =20 +if { "$CHECK_TARGET" =3D=3D "check-install" } { + set ::env(GPROFNG) "$PREFIX/bin/gprofng" +} else { + set ::env(GPROFNG) "$BUILDDIR/src/gprofng" +} + # Create directories where gprofng can find libraries and binaries: remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\"" remote_exec host "sh -c \"mkdir -p lib; rm -f lib/gprofng; ln -s ../libcol= lector/.libs lib/gprofng\"" diff --git a/gprofng/testsuite/gprofng.display/display.exp b/gprofng/testsu= ite/gprofng.display/display.exp index c34ba3abd54..4698795288f 100644 --- a/gprofng/testsuite/gprofng.display/display.exp +++ b/gprofng/testsuite/gprofng.display/display.exp @@ -31,34 +31,37 @@ if { ![istarget $pltf-*-*] return } =20 -switch $pltf { - x86_64 { - # Columns in the table represent: - # dir cflags gprofflags Others - set table { - {"jsynprog" "-g -Wall" "-p on -j on"} - {"mttest" "-g -O0" "-p on"} - {"mttest" "-g -O0" "-p on -h on"} - {"synprog" "-g -O0" "-p on"} - {"synprog" "-g -O0" "-p on -h on"} - } - } - aarch64 { +if { "$pltf" =3D=3D "aarch64" } { +# Use a filter for not leaf functions due to the unwind problem in libgp-c= ollector.so + set ::env(ACCT_FILTER) [join { "|egrep -vw 'gpf|tailcallopt|" + "cache_trash|calladd|computeF|cond_global|cond_timeout_global|" + "lock_global|lock_local|lock_none|nothreads|sema_global|trylock_glob= al'" + } "" ] +} +if { "$CHECK_TARGET" =3D=3D "check-extra" || "$CHECK_TARGET" =3D=3D "check= -install" } { +# dir cflags gprofflags tflags set table { - {"jsynprog" "-g -Wall" "-p on -j on"} - {"mttest" "-g -O0" "-p on"} - {"synprog" "-g -O0" "-p on"} + {"mttest" "-g -O0" "-p on"} + {"mttest" "-g -O0" "-p on -h on"} + {"mttest" "-g -O" "-p on -a on"} + {"mttest" "-g -O" "-p on -a off"} + {"mttest" "-g -O" "-p on -h on"} + {"jsynprog" "-g -Wall" "-p on -a on"} + {"jsynprog" "-g -Wall" "-p on -a off"} + {"jsynprog" "-g -Wall" "-p on -j on"} + {"synprog" "-g -O0" "-p on"} + {"synprog" "-g -O0" "-p on -h on"} + {"synprog" "-g -O" "-p on -a on"} + {"synprog" "-g -O" "-p on -a off"} + {"synprog" "-g -O" "-p on -h on"} } - } - default { - # Columns in the table represent: - # dir cflags gprofflags Others +} else { # "$CHECK_TARGET" is "check" or "check-DEJAGNU" +# dir cflags gprofflags tflags set table { - {"jsynprog" "" ""} - {"mttest" "" ""} - {"synprog" "" ""} + {"jsynprog" "-g -Wall" "-p on -j on" "-j add_int"} + {"mttest" "-g -O0" "-p on" "-j calladd"} + {"synprog" "-g -O0" "-p on" "cpu"} } - } } =20 global JDK_INC @@ -68,6 +71,11 @@ foreach line $table { set dir [lindex $line 0] set cflags [lindex $line 1] set gprofflags [lindex $line 2] + if { [llength $line] > 3 } { + set tflags [lindex $line 3] + } else { + set tflags " " + } =20 verbose [file rootname $line] verbose running display test $line @@ -75,7 +83,7 @@ foreach line $table { && ($JDK_INC =3D=3D "" || $GPROFNG_BROKEN_JAVAC =3D=3D "yes") } { unsupported $dir } else { - run_display_test $dir $cflags $gprofflags + run_display_test $dir $cflags $gprofflags $tflags } } =20 diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Intface.java b/gpro= fng/testsuite/gprofng.display/jsynprog/Intface.java index 016e7b28ba6..4a1edb18c4a 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/Intface.java +++ b/gprofng/testsuite/gprofng.display/jsynprog/Intface.java @@ -1,4 +1,23 @@ -// Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights re= served. +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + =20 public interface Intface { public int add_int (int scale); diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Launcher.java b/gpr= ofng/testsuite/gprofng.display/jsynprog/Launcher.java index 33ee06cd8db..37669dc41c6 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/Launcher.java +++ b/gprofng/testsuite/gprofng.display/jsynprog/Launcher.java @@ -1,5 +1,22 @@ -// Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights rese= rved. -// @(#)Launcher.java 1.3 10/03/24 SMI +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ =20 import java.lang.reflect.*; =20 diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Makefile b/gprofng/= testsuite/gprofng.display/jsynprog/Makefile index 3d9222dc9ec..37ea9edbb92 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/Makefile +++ b/gprofng/testsuite/gprofng.display/jsynprog/Makefile @@ -52,5 +52,5 @@ jsynprog.class: $(JAVA_SRCS) $(EXPERIMENT): $(TARGETS) @echo " ---- Build: $@ -----" rm -rf $@=20 - $(COLLECT) $(COLLECT_FLAGS) -o $@ $(JAVA) $(JAVACFLAGS) jsynprog + $(COLLECT) $(COLLECT_FLAGS) -o $@ $(JAVA) $(JAVACFLAGS) jsynprog $(TARGET= _FLAGS) =20 diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Routine.java b/gpro= fng/testsuite/gprofng.display/jsynprog/Routine.java index cfe45d2b93d..1295d82f12a 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/Routine.java +++ b/gprofng/testsuite/gprofng.display/jsynprog/Routine.java @@ -1,8 +1,22 @@ -/** - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights re= served. - * This class implements the Intface interface - * increments value of integer and floats - */ +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ =20 import java.util.*; =20 diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java b/= gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java index 11e045edc11..57afd272314 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java +++ b/gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java @@ -1,7 +1,24 @@ -/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights rese= rved. -** @(#)Sub_Routine.java 1.4 10/03/24 SMI -** This is subclass of Routine , overrides one method -*/ +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +// This is subclass of Routine, overrides one method =20 public class Sub_Routine extends Routine { private static native double cTimer(); diff --git a/gprofng/testsuite/gprofng.display/jsynprog/cloop.cc b/gprofng/= testsuite/gprofng.display/jsynprog/cloop.cc index cf8b779916b..d9a78e23f9a 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/cloop.cc +++ b/gprofng/testsuite/gprofng.display/jsynprog/cloop.cc @@ -1,6 +1,23 @@ -/* =20 - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights= reserved. - */ +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + #include #include #include diff --git a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.h b/gprofn= g/testsuite/gprofng.display/jsynprog/jsynprog.h index 34b4f6cf0a7..97a24b33f33 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.h +++ b/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.h @@ -1,5 +1,23 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Res= erved. */ +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + #include /* Header for class jsynprog */ =20 diff --git a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.java b/gpr= ofng/testsuite/gprofng.display/jsynprog/jsynprog.java index eb98b5ea7fd..ee22bb971cb 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.java +++ b/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.java @@ -1,5 +1,22 @@ -// Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights rese= rved. -// @(#)jsynprog.java SMI +/* Copyright (C) 2021-2023 Free Software Foundation, Inc. + Contributed by Oracle. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ =20 import java.util.*; import java.io.*; @@ -27,17 +44,22 @@ class jsynprog jsynprog jsyn_obj =3D new jsynprog(); Integer ni; int scale =3D 1000; + String commands =3D "memalloc.add_int.add_double.has_inner_class" +=20 + ".recurse.recursedeep.bounce.array_op.vector_op.sys_op" + + ".jni_JavaJavaC.JavaCC.JavaCJava.Launcher"; =20 createAcct(); LoadJNILibrary(args); testtime =3D computeSet(); =20 /* check for invocation parameter */ - if (args.length !=3D 0) { - if (args[0].equals("fast")) { + for (int i =3D 0; i < args.length; i++) { + if (args[i].equals("-fast")) { scale =3D 10000; - } else if (args[0].equals("slow")) { + } else if (args[i].equals("-slow")) { scale =3D 1; + } else if (args[i].equals("-j") && i + 1 < args.length) { + commands =3D args[++i]; } else { System.err.println("fatal: unexpected argument: " + args[0] ); System.exit(1); @@ -47,84 +69,115 @@ class jsynprog /* large memory allocations, trigger gc */ Routine rtn =3D new Routine(); Sub_Routine sbrt =3D new Sub_Routine(); - recTime();=20 - rtn.memalloc(10000, scale); - printValue("Routine.memalloc", false); + + if (commands.indexOf("memalloc") >=3D 0) { + recTime();=20 + rtn.memalloc(10000, scale); + printValue("Routine.memalloc", false); + } =20 /* add integers */ - recTime();=20 - ni =3D new Integer (rtn.add_int(scale)); - printValue("Routine.add_int", true); + if (commands.indexOf("add_int") >=3D 0) { + recTime();=20 + ni =3D new Integer (rtn.add_int(scale)); + printValue("Routine.add_int", true); + } =20 /* add double */ - recTime();=20 - Double nd =3D new Double(rtn.add_double(scale));=20 - printValue("Routine.add_double", true); + if (commands.indexOf("add_double") >=3D 0) { + recTime();=20 + Double nd =3D new Double(rtn.add_double(scale));=20 + printValue("Routine.add_double", true); + } =20 /* call method in derived class */=20 - recTime();=20 - ni =3D new Integer (sbrt.add_int(scale)); - printValue("Sub_Routine.add_int", true); + if (commands.indexOf("add_int") >=3D 0) { + recTime();=20 + ni =3D new Integer (sbrt.add_int(scale)); + printValue("Sub_Routine.add_int", true); + } =20 /* call method that defines an inner class */=20 - recTime();=20 - Integer[] na =3D rtn.has_inner_class(scale); - printValue("Routine.has_inner_class", true); + if (commands.indexOf("has_inner_class") >=3D 0) { + recTime();=20 + Integer[] na =3D rtn.has_inner_class(scale); + printValue("Routine.has_inner_class", true); + } =20 /* recursion */=20 - recTime();=20 - rtn.recurse(0,80, scale); - printValue("Routine.recurse", true); + if (commands.indexOf("recurse") >=3D 0) { + recTime();=20 + rtn.recurse(0,80, scale); + printValue("Routine.recurse", true); + } =20 /* deep recursion */=20 - recTime();=20 - rtn.recursedeep(0,500, scale); - printValue("", true); + if (commands.indexOf("recursedeep") >=3D 0) { + recTime();=20 + rtn.recursedeep(0,500, scale); + printValue("", true); + } =20 /* indirect recursion */=20 - recTime();=20 - rtn.bounce(0,20, scale); - printValue("Routine.bounce", true); + if (commands.indexOf("bounce") >=3D 0) { + recTime();=20 + rtn.bounce(0,20, scale); + printValue("Routine.bounce", true); + } =20 /* array operations */=20 - recTime();=20 - rtn.array_op(scale); - printValue("Routine.array_op", false); + if (commands.indexOf("array_op") >=3D 0) { + recTime();=20 + rtn.array_op(scale); + printValue("Routine.array_op", false); + } =20 /* Vector operations */=20 - recTime();=20 - rtn.vector_op(scale); - printValue("Routine.vector_op", false); + if (commands.indexOf("vector_op") >=3D 0) { + recTime();=20 + rtn.vector_op(scale); + printValue("Routine.vector_op", false); + } =20 /* spend time in system calls */=20 - recTime();=20 - rtn.sys_op(scale); - printValue("Routine.sys_op", false); + if (commands.indexOf("sys_op") >=3D 0) { + recTime();=20 + rtn.sys_op(scale); + printValue("Routine.sys_op", false); + } =20 /* java->java->c */ - recTime();=20 - int np =3D 0; - jni_JavaJavaC(np, scale); - printValue("jsynprog.jni_JavaJavaC", true); + if (commands.indexOf("jni_JavaJavaC") >=3D 0) { + recTime();=20 + int np =3D 0; + jni_JavaJavaC(np, scale); + printValue("jsynprog.jni_JavaJavaC", true); + } =20 /* java->c->c */ - recTime();=20 - JavaCC(scale); - printValue("jsynprog.JavaCC", true); + if (commands.indexOf("JavaCC") >=3D 0) { + recTime();=20 + JavaCC(scale); + printValue("jsynprog.JavaCC", true); + } =20 /* java->c->java */ - recTime();=20 - JavaCJava(scale); - printValue("jsynprog.JavaCJava", true); + if (commands.indexOf("JavaCJava") >=3D 0) { + recTime();=20 + JavaCJava(scale); + printValue("jsynprog.JavaCJava", true); + } =20 =20 /* dynamically loaded classes */ - String java_ver =3D System.getProperty("java.version"); - Launcher lnch =3D new Launcher(); - String[] params =3D new String[]{"DynLoadedClass"}; - recTime(); - lnch.main(params); - printValue("Launcher.main", true); + if (commands.indexOf("Launcher") >=3D 0) { + String java_ver =3D System.getProperty("java.version"); + Launcher lnch =3D new Launcher(); + String[] params =3D new String[]{"DynLoadedClass"}; + recTime(); + lnch.main(params); + printValue("Launcher.main", true); + } =20 System.gc(); } diff --git a/gprofng/testsuite/gprofng.display/synprog/check_results.pl b/g= profng/testsuite/gprofng.display/synprog/check_results.pl index ec278be9a02..830ed9a00fc 100755 --- a/gprofng/testsuite/gprofng.display/synprog/check_results.pl +++ b/gprofng/testsuite/gprofng.display/synprog/check_results.pl @@ -25,16 +25,8 @@ if 0; use strict; require "acct.pm"; =20 -my(@checkTime); - -if ("$ENV{DA_io}" eq "on") { - @checkTime =3D (); - acct::readAcct("synprog.acct2", @checkTime); -} else { - @checkTime =3D (1, 2); - acct::readAcct("synprog.acct", @checkTime); -} - +my(@checkTime) =3D (1, 2); # columns 1 and 2 - time in seconds. +acct::readAcct($ARGV[0], @checkTime); acct::read_er_print_out($ARGV[1], -1); acct::createDiff(); exit acct::set_retVal(0); diff --git a/gprofng/testsuite/gprofng.display/synprog/synprog.c b/gprofng/= testsuite/gprofng.display/synprog/synprog.c index ac5950a0d4b..3e0eac2f67f 100644 --- a/gprofng/testsuite/gprofng.display/synprog/synprog.c +++ b/gprofng/testsuite/gprofng.display/synprog/synprog.c @@ -149,7 +149,7 @@ static int CLONE_FLAGS[] =3D { /* the default script */ static char DEFAULT_COMMAND[] =3D "icpu.md.cpu.rec.recd.dousl.gpf.fitos.ec.tco.b.nap.uf." - "sys.sig.so.sx.so.sched.uwdc"; + "sys.sig.so.sx.so.sched"; =20 struct scripttab scripttab[] =3D { {"abt", doabort, "doabort", 0, 0}, diff --git a/gprofng/testsuite/lib/Makefile.skel b/gprofng/testsuite/lib/Ma= kefile.skel index ebb76a89d7a..5a30966c1cd 100644 --- a/gprofng/testsuite/lib/Makefile.skel +++ b/gprofng/testsuite/lib/Makefile.skel @@ -56,7 +56,8 @@ $(DISPLAY_LOG): $(EXPERIMENT) $(DISPLAY) $(DISPLAY_FLAGS) $(EXPERIMENT) > $@ =20 compare: $(DISPLAY_LOG) - perl -I $(srcdir)/../../lib $(srcdir)/check_results.pl $(ACCT_FILE) $(DIS= PLAY_LOG) + cat $(ACCT_FILE) $(ACCT_FILTER) > $(ACCT_FILE).fltr + perl -I $(srcdir)/../../lib $(srcdir)/check_results.pl $(ACCT_FILE).fltr = $(DISPLAY_LOG) =20 clobber clean: rm -rf *.er diff --git a/gprofng/testsuite/lib/acct.pm b/gprofng/testsuite/lib/acct.pm index 7d754aeeaae..7c328e7fc2f 100644 --- a/gprofng/testsuite/lib/acct.pm +++ b/gprofng/testsuite/lib/acct.pm @@ -97,7 +97,21 @@ sub set_retVal if ( $retVal =3D=3D 0 ) { $retVal =3D $_[0]; if ($retVal !=3D 0 ) { - warn sprintf("DEBUG: retVal=3D%d\n", $retVal); + my $s =3D ""; + if ($retVal =3D=3D $ERROR_DIFF_RANGE) { + $s =3D "Difference out of range"; + } elsif ($retVal =3D=3D $ERROR_HIGH_UNKNOWN) { + $s =3D "High unknown detected"; + } elsif ($retVal =3D=3D $ERROR_ACCT_MISMATCH) { + $s =3D "Accounting file mismatch"; + } elsif ($retVal =3D=3D $ERROR_CALLER_VERIF) { + $s =3D "Caller/caller verification failed"; + } elsif ($retVal =3D=3D $ERROR_ZERO_METRIC) { + $s =3D "Unexpected zero metric"; + } elsif ($retVal =3D=3D $ERROR_NEGATIVE_TIME) { + $s =3D "Negative CPU time"; + } + warn sprintf("DEBUG: retVal=3D%d %s\n", $retVal, $s); } } return $retVal; @@ -450,7 +464,9 @@ sub doComp if ( $r2 > 0 ) { $err_diff_range =3D $ERROR_DIFF_RANGE; } else { - $err_zero_metric =3D $ERROR_ZERO_METRIC; + if (! exists $ENV{ACCT_FILTER}) { + $err_zero_metric =3D $ERROR_ZERO_METRIC; + } } } else { $err_acct_mismatch =3D $ERROR_ACCT_MISMATCH; @@ -544,7 +560,9 @@ sub doComp2AVG if ( $r2 > 0 ) { $err_diff_range =3D $ERROR_DIFF_RANGE; } else { - $err_zero_metric =3D $ERROR_ZERO_METRIC; + if (! exists $ENV{ACCT_FILTER}) { + $err_zero_metric =3D $ERROR_ZERO_METRIC; + } } } else { $err_acct_mismatch =3D $ERROR_ACCT_MISMATCH; @@ -592,7 +610,8 @@ sub checkUnknown() $val =3D sprintf($R->{FMT}, $val); $rate =3D sprintf($R->{FMT},($val / $total) * 100); =20 - if (($val > $R->{'P_RANGE'}) && ($rate > $R->{'P_RATE'})) { + if ((! exists $ENV{ACCT_FILTER}) && + ($val > $R->{'P_RANGE'}) && ($rate > $R->{'P_RATE'})) { &set_retVal($ERROR_HIGH_UNKNOWN); &openFsingleScr(); $fmt =3D "#%-8s %10s %10s %s\n"; diff --git a/gprofng/testsuite/lib/display-lib.exp b/gprofng/testsuite/lib/= display-lib.exp index d094279d6e6..0ad81b09bf0 100644 --- a/gprofng/testsuite/lib/display-lib.exp +++ b/gprofng/testsuite/lib/display-lib.exp @@ -50,7 +50,7 @@ proc run_native_host_cmd { command } { # display options, collect flags, app options? Do we want these to be # set on a per-app basis? (If so, they should probably be driven by a # file in the test dir.) -proc run_display_test { dir cflags gprofflags } { +proc run_display_test { dir cflags gprofflags tflags } { global srcdir MAKE CC CFLAGS LDFLAGS LIBS BUILDDIR set stripped [string map {" " ""} $dir] set testdir [string map {" " ""} "$dir.$cflags,$gprofflags"] @@ -58,7 +58,7 @@ proc run_display_test { dir cflags gprofflags } { set tdir "tmpdir/$testdir" send_log "create dir: $tdir\n" set output [run_native_host_cmd "mkdir -p $tdir"] - set gprofng $BUILDDIR/src/gprofng + set gprofng $::env(GPROFNG) =20 set fd [open "$tdir/rules.txt" "w"] switch -regexp -- $testdir { @@ -80,6 +80,7 @@ proc run_display_test { dir cflags gprofflags } { =20 set make_args "-f $sdir/Makefile srcdir=3D\"$sdir\" builddir=3D\"$BUIL= DDIR\" \ VPATH=3D\"$dir\" CC=3D\"$CC\" CFLAGS=3D\"$cflags\" LDFLAGS=3D\"$LD= FLAGS\" \ + TARGET_FLAGS=3D\"$tflags\" \ DISPLAY_FLAGS=3D\"$DISPLAY_FLAGS\" \ COLLECT_FLAGS=3D\"$gprofflags\" GPROFNG=3D\"$gprofng\" MAKE=3D\"$M= AKE\"" set output [run_native_host_cmd "cd $tdir && $MAKE $make_args all"]