diff options
author | Vladimir Mezentsev <vladimir.mezentsev@oracle.com> | 2023-05-25 17:54:53 -0700 |
---|---|---|
committer | Vladimir Mezentsev <vladimir.mezentsev@oracle.com> | 2023-05-31 11:46:21 -0700 |
commit | defb734195d055bbb80be04b6067a9bb80ff249d (patch) | |
tree | 87bf66475d79327a8cf271846a95e08ff796b3c1 /gprofng/testsuite/gprofng.display/jsynprog | |
parent | 739f67599a85d7b809c0407765f8a7304f771e63 (diff) | |
download | binutils-defb734195d055bbb80be04b6067a9bb80ff249d.zip binutils-defb734195d055bbb80be04b6067a9bb80ff249d.tar.gz binutils-defb734195d055bbb80be04b6067a9bb80ff249d.tar.bz2 |
gprofng: 29470 The test suite should be made more flexible
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 installation.
On aarch64, there are unwind problems in libgp-collector.so.
I set ACCT_FILTER to temporarily ignore problematic functions.
gprofng/ChangeLog
2023-05-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
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 copyright.
* 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 copyright.
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 set.
* testsuite/lib/display-lib.exp: Add TARGET_FLAGS in make_args.
Diffstat (limited to 'gprofng/testsuite/gprofng.display/jsynprog')
8 files changed, 227 insertions, 72 deletions
diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Intface.java b/gprofng/testsuite/gprofng.display/jsynprog/Intface.java index 016e7b2..4a1edb1 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 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. */ + public interface Intface { public int add_int (int scale); diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Launcher.java b/gprofng/testsuite/gprofng.display/jsynprog/Launcher.java index 33ee06c..37669dc 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 reserved. -// @(#)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. */ import java.lang.reflect.*; diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Makefile b/gprofng/testsuite/gprofng.display/jsynprog/Makefile index 3d9222d..37ea9ed 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 $@ - $(COLLECT) $(COLLECT_FLAGS) -o $@ $(JAVA) $(JAVACFLAGS) jsynprog + $(COLLECT) $(COLLECT_FLAGS) -o $@ $(JAVA) $(JAVACFLAGS) jsynprog $(TARGET_FLAGS) diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Routine.java b/gprofng/testsuite/gprofng.display/jsynprog/Routine.java index cfe45d2..1295d82 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 reserved. - * 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. */ import java.util.*; diff --git a/gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java b/gprofng/testsuite/gprofng.display/jsynprog/Sub_Routine.java index 11e045e..57afd27 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 reserved. -** @(#)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 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 cf8b779..d9a78e2 100644 --- a/gprofng/testsuite/gprofng.display/jsynprog/cloop.cc +++ b/gprofng/testsuite/gprofng.display/jsynprog/cloop.cc @@ -1,6 +1,23 @@ -/* - * 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 <jni.h> #include <stdio.h> #include <stdlib.h> diff --git a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.h b/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.h index 34b4f6c..97a24b3 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 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 <jni.h> /* Header for class jsynprog */ diff --git a/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.java b/gprofng/testsuite/gprofng.display/jsynprog/jsynprog.java index eb98b5e..ee22bb9 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 reserved. -// @(#)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. */ import java.util.*; import java.io.*; @@ -27,17 +44,22 @@ class jsynprog jsynprog jsyn_obj = new jsynprog(); Integer ni; int scale = 1000; + String commands = "memalloc.add_int.add_double.has_inner_class" + + ".recurse.recursedeep.bounce.array_op.vector_op.sys_op" + + ".jni_JavaJavaC.JavaCC.JavaCJava.Launcher"; createAcct(); LoadJNILibrary(args); testtime = computeSet(); /* check for invocation parameter */ - if (args.length != 0) { - if (args[0].equals("fast")) { + for (int i = 0; i < args.length; i++) { + if (args[i].equals("-fast")) { scale = 10000; - } else if (args[0].equals("slow")) { + } else if (args[i].equals("-slow")) { scale = 1; + } else if (args[i].equals("-j") && i + 1 < args.length) { + commands = 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 = new Routine(); Sub_Routine sbrt = new Sub_Routine(); - recTime(); - rtn.memalloc(10000, scale); - printValue("Routine.memalloc", false); + + if (commands.indexOf("memalloc") >= 0) { + recTime(); + rtn.memalloc(10000, scale); + printValue("Routine.memalloc", false); + } /* add integers */ - recTime(); - ni = new Integer (rtn.add_int(scale)); - printValue("Routine.add_int", true); + if (commands.indexOf("add_int") >= 0) { + recTime(); + ni = new Integer (rtn.add_int(scale)); + printValue("Routine.add_int", true); + } /* add double */ - recTime(); - Double nd = new Double(rtn.add_double(scale)); - printValue("Routine.add_double", true); + if (commands.indexOf("add_double") >= 0) { + recTime(); + Double nd = new Double(rtn.add_double(scale)); + printValue("Routine.add_double", true); + } /* call method in derived class */ - recTime(); - ni = new Integer (sbrt.add_int(scale)); - printValue("Sub_Routine.add_int", true); + if (commands.indexOf("add_int") >= 0) { + recTime(); + ni = new Integer (sbrt.add_int(scale)); + printValue("Sub_Routine.add_int", true); + } /* call method that defines an inner class */ - recTime(); - Integer[] na = rtn.has_inner_class(scale); - printValue("Routine.has_inner_class", true); + if (commands.indexOf("has_inner_class") >= 0) { + recTime(); + Integer[] na = rtn.has_inner_class(scale); + printValue("Routine.has_inner_class", true); + } /* recursion */ - recTime(); - rtn.recurse(0,80, scale); - printValue("Routine.recurse", true); + if (commands.indexOf("recurse") >= 0) { + recTime(); + rtn.recurse(0,80, scale); + printValue("Routine.recurse", true); + } /* deep recursion */ - recTime(); - rtn.recursedeep(0,500, scale); - printValue("<Truncated-stack>", true); + if (commands.indexOf("recursedeep") >= 0) { + recTime(); + rtn.recursedeep(0,500, scale); + printValue("<Truncated-stack>", true); + } /* indirect recursion */ - recTime(); - rtn.bounce(0,20, scale); - printValue("Routine.bounce", true); + if (commands.indexOf("bounce") >= 0) { + recTime(); + rtn.bounce(0,20, scale); + printValue("Routine.bounce", true); + } /* array operations */ - recTime(); - rtn.array_op(scale); - printValue("Routine.array_op", false); + if (commands.indexOf("array_op") >= 0) { + recTime(); + rtn.array_op(scale); + printValue("Routine.array_op", false); + } /* Vector operations */ - recTime(); - rtn.vector_op(scale); - printValue("Routine.vector_op", false); + if (commands.indexOf("vector_op") >= 0) { + recTime(); + rtn.vector_op(scale); + printValue("Routine.vector_op", false); + } /* spend time in system calls */ - recTime(); - rtn.sys_op(scale); - printValue("Routine.sys_op", false); + if (commands.indexOf("sys_op") >= 0) { + recTime(); + rtn.sys_op(scale); + printValue("Routine.sys_op", false); + } /* java->java->c */ - recTime(); - int np = 0; - jni_JavaJavaC(np, scale); - printValue("jsynprog.jni_JavaJavaC", true); + if (commands.indexOf("jni_JavaJavaC") >= 0) { + recTime(); + int np = 0; + jni_JavaJavaC(np, scale); + printValue("jsynprog.jni_JavaJavaC", true); + } /* java->c->c */ - recTime(); - JavaCC(scale); - printValue("jsynprog.JavaCC", true); + if (commands.indexOf("JavaCC") >= 0) { + recTime(); + JavaCC(scale); + printValue("jsynprog.JavaCC", true); + } /* java->c->java */ - recTime(); - JavaCJava(scale); - printValue("jsynprog.JavaCJava", true); + if (commands.indexOf("JavaCJava") >= 0) { + recTime(); + JavaCJava(scale); + printValue("jsynprog.JavaCJava", true); + } /* dynamically loaded classes */ - String java_ver = System.getProperty("java.version"); - Launcher lnch = new Launcher(); - String[] params = new String[]{"DynLoadedClass"}; - recTime(); - lnch.main(params); - printValue("Launcher.main", true); + if (commands.indexOf("Launcher") >= 0) { + String java_ver = System.getProperty("java.version"); + Launcher lnch = new Launcher(); + String[] params = new String[]{"DynLoadedClass"}; + recTime(); + lnch.main(params); + printValue("Launcher.main", true); + } System.gc(); } |