2
0
mirror of https://sourceware.org/git/binutils-gdb.git synced 2025-03-25 14:01:00 +08:00

169 Commits

Author SHA1 Message Date
Sam James
8bf41b4c56
gprofng: regenerate Makefile.in
Needed after 90803ffdcc4d8c3d17566bf8dccadbad312f07a9.

gprofng/ChangeLog
	* src/Makefile.in: Regenerate.
2025-03-12 21:33:26 +00:00
Zheng Junjie
90803ffdcc gprofng: Fix cross-compilation binary name.
commit d25ba4596e85da6d8af78c88b5917e14763afbe1 create symbolic link
no care cross-compilation prefix.

gprofng/ChangeLog
2025-02-10  Zheng Junjie  <zhengjunjie@iscas.ac.cn>
	* src/Makefile.am: create symbolic link respect cross-compilation.
	* src/Makefile.in: Rebuild.
2025-03-12 14:06:04 -07:00
Nick Clifton
8c7653ab09
Change version to 2.44.50 and regenerate files 2025-01-19 12:40:46 +00:00
Vladimir Mezentsev
6f5fae607d gprofng: fix Segmentation Fault in DbeInstr::mapPCtoLine
The bug was filed against gprofng-gui (https://savannah.gnu.org/bugs/?66560).

gprofng/ChangeLog
2025-01-16  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/Hist_data.cc (DbeInstr::mapPCtoLine): Check for null pointer.
2025-01-17 08:26:45 -08:00
Vladimir Mezentsev
ef0802cd1f gprofng: don't check Elf when file is in archive
map.xml contains a checksum for all Elf files.
gprofng-archive archives a file only with the same checksum.
In gprofng-display-text no additional check is required.

gprofng/ChangeLog
2025-01-15  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/parse.cc: Don't check Elf when file is in archive.
2025-01-16 20:03:41 -08:00
Vladimir Mezentsev
8520cebeb5 Fix 32085 Source file not recognized for gcc 11.4.0-compiled code
gprofng cannot read compressed section.
In the next release we plan to use libbfd everywhere instead of our ELF reader.
But in this release I use bfd_get_full_section_contents() only
when bfd_is_section_compressed() returns true.

gprofng/ChangeLog
2025-01-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/32085
	* src/Elf.cc: Use bfd_get_full_section_contents to decompress a section.
	* src/Elf.h: Define SEC_DECOMPRESSED.
2025-01-07 22:27:46 -08:00
Vladimir Mezentsev
63eb193ca4 gprofng: remove the old archiver
The first versions of Performance Analyzer archived only function names.
This is no longer used. We need a real elf-file.

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

	* src/LoadObject.cc: Remove LoadObject::read_archive.
	* src/LoadObject.h: Likewise.
	* src/data_pckts.h: Remove unused declarations.
	* src/parse.cc (process_seg_map_cmd): Don't look for the old archive.
2025-01-02 15:46:48 -08:00
Alan Modra
5e04003fac Regen gprofng after copyright update 2025-01-01 22:19:36 +10:30
Alan Modra
e8e7cf2abe Update year range in copyright notice of binutils files 2025-01-01 18:29:57 +10:30
Vladimir Mezentsev
ded4c0a10e gprofng: fix sorting in Hist_data::sort
If the '-name soname' option is used, the fake '<Total>' function is expanded
with the name loadobject.

gprofng/ChangeLog
2024-12-09  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/Hist_data.cc (Hist_data::sort): Fix sorting.
2024-12-10 12:46:47 -08:00
Alan Modra
df2bd39958 Re: gprofng: use gprofng- prefix for gprofng binaries
Commit d25ba4596e85 mangled ZLIBINC to ZLIgp-C.  Fix that.
2024-12-10 10:10:57 +10:30
Vladimir Mezentsev
73e931862a Fix 32392 [2.44 Regression] gprofng fails to build on i686-linux-gnu
gprofng/ChangeLog
2024-11-26  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/32392
	* libcollector/libcol_util.c (__collector_util_init): Fix warning.
2024-11-27 13:55:03 -08:00
Vladimir Mezentsev
194a7cc5e4 gprofng: skip unrecognized input command
gprofng crashes when the GUI sends an invalid command.
Skip unrecognized commands and return an error status to the GUI.

gprofng/ChangeLog
2024-11-26  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/ipc.cc (ipc_doWork): Skip unrecognized commands.
	* src/ipcio.cc (writeError): New function.
	* src/ipcio.h: Add RESPONSE_STATUS_ERROR.
2024-11-27 13:55:02 -08:00
Vladimir Mezentsev
4e943705e3 gprofng: fix build with -std=gnu23
Fix function pointer types accordingly.
Remove unused function pointers.

gprofng/ChangeLog
2024-11-21  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/32374
	PR gprofng/32373
	* common/cpuid.c: Define ATTRIBUTE_UNUSED if necessary.
	* libcollector/libcol_util.c (sysinfo): Remove unused pointer.
	* src/collector_module.h: Likewise.
	* libcollector/dispatcher.c (setitimer): Fix prototype.
	* libcollector/linetrace.c (system, grantpt, ptsname): Likewise.
	* testsuite/gprofng.display/mttest/mttest.c (dump_arrays): Likewise.
	* testsuite/gprofng.display/synprog/endcases.c (xinline_code,
	s_inline_code): Likewise.
	* testsuite/gprofng.display/synprog/inc_inline.h (ext_inline_code):
	Likewise.
	* testsuite/gprofng.display/synprog/synprog.c (doabort): Rename nullptr.
2024-11-22 12:03:45 -08:00
Sam James
a2f774427e
gprofng: fix -std=gnu23 compatibility wrt unprototyped functions
C23 removes support for unprototyped functions. Fix function pointer types
accordingly.

This does not fix all instances, there's a few left as I commented on in
PR32374 (e.g. setitimer which I have a local workaround for but it involves
a glibc implementation detail; the Linaro precommit CI tester pointed that
out too, so dropped that).

ChangeLog:
	PR gprofng/32374

	* libcollector/collector.c (collector_sample): Fix prototype.
	* libcollector/envmgmt.c (putenv): Ditto.
	(_putenv): Ditto.
	(__collector_putenv): Ditto.
	(setenv): Ditto.
	(_setenv): Ditto.
	(__collector_setenv): Ditto.
	(unsetenv): Ditto.
	(_unsetenv): Ditto.
	(__collector_unsetenv): Ditto.
	* libcollector/jprofile.c (open_experiment): Ditto.
	(__collector_jprofile_enable_synctrace): Ditto.
	(jprof_find_asyncgetcalltrace): Ditto.
	* libcollector/libcol_util.c (__collector_util_init): Ditto.
	(ARCH): Ditto.
	* libcollector/mmaptrace.c (collector_func_load): Ditto.
	(collector_func_unload): Ditto.
	* libcollector/unwind.c (__collector_ext_unwind_init): Ditto.
	* src/collector_module.h: Ditto.
2024-11-18 05:12:56 +00:00
Vladimir Mezentsev
d25ba4596e gprofng: use gprofng- prefix for gprofng binaries
gprofng application names have a gp- prefix (gp-display-text, gp-archive, etc.).
But our man pages use the gprofng- prefix (gprofng-display-text,
gprofng-archive, etc.).
I renamed the gprofng binaries and temporarily created the gp-* links for
compatibility with the old gprofng-gui.
We plan to remove these links in version 2.46.

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

	* doc/gprofng-archive.texi: Rename gprofng application names.
	* doc/gprofng-collect-app.texi: Likewise.
	* doc/gprofng-display-html.texi: Likewise.
	* doc/gprofng-display-src.texi: Likewise.
	* doc/gprofng-display-text.texi: Likewise.
	* doc/gprofng.texi: Likewise.
	* doc/gprofng_ug.texi: Likewise.
	* gp-display-html/Makefile.am: Likewise.
	* gp-display-html/gp-display-html.in: Likewise.
	* libcollector/collector.c: Likewise.
	* src/Application.cc: Likewise.
	* src/Experiment.cc: Likewise.
	* src/Makefile.am: Likewise.
	* src/gp-archive.cc: Likewise.
	* src/gp-collect-app.cc: Likewise.
	* src/gp-display-src.cc: Likewise.
	* src/gp-display-text.cc: Likewise.
	* src/gprofng.cc: Likewise.
	* src/Makefile.in: Rebuild.
	* gp-display-html/Makefile.in: Rebuild.
2024-11-01 16:46:21 -07:00
Ruud van der Pas
d6a07eeabb gprofng: fix a memory leak in the mxv-pthreads example
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.
2024-10-17 20:20:23 -07:00
Vladimir Mezentsev
aaa4688f9d gprofng: fix regression in man page installation
gprofng/ChangeLog
2024-10-14  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* doc/Makefile.am: Use install-data-local to install gprofng examples.
	* doc/Makefile.in: Rebuild.
2024-10-17 08:53:44 -07:00
Andreas Schwab
620d68c984 gprofng: use xmalloc/xrealloc/xcalloc/xstrdup/xstrndup from libiberty
PR gprofng/32241
	* src/Makefile.am (CSOURCES): Remove dbe_memmgr.c
	* src/Makefile.in: Regenerate.
	* src/dbe_memmgr.c: Remove.
	* src/gprofng.cc (main): Call xmalloc_set_program_name.
	* src/gp-archive.cc (main): Likewise.
	* src/gp-collect-app.cc (main): Likewise.
	* src/gp-display-src.cc (main): Likewise.
	* src/gp-display-text.cc (main): Likewise.
	* src/Application.cc: Use xmalloc, xrealloc, xcalloc, xstrdup,
	xstrndup instead of malloc, realloc, calloc, strdup, strndup.
	* src/BaseMetric.cc: Likewise.
	* src/CallStack.cc: Likewise.
	* src/ClassFile.cc: Likewise.
	* src/Data_window.cc: Likewise.
	* src/Dbe.cc: Likewise.
	* src/DbeJarFile.cc: Likewise.
	* src/DbeSession.cc: Likewise.
	* src/DbeView.cc: Likewise.
	* src/DerivedMetrics.cc: Likewise.
	* src/DwarfLib.cc: Likewise.
	* src/Elf.cc: Likewise.
	* src/Emsg.cc: Likewise.
	* src/Experiment.cc: Likewise.
	* src/Function.cc: Likewise.
	* src/Module.cc: Likewise.
	* src/Print.cc: Likewise.
	* src/QLParser.yy: Likewise.
	* src/SAXParserFactory.cc: Likewise.
	* src/Settings.cc: Likewise.
	* src/SourceFile.cc: Likewise.
	* src/StringBuilder.cc: Likewise.
	* src/StringMap.h: Likewise.
	* src/Table.cc: Likewise.
	* src/checks.cc: Likewise.
	* src/collctrl.cc: Likewise.
	* src/comp_com.c: Likewise.
	* src/count.cc: Likewise.
	* src/envsets.cc: Likewise.
	* src/gp-archive.cc: Likewise.
	* src/gp-display-src.cc: Likewise.
	* src/gp-display-text.cc: Likewise.
	* src/gprofng.cc: Likewise.
	* src/ipc.cc: Likewise.
	* src/ipcio.cc: Likewise.
	* src/vec.h: Likewise.
	* src/util.cc: Likewise.
	(get_prog_name): Remove.
	* src/util.h: Likewise.
	* src/dbe_hwc.h (malloc, realloc, calloc, strdup): Define.
2024-10-16 15:34:07 +02:00
Vladimir Mezentsev
d9252a0459 Fix 32110 gprofng segfaults on parsing DWARF of clang++ 18.1.3 produced binary
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.
2024-10-13 13:02:56 -07:00
H.J. Lu
8789556ab4 gprofng: Use $(DESTDIR) in install-examples
Use $(DESTDIR) in install-examples to fix

mkdir -p -- /usr/share/doc//gprofng
mkdir: cannot create directory ‘/usr/share/doc//gprofng’: Permission denied

for "make install DESTDIR=...".

	* doc/Makefile.am (install-examples): Use $(DESTDIR).
	* doc/Makefile.in: Regenerated.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-10-11 06:03:38 +08:00
Vladimir Mezentsev
61621e018c gprofng: install examples to $(docdir)/gprofng
gprofng/ChangeLog
2024-10-09  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* doc/Makefile.am: Install gprofng examples.
	* doc/Makefile.in: Rebuild.
2024-10-10 10:14:01 -07:00
Vladimir Mezentsev
004d348063 gprofng: add hardware counters for Neoverse-N1 and Ampere-1 processors
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.
2024-10-07 18:41:36 -07:00
Ruud van der Pas
63b5e37fbc gprofng: fix a problem with hardware event counters
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.
2024-10-02 10:34:52 -07:00
Vladimir Mezentsev
519aef2dae Fix 32207 [gprofng collect app] Error in parsing the -O option
gprofng/ChangeLog
2024-09-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR 32207
	* src/collctrl.cc (preprocess_names): Fix the size in strndup.
2024-09-26 11:33:29 -07:00
Vladimir Mezentsev
b6532accdd Fix 32096 UBSAN issues in gprofng
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*>*.
2024-09-18 20:24:24 -07:00
Sam James
669aeefedb
gprofng: avoid use of non-portable which [PR32166]
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.
2024-09-12 22:53:22 +01:00
Vladimir Mezentsev
ad0751b6ec Fix 32096 UBSAN issues in gprofng
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.
2024-09-11 12:08:16 -07:00
Vladimir Mezentsev
a35d8973e5 Rename gp-* man pages to gprofng-* man pages
gprofng/ChangeLog
2024-09-05  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

	* doc/gp-archive.texi: Rename to doc/gprofng-archive.texi.
	* doc/gp-collect-app.texi: Rename to doc/gprofng-collect-app.texi.
	* doc/gp-display-html.texi: Rename to doc/gprofng-display-html.texi.
	* doc/gp-display-src.texi: Rename to doc/gprofng-display-src.texi.
	* doc/gp-display-text.texi: Rename to doc/gprofng-display-text.texi.
	* doc/gp-macros.texi: Add new macros.
	* doc/gprofng.texi: Rename man pages.
	* doc/gprofng_ug.texi: Likewise.
	* doc/Makefile.am: Likewise.
	* doc/Makefile.in: Rebuild.
2024-09-06 14:21:54 -07:00
Vladimir Mezentsev
b79c457ca0 Fix 32097 Warnings when building gprofng with Clang
gprofng/ChangeLog
2024-09-03  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

	PR gprofng/32097
	* common/hwcdrv.c: Fix -Wempty-body warnings.
	* common/hwcentry.h: Fix -Wdeprecated-non-prototype warnings.
	* common/hwctable.c: Fix -Wdeprecated-non-prototype warnings.
	* libcollector/collector.c: Likewise.
	* libcollector/collector.h: Likewise.
	* libcollector/collectorAPI.c: Likewise.
	* libcollector/dispatcher.c: Likewise.
	* libcollector/iotrace.c: Likewise.
	* libcollector/libcol_util.c: Fix -Wunused-but-set-variable warnings.
	* libcollector/libcol_util.h: Remove unused declarations.
	* libcollector/linetrace.c: Fix -Wdeprecated-non-prototype warnings.
	* src/BaseMetricTreeNode.h: Fix -Wunused-private-field warnings.
	* src/Dbe.cc: Fix -Wself-assign warnings.
	* src/DbeSession.cc: Fix -Wunused-but-set-variable warnings.
	* src/Disasm.cc: Fix -Wunused-const-variable warnings.
	* src/Experiment.cc: Fix -Wunused-private-field warnings.
	* src/HashMap.h: Fix -Wself-assign warnings.
	* src/IOActivity.h: Fix -Wunused-private-field warnings.
	* src/collctrl.cc: Fix -Wself-assign, -Wparentheses-equality warnings.
	* src/collctrl.h: Fix -Wunused-private-field warnings.
	* src/collector_module.h: Fix -Wdeprecated-non-prototype warnings.
	* src/gp-display-src.cc: Fix -Wunused-private-field warnings.
	* src/gp-print.h: Fix -Wheader-guard warnings.
	* src/hwc_intel_icelake.h: Fix -Winitializer-overrides warnings.
	* src/util.cc: Fix -Wunused-but-set-variable warnings.
2024-09-04 13:49:21 -07:00
Sam James
1ebf4606c2
gprofng: testsuite: fix 'wrapper' typo
gprofng/ChangeLog
            * testsuite/config/default.exp: Fix 'wrapper' typo.
2024-08-22 04:15:16 +01:00
Vladimir Mezentsev
4456cb827f gprofng: add hardware counters for Appliedmicro processor
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.
2024-08-19 17:26:20 -07:00
Vladimir Mezentsev
72e96189d8 gprofng: fix typo in src/collctrl.cc
gprofng/ChangeLog
2024-08-13  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/collctrl.cc (read_cpuinfo): Fix typo.
2024-08-14 19:30:29 -07:00
Vladimir Mezentsev
6a60060d3e gprofng: specify the heap data collection range
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.
2024-08-12 15:54:59 -07:00
Vladimir Mezentsev
c4ffbc564d gprofng: 32018 Compilation of binutils 2.43 failed on CentOS 6
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.
2024-07-30 12:06:26 -07:00
Nick Clifton
cff16e125a Change version to 2.43.50 2024-07-20 13:16:33 +01:00
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
Vladimir Mezentsev
971ae1844e gprofng: add hardware counters for Intel Ice Lake processor
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.
2024-07-09 10:50:05 -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
9af067bfcd gprofng: add hardware counters for AMD Zen4
ChangeLog
2024-06-01  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* common/hwctable.c: Add the hwc table for AMD Zen4.
	* src/hwc_amd_zen4.h: New file.
	* src/hwc_amd_zen3.h: Define _HWC_AMD_ZEN3_H.
2024-06-03 11:38:58 -07:00
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