Commit Graph

25 Commits

Author SHA1 Message Date
Yixuan Chen
762c38d552 RISC-V:[gprofng] Minimal support gprofng for riscv.
ChangeLog: Add target riscv to --enable-gprofng.

2024-07-04  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * configure: Add riscv.
        * configure.ac: Add riscv.

gprofng/ChangeLog: Minimal support gprofng for riscv.

2024-07-04  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * gprofng/common/core_pcbe.c (core_pcbe_init): Add RISC-V vendor conditon.
        (defined): Add riscv.
        * gprofng/common/cpuid.c (defined): Add risc-v hwprobe.
        * gprofng/common/gp-defs.h (TOK_A_RISCV): Add riscv.
        (defined): Add riscv.
        (ARCH_RISCV): Add riscv.
        * gprofng/common/hwc_cpus.h: Add RISC-V vendor.
        * gprofng/common/hwcfuncs.h (HW_INTERVAL_TYPE): Remove useless defination.
        * gprofng/configure: Add riscv.
        * gprofng/configure.ac: Add riscv.
        * gprofng/libcollector/hwprofile.h (ARCH): Add RISC-V register.
        (CONTEXT_PC): Add RISC-V register.
        (CONTEXT_FP): Add RISC-V register.
        (CONTEXT_SP): Add RISC-V register.
        (SETFUNCTIONCONTEXT):
        * gprofng/libcollector/libcol_util.c (__collector_util_init): Fix libc open condition.
        * gprofng/libcollector/libcol_util.h (ARCH): Add RISC-V.
        * gprofng/libcollector/unwind.c (ARCH): Add RISC-V register.
        (GET_PC): Add RISC-V register.
        (GET_SP): Add RISC-V register.
        (GET_FP): Add RISC-V register.
        (FILL_CONTEXT):
        * gprofng/src/DbeSession.cc (ARCH): Add RISC-V.
        * gprofng/src/Disasm.cc (Disasm::disasm_open): Add RISC-V.
        * gprofng/src/Experiment.cc (Experiment::ExperimentHandler::startElement): Add RISC-V.
        * gprofng/src/checks.cc (ARCH): Add RISC-V.
        * gprofng/src/collctrl.cc (defined): Set risc-v cpu frequency to 1000MHz as default for now, will fix when I find a better method to get cpu frequency.
        (read_cpuinfo): Add "mvendorid" condition according to risc-v /proc/cpuinfo file content.
        * gprofng/src/dbe_types.h (enum Platform_t): Add RISC-V.
2024-07-10 15:16:03 -07:00
Matthieu Longo
3dee0baea2 autoupdate: add square brackets around arguments of AC_INIT
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fINIT-2
2024-06-10 08:25:56 +09:30
Vladimir Mezentsev
e5b12a313f Fix hard-coded bash path in gprofng
When running 'make check', the default gprofng test suite creates a
shell script for which it used a hardcoded shebang of '/usr/bin/bash'
this script would not run if bash is in a different location, like
/bin/bash

This commit adds 'AC_PATH_PROG(BASH, bash)' to configure.ac so the
installation path of bash is detected at configuration time. The
configuration is propagated to the runtest command line where it is
needed.
2024-05-08 22:18:24 -07:00
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30
Vladimir Mezentsev
7b32e37eb6 gprofng: remove dependency on help2man
help2man is no longer used to create the gprofng man pages.

gprofng/ChangeLog
2023-10-31  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* configure.ac: Remove HELP2MAN.
	* Makefile.in: Rebuild.
	* configure: Rebuild.
	* doc/Makefile.in: Rebuild.
	* gp-display-html/Makefile.in: Rebuild.
	* src/Makefile.in: Rebuild.
2023-11-01 19:25:06 -07:00
Vladimir Mezentsev
e5b3bfa519 gprofng: 30894 bison should be no hard dependency
When running from a distribution tarball, bison should not be necessary.
The generated files (QLParser.tab.cc, QLParser.tab.hh) should be distributed.
configure.ac should not abort if bison is missing.
configure.ac should remove temporary files (dummy.c, Simple.class).
bison must be run once to create QLParser.tab.cc and QLParser.tab.hh.

gprofng/ChangeLog
2023-10-03  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30894
	* configure.ac: Don't abort if bison is missing. Remove temporary files.
	* src/Makefile.am: Distribute QLParser.tab.cc and QLParser.tab.hh.
	* Run bison once to create QLParser.tab.cc and QLParser.tab.hh.
	* configure: Rebuild.
	* src/Makefile.in: Rebuild.
2023-10-05 08:09:45 -07:00
Vladimir Mezentsev
9d9f26d8b1 gprofng: 30602 [2.41] gprofng test hangs on i686-linux-gnu
There were several problems in the gprofng testing:
 - we did not catch a timeout for each test.
 - we used exit() to stop a failed test. But this stops all other tests.
 - we used a time_t (long) type in smalltest.c instead of a long long type.

	PR gprofng/30602
	* configure.ac: Launch only native testing.
	* configure: Rebuild.
	* testsuite/config/default.exp: Set TEST_TIMEOUT.
	* testsuite/gprofng.display/setpath_map.exp: Use return instead of exit.
	* testsuite/gprofng.display/gp-archive.exp: Likewise.
	* testsuite/gprofng.display/gp-collect-app_F.exp: Likewise.
	* testsuite/gprofng.display/display.exp: Delete an unnecessary test
	for native testing.
	* testsuite/lib/display-lib.exp (run_native_host_cmd): Add timeout.
	* testsuite/lib/smalltest.c: Use a long long type instead of time_t.
2023-07-13 21:53:36 -07:00
Vladimir Mezentsev
b1a41f5927 gprofng: PR29521 [docs] man pages are not in the release tarball
gprofng/ChangeLog
2023-01-20  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29521
	* configure.ac: Check if $MAKEINFO and $HELP2MAN are missing.
	* Makefile.am: Build doc if $MAKEINFO exists.
	* doc/gprofng.texi: Update documentation for gprofng.
	* doc/Makefile.am: Build gprofng.1.
	* src/Makefile.am: Move the build of gprofng.1 to doc/Makefile.am.
	* configure: Rebuild.
	* Makefile.in: Rebuild.
	* doc/Makefile.in: Rebuild.
	* src/Makefile.in: Rebuild.
2023-01-24 11:54:37 -08:00
Vladimir Mezentsev
47f72fdba3 Revert "gprofng: PR29987 bfd/archive.c:1447: undefined reference to `filename_ncmp'"
This reverts commit c2a5d74050.
2023-01-17 19:10:22 -08:00
Vladimir Mezentsev
c2a5d74050 gprofng: PR29987 bfd/archive.c:1447: undefined reference to `filename_ncmp'
gprofng/ChangeLog
2023-01-12  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29987
	* configure.ac: Remove dependencies on libbfd and libiberty.
	* gprofng/src/Makefile.am: Likewise.
	* configure: Rebuild.
	* Makefile.in: Rebuild.
	* src/Makefile.in: Rebuild.
	* doc/Makefile.in: Rebuild.
	* gp-display-html/Makefile.in: Rebuild.
2023-01-13 11:54:08 -08:00
Alan Modra
76bdc7266a Update year range in gprofng copyright notices
This adds 'Innovative Computing Labs' as an external author to
update-copyright.py, to cover the copyright notice in
gprofng/common/opteron_pcbe.c, and uses that plus another external
author 'Oracle and' to update gprofng copyright dates.  I'm not going
to commit 'Oracle and' as an accepted author, but that covers the
string "Copyright (c) 2006, 2012, Oracle and/or its affiliates. All
rights reserved." found in gprofng/testsuite/gprofng.display/jsynprog
files.
2023-01-01 23:26:30 +10:30
Vladimir Mezentsev
1c343a13ba gprofng: fix typo in configure.ac
gprofng/ChangeLog
2022-11-10  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* configure.ac: Fix typo in redirect operator.
	* configure: Rebuild.
2022-11-10 17:25:07 -08:00
Vladimir Mezentsev
fe39ffdc20 gprofng: fix build issues on musl
gprofng/ChangeLog
2022-09-14  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29477
	* configure.ac: Set __MUSL_LIBC.
	* configure: Rebuild.
	* common/config.h.in: Rebuild.
	* src/collector_module.h: Fix compiler errors because mmap64, open64,
	pwrite64 are macros and getcontext() is absent on musl.
	* libcollector/collector.c: Likewise.
	* libcollector/hwprofile.c: Likewise.
	* libcollector/iolib.c: Likewise.
	* libcollector/libcol_util.c: Likewise.
	* libcollector/linetrace.c: Likewise.
	* libcollector/memmgr.c: Likewise.
	* libcollector/profile.c: Likewise.
	* libcollector/unwind.c: Likewise.
	* libcollector/dispatcher.c: Likewise.
	* src/Experiment.cc: Likewise.
	* libcollector/collector.h: Use dlsym() because dlvsym() is not defined
	on musl.
	* libcollector/iotrace.c: Remove interposition of versioned functions.
	* libcollector/mmaptrace.c: Likewise.
	* libcollector/libcol_util.h: Fix -Wint-to-pointer-cast warnings.
	* libcollector/jprofile.c: Likewise.
	* libcollector/synctrace.c: Include "collector.h".
	* src/Print.cc: Use get_basename() because basename() is not defined
	on musl.
	* common/hwcdrv.c: Fix -Wformat= warnings.
2022-09-14 18:38:09 -07:00
Vladimir Mezentsev
9c6dd6885b gprofng: check for the makeinfo version
gprofng/ChangeLog
2022-07-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29368
	* configure.ac: Check for the makeinfo version.
	* configure: Rebuild.
2022-07-26 16:27:27 -07:00
Vladimir Mezentsev
14e283ff4e gprofng: fix build with -Werror=format-truncation
gprofng/ChangeLog
2022-06-16  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* configure.ac: Remove -Wno-format-truncation.
	* src/Makefile.am: Likewise.
	* configure: Rebuild.
	* src/Makefile.in: Rebuild.
	* common/hwctable.c: Fix -Werror=format-truncation errors.
	* src/ipc.cc: Likewise.
	* src/parse.cc: Likewise.
2022-06-16 20:44:24 -07:00
Vladimir Mezentsev
1653ae5b84 gprofng: use $host instead $target
By mistake, $target was used instead of $host to configure the gprogng build.

gprofng/ChangeLog
2022-04-28  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29113
	PR gprofng/29116
	* configure.ac: Use $host instead $target.
	* libcollector/configure.ac: Likewise.
	* configure: Rebuild.
	* libcollector/configure: Rebuild.
2022-05-05 10:12:12 -07:00
Vladimir Mezentsev
50192212a7 gprofng doesn't build with gcc 5.5
gprofng/ChangeLog
2022-04-07  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29026
	* configure.ac: Check version of bison.
	* src/Makefile.am (QLParser.yy): Run bison
	* src/QLParser.yy: Adapted for bison 3.04 or later.
	* src/DbeSession.cc: make some params const.
	* src/DbeSession.h: Likewise.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/QLParser.tab.cc: Deleted.
	* src/QLParser.tab.hh: Deleted.
	* doc/Makefile.in: Regenerate.
	* gp-display-html/Makefile.in: Regenerate.
	* libcollector/configure: Regenerate.
2022-04-11 18:07:26 -07:00
Vladimir Mezentsev
c10622fef4 gprofng: zlib handling
gprofng/ChangeLog
2022-04-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* configure.ac: Add AM_ZLIB.
	* src/Makefile.am: Add $(ZLIBINC) and $(ZLIB).
	* gprofng/src/DbeSession.h: Likewise.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* gp-display-html/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
2022-04-08 09:05:37 -07:00
Vladimir Mezentsev
6c924cf21c Install gprofng libraries under $(pkglibdir)
gprofng/ChangeLog
2022-03-21  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

        PR gprofng/28972
	* gprofng/libcollector/Makefile.am: Rename lib_LTLIBRARIES to
	pkglib_LTLIBRARIES. Add install-data-local.
	* gprofng/src/Makefile.am: Likewise.
	* gprofng/src/envsets.cc (putenv_libcollector_ld_misc): New location of
	the gprofng libraries.
	* gprofng/configure.ac: Removed an unused GPROFNG_LIBDIR.
	* gprofng/Makefile.am: Removed an unused GPROFNG_LIBDIR.  Add
	install-data-local.
	* gprofng/configure: Regenerate.
	* gprofng/Makefile.in: Likewise.
	* gprofng/doc/Makefile.in: Likewise.
	* gprofng/gp-display-htmllibcollector/Makefile.in: Likewise.
	* gprofng/libcollector/Makefile.in: Likewise.
	* gprofng/src/Makefile.in: Likewise.
2022-03-21 19:40:35 -07:00
Nick Clifton
0a30596cfa Fix Build issues due to patch "gprofng: a new GNU profiler"
Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
2022-03-18 15:46:33 +00:00
H.J. Lu
cac97c41c2 gprofng: Skip jsynprog with a broken javac
On CET enabled Linux/x86-64 machines, one can get

$ javac simple.java
Error: dl failure on line 894
Error: failed /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-6.fc35.x86_64/jre/lib/amd64/server/libjvm.so, because /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-6.fc35.x86_64/jre/lib/amd64/server/libjvm.so: rebuild shared object with SHSTK support enabled

Set GPROFNG_BROKEN_JAVAC to "yes" only with a broken javac and skip the
jsynprog test with a broken javac.

	PR gprofng/28965
	* Makefile.am (GPROFNG_BROKEN_JAVAC): New.
	(check-DEJAGNU): Pass GPROFNG_BROKEN_JAVAC to runtest.
	* configure.ac (GPROFNG_BROKEN_JAVAC): New AC_SUBST.  Set to yes
	with a broken javac.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* testsuite/gprofng.display/display.exp: Skip jsynprog with a
	broken javac.
2022-03-17 10:28:58 -07:00
Alan Modra
6109e902f1 gprofng configure target tests
${target} in configure.ac should be the canonical target, so that for
example, someone configuring with --target=x86_64-linux will match
x86_64-*-linux*.

	* configure.ac: Invoke AC_CANONICAL_TARGET.
	* libcollector/configure.ac: Likewise.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* gp-display-html/Makefile.in: Regenerate.
	* libcollector/Makefile.in: Regenerate.
	* libcollector/configure: Regenerate.
	* src/Makefile.in: Regenerate.
2022-03-17 21:32:44 +10:30
H.J. Lu
61a1f2e711 gprofng: Don't hardcode -Wno-format-truncation/-Wno-switch
Use -Wno-format-truncation and -Wno-switch only if they are supported.

	PR gprof/28969
	* configure.ac (GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS): New
	AC_SUBST for -Wno-format-truncation.
	(GPROFNG_NO_SWITCH_CFLAGS): New AC_SUBST for -Wno-switch.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* src/Makefile.am (AM_CFLAGS): Replace -Wno-format-truncation
	and -Wno-switch with GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS and
	GPROFNG_NO_SWITCH_CFLAGS.
	* src/Makefile.in: Regenerate.
2022-03-16 06:43:24 -07:00
Nick Clifton
4ec39c4bca gprofng: Add a configure test for clock_gettime and a use of the test in getthrtime.c 2022-03-15 15:21:56 +00:00
Vladimir Mezentsev
bb368aad29 gprofng: a new GNU profiler
top-level
	* Makefile.def: Add gprofng module.
	* configure.ac: Add --enable-gprofng option.
	* src-release.sh: Add gprofng.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* gprofng: New directory.

binutils
	* MAINTAINERS: Add gprofng maintainer.
	* README-how-to-make-a-release: Add gprofng.

include.
	* collectorAPI.h: New file.
	* libcollector.h: New file.
	* libfcollector.h: New file.
2022-03-11 08:58:31 +00:00