Fix a bug where the main program does not free the rows of
the matrix. The memory for thread_data_arguments is also
not released. In function check_results, the memory for the
marker vector is not released.
The usage of the verbose veriable has been extended to
print more messages.
gprofng/ChangeLog
2024-10-16 Ruud van der Pas <ruud.vanderpas@oracle.com>
PR 32273
PR 32274
* mxv-pthreads/src/main.c: add calls to free() to
release the memory allocated for array A and vector
marker. Improve the usage of the verbose variable.
* mxv-pthreads/src/manage_data.c: add a diagnostic
printf statement.
* mxv-pthreads/src/mydefs.h: adapt prototype to
match the changes in main.c.
gprofng does not handle DW_FORM_strx1* forms correctly.
gprofng/ChangeLog
2024-10-10 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR 32110
* src/DwarfLib.cc: Handle DW_FORM_strx* forms.
gprofng/ChangeLog
2024-10-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>.
* common/hwc_cpus.h: New constant for Neoverse-N1 and Ampere-1.
* common/hwctable.c: Add the hwc table for Neoverse-N1 and Ampere-1.
* src/hwc_arm_ampere_1.h: New file with hwc table for Ampere-1.
* src/hwc_arm_neoverse_n1.h: New file with hwc table for Neoverse-N1.
Fix a bug where an experiment with hardware event counter data
causes the source and disassembly files not to be generated.
No longer suppress zero valued metrics and change the name
of the man page in a warning message. Adapt line lengths to
not exceed 79.
gprofng/ChangeLog
2024-09-24 Ruud van der Pas <ruud.vanderpas@oracle.com>
PR 32193
PR 32199
PR 32201
* gp-display-html/gp-display-html.in: Implement all
the above changes.
gprofng/ChangeLog
2024-09-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR 32207
* src/collctrl.cc (preprocess_names): Fix the size in strndup.
Fixed UBSAN runtime errors such as:
- member call on address which does not point to an object of type 'Vector'
- load of misaligned address 0x623e5a670173 for type 'int', which requires 4 byte alignment
gprofng/ChangeLog
2024-09-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>.
PR gprofng/32096
* libcollector/unwind.c: Fix UBSAN runtime errors.
* src/CallStack.cc (add_stack_java, add_stack_java_epilogue):
Change argument type to Vector<Histable*>*.
* src/Experiment.cc (update_ts_in_maps): Change variable type.
* src/Experiment.h: Change field type to Vector<Histable*>*.
Distributions like Debian [0] and Gentoo are phasing out the use of
the non-portable `which` utility. Use POSIX's `command -v` instead.
[0] https://lwn.net/Articles/874049/
gprofng/ChangeLog
PR gprofng/32166
* testsuite/lib/Makefile.skel (JAVABIN): Replace use of which.
Fixed UBSAN runtime errors such as:
- load of value 4294967295, which is not a valid value for type 'Cmsg_warn'
- null pointer passed as argument 2, which is declared to never be null
- load of value 4294967295, which is not a valid value for type 'ProfData_type'
- reference binding to misaligned address 0x00000357583c for type 'long unsigned int', which requires 8 byte alignment
gprofng/ChangeLog
2024-09-09 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>.
PR gprofng/32096
* src/BaseMetric.cc: Fix UBSAN runtime errors.
* src/BaseMetric.h: Likewise.
* src/Emsg.h: Likewise.
* src/Experiment.cc: Likewise.
* src/Table.h: Likewise.
gprofng/ChangeLog
2024-08-15 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>.
* common/hwc_cpus.h: New constant for Appliedmicro processor.
* common/hwctable.c: Add the hwc table for Appliedmicro processor.
* src/hhwc_arm64_amcc.h: New file.
* src/collctrl.cc (read_int): Use strtol instead of atoi.
Extend the -H option:
-H {off|on|N1[-N2]} disable , or enable heap tracing, or
specify the heap data collection range.
The default is "-H off".
gprofng/ChangeLog
2024-08-08 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
* libcollector/heaptrace.c: Read the range in the -H option.
Do not collect data if the allocated memory is out of range.
* src/collctrl.h (heaptrace_mode): Define as char * value.
* src/envsets.cc: Updated since heaptrace_mode is changed.
* src/collctrl.cc: Accept the extended -H option.
* src/gp-collect-app.cc: Accept the extended -H option.
Remove unused code.
strchr is redefined as a macro in /usr/include/bits/string.h on CentOS 6/7.
In this case, we may not use our CALL_UTIL macro for strchr.
Use __collector_strchr instead of "CALL_UTIL (strchr)".
gprofng/ChangeLog
2024-07-28 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR 32018
* libcollector/hwprofile.c (open_experiment): Use __collector_strchr.
gprofng/ChangeLog
2024-07-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>.
* common/hwc_cpus.h: New constant for Intel Ice Lake processor.
* common/hwcdrv.c: Add a new argument to hwcfuncs_get_x86_eventsel.
Set config1 in perf_event_attr. Remove the use of memset.
* common/core_pcbe.c (core_pcbe_get_eventnum): Return 0.
* common/hwcentry.h: Add config1.
* src/collctrl.cc (Coll_Ctrl::build_data_desc):Set config1.
* common/hwcfuncs.c (process_data_descriptor): Set config1.
* common/hwctable.c: Add the hwc table for Intel Ice Lake processor.
* src/hwc_intel_icelake.h: New file.
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.
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.
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.
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.
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".
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_*.
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.
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.
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.
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.
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.
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.
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.
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.