Commit Graph

129 Commits

Author SHA1 Message Date
Vladimir Mezentsev
559f8726e8 gprofng: use StringBuilder to create long messages
ChangeLog
2024-05-20  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/collctrl.cc: Use StringBuilder to create messages.
	Remove unused variables and arrays.
	* src/collctrl.h: Remove unused variables.
2024-05-21 19:54:59 -07:00
Vladimir Mezentsev
aea1188a25 gprofng: Remove hardware counter tables for unsupported hardware (Sparc)
ChangeLog
2024-05-20  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31123
	* common/hwctable.c: Remove hardware counter tables for Sparc machines.
2024-05-21 19:54:58 -07:00
Vladimir Mezentsev
a3e8656c02 gprofng: remove memset() in libcollector
ChangeLog
2024-05-20  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* libcollector/collector.c: Use static initialization instead of memset.
	* libcollector/dispatcher.c: Likewise.
	* libcollector/hwprofile.c: Likewise.
	* libcollector/jprofile.c: Likewise.
	* libcollector/profile.c: Likewise.
	* libcollector/synctrace.c: Likewise.
2024-05-21 19:54:56 -07:00
Vladimir Mezentsev
ee7af0e710 gprofng: add hardware counters for AMD Zen3
Historically, we have used several APIs (perfctr, libcpc, perf_event_open) for profiling.
For each hardware we have several tables of hardware counters.
Some information is duplicated in these tables.
Some of the information is no longer used.
I did not touch the existing hwc tables.
I added a new hwc table for an AMD Zen3 machine.

ChangeLog
2024-05-16  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31123
	* common/core_pcbe.c (core_pcbe_get_events): Add new argument.
	* common/hwc_cpus.h: New constants for AMD hardware.
	* common/hwcdrv.c: Add new argument to hwcdrv_get_descriptions.
	Clean up the code.
	* common/hwcdrv.h: Likewise.
	* common/hwcfuncs.c (hwcdrv_get_descriptions): Add new argument.
	* common/hwctable.c: Add the hwc table for AMD Zen3.
	* src/hwc_amd_zen3.h: New file.
	* common/opteron_pcbe.c: Add new argument to opt_pcbe_get_events.
	* src/collctrl.cc: Remove unused variable.
	* src/collctrl.h: Likewise.
2024-05-17 18:28:05 -07:00
Vladimir Mezentsev
663741df74 gprofng: remove old interface with libcpc
interface with libcpc was used on Solaris.
gprofng doesn't support profiling on Solaris.
I removed this old code and other unused macros and variables.

gprofng/ChangeLog
2024-04-29  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31123
	* common/hwcdrv.c: remove old interface with libcpc.
	* common/hwcdrv.h: Likewise.
	* common/hwcentry.h: Likewise.
	* common/hwcfuncs.c: Likewise.
	* common/hwcfuncs.h: Likewise.
	* common/hwctable.c: Likewise.
	* src/Dbe.cc: Likewise.
	* src/collctrl.cc: Likewise.
2024-05-17 18:28:03 -07:00
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
Christophe Lyon
34d5ac9244 gprofng: Fix dvi documentation build rule
This  patch fixes 'install-dvi'.
2024-04-15 09:51:19 +00:00
Vladimir Mezentsev
99c3fe52d2 gprofng: fix infinite recursion on calloc with multi-threaded applications
libcollector uses pthread_getspecific() and pthread_setspecific() to access
thread local memory. libcollector uses this memory to check that
interposed functions (like malloc, calloc or free) don't have recursion.
The first time we call calloc(), we call pthread_setspecific() to create
a thread-specific value.
On Ubuntu machine, pthread_setspecific() calls calloc(), and we cannot intercept
such recursion.
gcc supports thread-local storage. For example,
  static __thread int reentrance = 0;
I rewrote code using this instead of pthread_setspecific().

gprofng/ChangeLog
2024-03-23  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31460
	* libcollector/heaptrace.c: Use the __thread variable to check for
	* reentry. Clean up code.
2024-03-25 16:29:41 -07:00
Ruud van der Pas
3243d790ee gprofng: change use of bignum to use of bigint
Change the statement "use bignum" to "use bigint".  This is sufficient
for gp-display-html to work and removes the dependency on bignum.

gprofng/ChangeLog
2024-02-27  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	PR 31390
	* gprofng/gp-display-html: One line change to "use bigint".
2024-02-28 16:32:29 -08:00
Vladimir Mezentsev
f8c018bcd4 gprofng: Add hardware counter profiling for the Ampere system
gprofng should recognize Ampere and other ARM systems.

gprofng/ChangeLog
2024-02-22  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* common/hwc_cpus.h: Declare the enum values ARM_CPU_IMP_*.
	* common/core_pcbe.c (core_pcbe_init): Accept new systems ARM_CPU_IMP_*.
2024-02-25 17:30:35 -08:00
Vladimir Mezentsev
b3c670a6ba gprofng: Remove unused macros
gprofng/ChangeLog
2024-02-01  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* common/gp-experiment.h: Remove SP_REMOTE_PROTOCOL_VERSION.
	* common/hwctable.c: Remove DBG_LT* macros.
	* libcollector/envmgmt.c: Likewise.
	* libcollector/hwprofile.c: Likewise.
	* libcollector/iolib.c: Likewise.
	* libcollector/jprofile.c: Likewise.
	* libcollector/memmgr.c: Likewise.
	* libcollector/profile.c: Likewise.
	* libcollector/tsd.c: Likewise.
	* libcollector/unwind.c: Likewise.
2024-02-01 13:22:52 -08:00
Vladimir Mezentsev
c37ad9ea16 Fix 31252 gprofng causes testsuite parallel jobs fail
Before running our tests, we made a fake installation into ./tmpdir.
This installation changes libopcodes.la in the build area.
Gas testing may fail if gas and gprofng tests are run in parallel.

I create a script to run gprofng. Inside this script, LD_LIBRARY_PATH,
GPROFNG_SYSCONFDIR are set.
putenv_libcollector_ld_misc() first uses $GPROFNG_PRELOAD_LIBDIRS to create
directories for SP_COLLECTOR_LIBRARY_PATH ($SP_COLLECTOR_LIBRARY_PATH is used
to set up LD_PRELOAD).

gprofng/ChangeLog
2024-01-19  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31252
	PR gprofng/30808
	* src/envsets.cc (putenv_libcollector_ld_misc): Use
	$GPROFNG_PRELOAD_LIBDIRS first to build SP_COLLECTOR_LIBRARY_PATH.
	* testsuite/config/default.exp: Create a script to run gprofng.
	* testsuite/lib/display-lib.exp: Fix typo.
2024-01-22 09:56:42 -08:00
Nick Clifton
e775d3a9b7 Change version to 2.42.50 and regenerate files 2024-01-15 15:13:36 +00:00
Vladimir Mezentsev
1b346e5048 gprofng: 30889 can't compile without large file support
gprofng/ChangeLog
2024-01-12  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR 30889
	* src/util.h (O_LARGEFILE): Define to 0, if not defined.
2024-01-12 20:52:14 -08:00
Vladimir Mezentsev
cc76856b8f gprofng: fix 3 bugzillas against gp-display-html
Fix two cases where gp-display-html terminates prematurely because the
input format is not recognized.  This problem occurs in the function
overview and caller-callee parts of the code.
The fix consists of new regular expressions and a different approach
in handling the input from gp-display-text.
Also fix a performance problem in the caller-callee part that has a
noticeable impact on the performance for large applications.

gprofng/ChangeLog
2024-01-10  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	PR gprofng/30438
	PR gprofng/30439
	PR gprofng/30942
	* gp-display-html/gp-display-html.in: fixes the issues.
2024-01-12 12:23:20 -08:00
Vladimir Mezentsev
c49f224f9e gprofng: add an examples directory
This directory contains example programs for the user to experiment with.
Initially there is one application written in C.  The plan is to include
more examples, also in other langauges, over time.
In addition to the sources and a make file, a sample script how to make
a profile is included.  There is also a README.md file.

gprofng/ChangeLog
2024-01-08  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	* examples: Top level directory.
	* examples/mxv-pthreads: Example program written in C.
2024-01-10 09:44:52 -08:00
Vladimir Mezentsev
8fe04eeb2c gprofng: 31123 improvements to hardware event implementation
Our hardware counter profiling is based on perf_event_open().
Our HWC tables are absent for new machines.
I have added HWC tables for the following events: PERF_TYPE_HARDWARE,
PERF_TYPE_SOFTWARE, PERF_TYPE_HW_CACHE. Other events require additional fixes.

Did a little cleaning: marked the symbols as static, used Stringbuilder,
created a function to read /proc/cpuinfo.

gprofng/ChangeLog
2024-01-08  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31123
	* common/core_pcbe.c: Mark the symbols as static. Add events_generic[].
	* common/hwc_cpus.h: Declare a new function read_cpuinfo.
	* common/hwcdrv.c: Add a new parameter in init_perf_event().
	* common/hwcentry.h: Add use_perf_event_type in Hwcentry.
	* common/hwcfuncs.c (process_data_descriptor): Read use_perf_event_type,
	type, config.
	* common/hwctable.c: Add a new HWC table generic_list[].
	* common/opteron_pcbe.c (opt_pcbe_init): Accept AMD machines.
	* src/collctrl.cc: Use StringBuilder in Coll_Ctrl::build_data_desc().
	Add a new function read_cpuinfo.
2024-01-10 09:31:08 -08: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
576d2c97d8 gprofng: fix build problems on linux-musl
ino64_t, off64_t, fpos64_t, stat64, __u64 are not defined on linux-musl.
Fixed by declaring these types for linux-musl.

2023-12-21  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30779
	PR gprofng/29593
	* common/gp-defs.h: Define ino64_t, off64_t, fpos64_t for linux-musl.
	* libcollector/unwind.c: Define __u64 for linux-musl.
	* src/util.h: Define dbe_stat_t.
	* src/ClassFile.cc: Use dbe_stat_t instead of "struct stat64".
	* src/Dbe.cc: Likewise.
	* src/DbeFile.cc: Likewise.
	* src/DbeFile.h: Likewise.
	* src/DbeSession.cc: Likewise.
	* src/Experiment.cc: Likewise.
	* src/checks.cc: Likewise.
	* src/util.cc: Likewise.
2023-12-22 21:10:36 -08:00
Vladimir Mezentsev
0b3ad397ef gprofng: 31169 Source code locations can not be found in a C++ application
gprofng incorrectly reads the form of the DW_FORM_ref_addr attribute for DWARF
Version 3 or later.
From DWARF specification:
  References that use the attribute form DW_FORM_ref_addr are specified to
  be four bytes in the DWARF 32-bit format and eight bytes in the DWARF
  64-bit format, while DWARF Version 2 specifies that such references have
  the same size as an address on the target system.

2023-12-18  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/31169
	* src/DwarfLib.cc: Fix the reader for DW_FORM_ref_addr.
2023-12-20 14:04:35 -08:00
Vladimir Mezentsev
01b386b55e gprofng: fix -Wuse-after-free warning
Removed incorrect unnecessary code.

gprofng/ChangeLog
2023-12-13  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/collctrl.cc (set_synctrace): Fix -Wuse-after-free warning.
2023-12-14 11:10:40 -08:00
Vladimir Mezentsev
a0dc1f9a12 gprofng: support GNU option syntax in gp-display-html, plus various fixes
This is a major update of gp-display-html.  The option handling has been
modified to support the GNU style long option syntax.  Compatibility with
the previous syntax has been preserved. If still used, a warning is issued.
Through the --nowarnings option, this can be suppressed.
In addition to this, various lay-out changes have been implemented.  In
particular to reduce the number of lines that extend beyond column 79.
Several bugs have been fixed, for example in the handling of directory names.

gprofng/ChangeLog
2023-11-28  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	* gp-display-html/gp-display-html.in: Change option syntax plus fixes.
2023-11-29 10:18:35 -08:00
Vladimir Mezentsev
46c5675798 gprofng: updated man pages and user guide
This is a major update of all the man pages.  Bugs 30679 and 30895 are
addressed.  In addition to fixes for typos, the texts have been expanded
and clarified, and line lengths no longer extend beyond column 79.  In
case of gp-display-html, the new option syntax is documented. The user
guide has a new section on the gprofng GUI.

gprofng/ChangeLog
2023-11-28  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	PR 30679
	PR 30895
	* doc/gp-archive.texi: Expand the description of the options.
	* doc/gp-collect-app.texi: Fix various typos and textual improvements.
	* doc/gp-display-html.texi: Cover the new GNU long option syntax.
	* doc/gp-display-src.texi: Fix various typos and textual improvements.
	* doc/gp-display-text.texi: Fix typos fixed and textual improvements.
	* doc/gp-macros.texi: Fix a bug in the vspace macro and add new macro.
	* doc/gprofng.texi: Cover the GPROFNG_SYSCONFDIR environment variable.
	* doc/gprofng_ug.texi: Fix various typos and textual improvements.
	* doc/version.texi: Adapt the date and version number.
2023-11-29 10:18:34 -08:00
Sam James
9e11e7460d Finalized intl-update patches (deux)
Doing this on behalf of Arsen as obvious.

* gdb: Regenerate.
* gdbserver: Regenerate.
* gprofng: Regenerate.
2023-11-15 13:47:03 +00:00
Arsen Arsenovi?
862776f26a Finalized intl-update patches
* intl: Remove directory.  Replaced with out-of-tree GNU gettext.
  * .gitignore: Add '/gettext*'.
  * configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag.  Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing.
  * configure: Regenerate.
  * Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext.
  * Makefile.in: Regenerate.
  * src-release.sh: Remove references to the intl/ directory.
2023-11-15 12:53:04 +00:00
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
53beac2e23 gprofng: Fix -Wformat= warnings
Added format attribute to several gprofng functions.
Fixed -Wformat= warnings.

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

	* libcollector/heaptrace.c: Fixed -Wformat= warnings.
	* libcollector/hwprofile.c: Likewise.
	* libcollector/iolib.c: Likewise.
	* libcollector/iotrace.c: Likewise.
	* libcollector/jprofile.c: Likewise.
	* libcollector/profile.c: Likewise.
	* libcollector/synctrace.c: Likewise.
	* src/ClassFile.cc: Likewise.
	* src/SourceFile.cc: Likewise.
	* libcollector/libcol_util.h: Added format attribute.
	* src/Emsg.h: Likewise.
	* src/collector_module.h: Likewise.
	* src/data_pckts.h: Define fld_sizeof.
2023-10-24 23:27:30 -07:00
Vladimir Mezentsev
f6ca448ab7 gprofng: Use the correct application name in error messages
The old application name (er_archive) is used in many places.

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

	* src/Experiment.cc: Replace er_archive with gp-archive.
	* src/Experiment.cc: Likewise.
2023-10-10 20:53:22 -07:00
Vladimir Mezentsev
08330ace11 gprofng: 30910 cross test fail: can't read "CHECK_TARGET": no such variable
When TCL_TRY is FALSE, the wrong check-DEJAGNU is generated.
Place "if TCL_TRY / endif" in the right place.

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

	PR gprofng/30910
	* Makefile.am: Correct "if TCL_TRY / endif".
	* Makefile.in: Rebuild.
2023-10-06 17:29:22 -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
7434de7ef9 gprofng: 30834 improve disassembly output for call and branch instructions
This patch makes the gprofng disassembler to emit, e.g.
    call   fprintf@plt [ 0x401060, .-0x49c]
instead of
    call   0xfffffffffffffb64

I use bfd_get_synthetic_symtab() to get function names in the .plt section.
I have not yet modified Elf-reader in gprofng to remove parsing of .symtab or
.dynsym sections. But we plan to do it.

gprofng/ChangeLog
2023-09-20  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30834
	* src/Disasm.cc: Show the function name in the call instruction
	and the relative address in the branch instruction. Remove unused code.
	* src/Disasm.h (map_PC_to_func, get_funcname_in_plt): New functions.
	* src/Elf.cc: Get function names for the .plt section.
	* src/Elf.h (get_funcname_in_plt, get_bfd_symbols): New functions.
	* src/Stabs.cc: Add pltSym to SymLst. Remove the conversion to uint32_t.
2023-09-21 18:56:30 -07:00
Vladimir Mezentsev
a13e4c5c10 Fix 30808 gprofng tests failed
In gprofng testing, we need a tempory gprofng installation to resolve run-time
dependencies on libraries (libgprofng, libopcodes, libbfd, etc).
We set LD_LIBRARY_PATH and GPROFNG_SYSCONFDIR to find our libraries and
configuration file. These variables must be set for all gprofng tests.

Tested on aarch64 and x86_64 with and without --enable-shared and --target=<>.

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

	PR gprofng/30808
	* testsuite/config/default.exp: Make a temporary install dir.
	Set LD_LIBRARY_PATH, GPROFNG_SYSCONFDIR.
	* testsuite/lib/Makefile.skel: Move LD_LIBRARY_PATH and
	GPROFNG_SYSCONFDIR setting in testsuite/config/default.exp.
2023-09-05 13:01:46 -07:00
Vladimir Mezentsev
1f572864da gprofng: Use execvp instead of execv
gp-display-gui (https://savannah.gnu.org/projects/gprofng-gui)
can be installed in a different directory.
In this case, $PATH is used to look up gp-display-text.
execv() does not use $PATH to find the executable.

gprofng/ChangeLog
2023-08-15  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/gp-display-text.cc (reexec): Use execvp instead of execv.
2023-08-17 13:15:10 -07:00
Vladimir Mezentsev
84004b2a70 gprofng: pass gprofng location to gp-display-gui
gprofng GUI can be installed to the other directory.
In this case, $PATH is used to find gp-display-gui from gprofng
and option --gprofngdir is passed to gp-display-gui.

gprofng/ChangeLog
2023-08-09  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/gprofng.cc (Gprofng::exec_cmd): Add option --gprofngdir.
2023-08-12 19:46:52 -07:00
Vladimir Mezentsev
e15197c804 gprofng: fix typos in get_realpath() and check_executable()
gprofng/ChangeLog
2023-08-09  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/Application.cc (Application::get_realpath): Fix typo.
	* src/checks.cc (collect::check_executable): Likewise.
2023-08-12 19:46:52 -07:00
Alan Modra
6a6859cbff regen config
This regenerates config files changed by the previous 44 commits.
Note that subject lines in these commits mostly match the gcc git
originating commit.
2023-08-12 10:27:57 +09:30
Vladimir Mezentsev
e0282cf128 gprofng: 30700 tmpdir/gp-collect-app_F test fails
gprofng/ChangeLog
2023-08-03  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30700
	* testsuite/gprofng.display/gp-collect-app_F.exp: Fix -name argument
	for sub-experiment filtering.
2023-08-07 14:32:36 -07:00
Sam James
b5c37946cc Revert "2.41 Release sources"
This reverts commit 675b9d612c.

See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
2023-08-02 12:06:23 +01:00
Nick Clifton
675b9d612c 2.41 Release sources 2023-08-02 09:23:36 +01:00
Khem Raj
69c37f53e2 gprofng: Fix build with 64bit file offset on 32bit machines
gprofng/ChangeLog
2023-07-31  Khem Raj <raj.khem@gmail.com>

* libcollector/iotrace.c: Define open64, fgetpos64, and fsetpos64
  only when __USE_LARGEFILE64 and __USE_FILE_OFFSET64 are not
  defined.
2023-08-01 20:57:42 -07:00
Vladimir Mezentsev
c8e1332cc7 gprofng: create a list of available views
In our GUI project (https://savannah.gnu.org/projects/gprofng-gui), we use
the output of gp-display-text to display the data.
gp-display-text did not report available views.

gprofng/ChangeLog
2023-07-26  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/Command.cc: Add commands for gprofng GUI.
	* src/gprofng.rc: Set defaults for gprofng GUI.
2023-07-31 17:05:35 -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
Nick Clifton
87485f5349 Change version number to 2.41.50 and regenerate files 2023-07-03 11:54:06 +01:00
Vladimir Mezentsev
c476793d5b gprofng: fix data race
In our GUI project (https://savannah.gnu.org/projects/gprofng-gui), we use
the output of gprofng to display the data. Sometimes this data is corrupted.

gprofng/ChangeLog
2023-06-29  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/ipc.cc (ipc_doWork): Fix data race.
	* src/ipcio.cc (IPCresponse::print): Fix data race.
	Remove unused variables and functions.
	* src/ipcio.h: Declare two variables.
	* src/StringBuilder.cc (StringBuilder::write): New function.
	* src/StringBuilder.h: Likewise.
2023-07-01 08:33:11 -07:00
Vladimir Mezentsev
a06dd73324 gprofng: Add new tests
gprofng/ChangeLog
2023-06-26  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* Makefile.am: Pass CLOCK_GETTIME_LINK to the testsuite
	* Makefile.in: Rebuild.
	* testsuite/gprofng.display/gp-archive.exp: New file.
	* testsuite/gprofng.display/gp-collect-app_F.exp: New file.
	* testsuite/gprofng.display/setpath_map.exp: New file.
	* testsuite/lib/smalltest.c: New file.
2023-06-28 10:27:01 -07:00
Cui, Lili
3d990b8548 gprofng: Update intel url
Since the old software.intel.com has been removed, update a new one.

gprofng/ChangeLog
2023-06-27  Lili Cui  <lili.cui@intel.com>

	* gp-display-html/gp-display-html.in: Update intel url.
2023-06-27 08:01:21 +00:00
Vladimir Mezentsev
dd8a4e320b gprofng: Fix -Wsign-compare warning
gprofng/ChangeLog
2023-05-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30490
	* src/LoadObject.cc: Fix -Wsign-compare warning.
2023-05-31 11:46:22 -07:00
Vladimir Mezentsev
defb734195 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.
2023-05-31 11:46:21 -07:00
Vladimir Mezentsev
b5fbb4c2b4 gprofng: include a new function in the right place
Static function name is not available in stripped libraries.
In this case, gprofng maps PC to a fake function like <static>@0xPC (<libname>).
Sometimes gprofng creates two functions instead of one.
Also FUNC_FLAG_SIMULATED is needed for these fake functions.

gprofng/ChangeLog
2023-05-11  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/LoadObject.cc (LoadObject::find_function): Set FUNC_FLAG_SIMULATED.
	Include a new function in the right place.
2023-05-16 12:04:51 -07:00
Vladimir Mezentsev
35fab451d9 gprofng: 30360 Seg. Fault when application uses std::thread
We interpose a lot of libC functions (dlopen, fork, pthread_create, etc.).
Some of these functions have versions. For example,

% nm -D /lib64/gprofng/libgp-collector.so  | grep thread_create@ | sort
000000000004b420 T pthread_create@GLIBC_2.34
000000000004b490 T pthread_create@GLIBC_2.17
000000000004b500 T pthread_create@GLIBC_2.2.5
000000000004b570 T pthread_create@GLIBC_2.1
000000000004b5e0 T pthread_create@GLIBC_2.0

Our library does not set the default version for symbols.
This is correct because we don't know which libC will be used.

gcc and g++ links differently the version symbols when the default version is
not set. c-linker is using our pthread_create@GLIBC_2.34 and c++-linker is using
our pthread_create@GLIBC_2.0 by default.

The current implementation of the interposed functions is:
  If we are in our pthread_create@GLIBC_<NN>,
  we use dlvsym (dlflag, "pthread_create", "GLIBC_<NN>") to find and call
  the same function from libC.
In the test from PR 30360, pthread_create@GLIBC_2.0 is not in the current libC.
We need to call the default version symbol from libC.

gprofng/ChangeLog
2023-04-16  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30360
	* libcollector/iotrace.c: Find and call a default libC version symbol.
	* libcollector/dispatcher.c: Likewise.
	* libcollector/iotrace.c: Likewise.
	* libcollector/linetrace.c: Likewise.
	* libcollector/mmaptrace.c: Likewise.
	* libcollector/synctrace.c: Likewise.
	* libcollector/collector.h (REAL_DCL): Remove an unused argument.
2023-04-17 13:01:38 -07:00