aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
AgeCommit message (Collapse)AuthorFilesLines
2026-04-06gprofng format mismatch on 32-bit hostAlan Modra1-3/+3
On a 32-bit host without --enable-64-bit-bfd gp-gmon.cc:531:42: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘bfd_size_type’ {aka ‘unsigned int’} [-Wformat=] On a 32-bit-host with --enable-64-bit-bfd the underlying type will be unsigned long long. * src/gp-gmon.cc (gen_gmon_map): Use %llu to print msize, and cast.
2026-03-11gprofng: fix display gmon option error handlingClaudiu Zissulescu1-17/+15
Parse display gmon options only once so invalid arguments are not reported twice and exit status is set to failure for invalid usage. Also add tests in gp-gmon.exp to verify unknown options and missing -o argument fail as expected and produce a single diagnostic. gprofng/ * src/gp-gmon.cc (usage_and_exit): New function. (check_mods): Change number of parameters. (checkflagterm): Fix error text, update to use new functions. * testsuite/gprofng.display/gp-gmon.exp: Add new test.
2026-03-07Remove bfd_boolean from gas and gprofngAlan Modra1-3/+3
A few uses have crept back in, replace with bool. Also replace FALSE/TRUE with false/true.
2026-01-26regen gprofng configAlan Modra1-4/+10
2026-01-25Regenerate autogenerated filesNick Clifton1-10/+4
2026-01-01Update year range in copyright notice of binutils filesAlan Modra215-216/+216
Avoid warnings about invalid escapes in etc/update-copyright.py by using raw strings, add BinutilsFilter to skip psql.rc and add "Kalray SA." as another copyright holder.
2025-11-28gprofng: protect against standard library macrosAndreas Schwab1-1/+1
The CALL_UTIL macro can expand to an unparsable expression of the argument is a macro, like with the new const-preserving standard library macros in C23. * gprofng/src/collector_module.h (CALL_UTIL): Add parens to not expand its argument if it is a function-like macro.
2025-11-22gprofng: disable LTO as a workaroundSam James2-8/+51
Temporarily disable LTO by passing -fno-lto until PR32092 is fixed, as we get test failures and seemingly a completely broken gprofng otherwise. Use the same idiom as libdecnumber for -fno-lto. gprofng/ PR gprofng/32092 * Makefile.am: Pass -fno-lto if supported. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Pass -fno-lto if supported. * doc/Makefile.in: Regenerate. * gp-display-html/Makefile.in: Regenerate. * libcollector/Makefile.am: Pass -fno-lto if supported. * libcollector/Makefile.in: Regenerate. * src/Makefile.am: Pass -fno-lto if supported. * src/Makefile.in: Regenerate.
2025-11-21gprofng: Remove public hz and whoami variablesClaudiu Zissulescu14-63/+70
Remove public hz and whoami variables. This fixes the errors when building with --enable-shared.
2025-11-20gprofng: Remove runstatedir from Makefile.inClaudiu Zissulescu1-1/+0
Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-11-20gprofng: New tool for converting gmon.out file to experimentsClaudiu Zissulescu23-6/+3298
This patch introduces the capability to convert a gmon.out file into a gprofng experiment. The gmon.out file format includes a histogram record, a call graph record, and basic block execution count records. A gprofng experiment folder consists of various files, of which four are particularly important: - log.xml: Contains the profile timer setup and defines the profile data structure fields. - map.xml: Contains the memory map information of the profiled executable. - profile: Holds the time profile information. - data.frameinfo: Records the stack trace at a specific sampling moment, with each trace linked to the time profile information stored in the profile file. This patch adds a new tool to gprofng that reads the gmon.out file and the profiled executable. With the executable, we can reconstruct information about the profiled symbols and the memory map layout. The gmon.out file provides details about the execution duration for each symbol, as well as data used to build the call graph. This new patch is a subcommand for the display command. New gmon subcommand options: --version print the version number and exit. -h/--help print usage information and exit. -o <exp_name> specify the name for (and path to) the experiment directory; the the default path is the current directory. -O <exp_name> the same as -o, but unlike the -o option, silently overwrite an existing experiment directory with the same name. The new tool can be executed using the command line: $ gprofng display gmon EXEC_FILE GMON_FILE N.B. If EXEC_FILE or GMON_FILE is missing the default a.out and gmon.out names are considered. Upon successful execution, an experiment file is created that can be processed with existing gprofng tools. For example: $ gprofng display text -calltree EXPERIMENT This command will display the call tree from the converted gmon file. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-09-25Binutils: Add clang LTO support to AR and RANLIBH.J. Lu1-4/+10
Detect the clang plugin file and and pass it to --plugin for ar and ranlib so that binutils can be built with clang LTO. bfd/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. binutils/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. gas/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. gprof/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * testsuite/Makefile.in: Likewise. gprofng/ PR binutils/33470 * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * gp-display-html/Makefile.in: Likewise. * libcollector/Makefile.in: Likewise. * libcollector/aclocal.m4: Likewise. * libcollector/configure: Likewise. * src/Makefile.in: Likewise. * libcollector/Makefile.am (ACLOCAL_AMFLAGS): Add -I ../../config. ld/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. libctf/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. libsframe/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. opcodes/ PR binutils/33470 * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-19gprofng: do not skip weak symbolsDmitrii Bordukov1-1/+1
PR gprofng/33151 gprofng ignores functions that are compiled as weak symbols. This heavily affects C++ class methods that are always compiled by g++ and clang++ as weak symbols. In this case 'gprofng display text' just displays <static>@ADDRESS(<FILENAME>) instead of proper method name. The bug has been introduced in the commit 470a0288a818.
2025-07-08gprofng: support external debug infoVladimir Mezentsev15-185/+279
Use bfd_follow_gnu_debuglink() and bfd_follow_gnu_debugaltlink() to find files with debug info. If necessary, gprofng-archive copies these files to EXP/archives. For each executable, gprofng creates the Elf class twice. One of them was a memory leak. Fixed this by adding a new argument to Stabs::Stabs(). gprofng/ChangeLog 2025-07-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR 32147 PR 30194 * src/Disasm.cc (get_funcname_in_plt): Use the executable file instead of the debug information file. * src/Dwarf.h: Define debug_alt_strSec. * src/DwarfLib.cc: Add support for DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt. * src/Elf.h (find_gnu_debug_files, get_dwr_section): New functions. * src/Elf.cc: Likewise. * src/Experiment.cc (copy_file): Add the const qualifier. * src/Experiment.h: Likewise. * src/LoadObject.cc (get_elf, openDebugInfo): Find files with debug info. * src/LoadObject.h: Remove unused variables. * src/Module.cc: Remove an argument in openDebugInfo(). * src/Stabs.cc (Stabs::Stabs): Add the Elf* argument. * src/Stabs.h: Likewise. * src/gp-archive.cc: Archive files with debug info. * src/gp-archive.h (archive_file): New function.
2025-07-07gprofng: remove ElfReloc class and unused functions and declarationsVladimir Mezentsev9-498/+6
class ElfReloc is not used after we started use libbfd. Removed ElfReloc and other unused declarations. gprofng/ChangeLog 2025-07-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/Disasm.cc: Remove unused functions and variables. * src/Disasm.h: Likewise. * src/Dwarf.cc: Likewise. * src/DwarfLib.cc: Likewise. * src/DwarfLib.h: Likewise. * src/Elf.cc: Likewise. * src/Elf.h: Likewise. * src/Stabs.cc: Likewise. * src/Stabs.h: Likewise.
2025-06-26gprofng: need to know that experiment was created on big-endian machineVladimir Mezentsev6-4/+20
gprofng/ChangeLog 2025-06-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * configure.ac: Add AC_C_BIGENDIAN. * common/config.h.in: Rebuild. * configure: Rebuild. * libcollector/collector.c (log_header_write): Save big-endian flag. * src/DbeSession.h (is_bigendian): New function. * src/DbeSession.cc: Likewise. * src/Experiment.cc: Set 'bigendian' and 'need_swap_endian'. * src/Experiment.h: New field 'bigendian'. * src/LoadObject.cc: Remove an unused variable. * src/LoadObject.h: Likewise.
2025-05-21gprofng: fix 32892 source line level information not available with "-g -O2"Vladimir Mezentsev8-94/+442
gprofng did not read the .debug_rnglists section for dwarf-5. Another problem was that gprofng ignored DW_AT_abstract_origin As a result, gprofng skiped Dwarf for all functions declared as: <1><e18b>: Abbrev Number: 43 (DW_TAG_subprogram) <e18c> DW_AT_abstract_origin: <0xe168> <e190> DW_AT_linkage_name: _ZN10Bool_ArrayD2Ev gprofng/ChangeLog 2025-05-19 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR 32892 * src/Dwarf.cc: Read the .debug_rnglists section. Support DW_AT_abstract_origin. * src/Dwarf.h: Likewise. * src/DwarfLib.cc: Likewise. * src/DwarfLib.h: Likewise. * src/LoadObject.cc (dump_functions): Print mangled names for aliases. * src/Stabs.cc (fixSymtabAlias): Set 'alias' correctly. * src/Symbol.cc (find_symbols): Add argument where to collect symbols. * src/Symbol.h: Likewise.
2025-05-05gprofng: remove unused functions, duplicate macrosVladimir Mezentsev6-102/+1
class Reloc is not used after commit 13f614be23a gprofng: Refactor readSymSec for using BFD's asymbol struct Many common macros were defined in different sources. Sometimes a macro was used, sometimes a macros value was used. Removed unused macros and include files. gprofng/ChangeLog 2025-05-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * common/gp-experiment.h: Define variables that are passed to libcollector. Remove unused macros. * libcollector/collector.c: Cleanup macros. * libcollector/descendants.h: Likewise. * libcollector/envmgmt.c: Likewise. * libcollector/linetrace.c: Likewise. * src/collect.h: Likewise. * src/envsets.cc: Likewise. * src/gp-collect-app.cc: Likewise. * src/Stabs.cc: Remove class Reloc. * src/Stabs.h: Likewise. * src/ipcio.cc: Remove unused include files.
2025-05-04gprofng: fix 32892 source line level information not available with "-g -O2"Vladimir Mezentsev11-153/+563
gprofng ignored DW_AT_specification. As a result, gprofng skiped Dwarf for all functions declared as: < 2>:<0x0000f725> DW_TAG_subprogram(46) DW_AT_linkage_name(110) "func_name" DW_AT_declaration*(60) 0x1 (1) < 1>:<0x00015acc> DW_TAG_subprogram(46) DW_AT_specification(71) 0xf725 (63269) Another problem was that gprofng ignored DW_AT_ranges. As a result, many functions are mapped to the <Unknown> module. gprofng/ChangeLog 2025-05-01 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR 32892 * src/Dwarf.cc: Handle DW_AT_specification and DW_AT_ranges. * src/DwarfLib.cc: Likewise. * src/DwarfLib.h: Likewise. * src/Dwarf.h (get_ranges): New function. * src/Stabs.h (get_symbols): New function. * src/Stabs.cc: Move Symbol class to src/Symbol.cc. * src/Symbol.cc: New file. * src/Symbol.h: New file. * src/Makefile.am: Add Symbol.cc in build. * src/Makefile.in: Rebuild. * src/LoadObject.cc (dump_functions): Improve output for -dfunc option.
2025-04-28gprofng not reading references correctly in DwarfVladimir Mezentsev2-9/+9
Fixed as specified in the DWARF standard: The first type of reference can identify any debugging information entry within the containing unit. This type of reference is an offset from the first byte of the compilation header for the compilation unit containing the reference. There are five forms for this type of reference. There are fixed length forms for one, two, four and eight byte offsets (respectively, DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, and DW_FORM_ref8). There is also an unsigned variable length offset encoded form that uses unsigned LEB128 numbers (DW_FORM_ref_udata). gprofng/ChangeLog 2025-04-27 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/DwarfLib.cc (set_die): Handling DWARF references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata). * src/Dwarf.cc: Likewise.
2025-04-21gprofng: fix 32886 wrong mapping from instruction to line numberVladimir Mezentsev1-7/+3
On Intel, gprofng should adjusts return addresses, including user leaf functions. gprofng/ChangeLog 2025-04-18 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/CallStack.cc (add_stack): Adjust return addresses on Intel.
2025-04-18Fix 32885 gprofng --help should state where to report bugsVladimir Mezentsev5-5/+10
gprofng/ChangeLog 2025-04-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/gp-archive.cc: Fix the --help output. * src/gp-collect-app.cc: Likewise. * src/gp-display-src.cc: Likewise. * src/gp-display-text.cc: Likewise. * src/gprofng.cc: Likewise.
2025-04-06gprofng: Remove duplicate symbolsClaudiu Zissulescu3-0/+43
Remove all duplicate symbols which can be in SymLst. The duplication is due to processing of both static and dynamic symbols. The Stabs::removeDupSyms function is called before computing symbol aliases. Introduce a new vector function (i.e., truncate()), that truncates a vector lenght to the given new count. This functionis used by removeDupSyms function. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-04-06gprofng: Refactor readSymSec for using BFD's asymbol structClaudiu Zissulescu5-81/+59
This patch refactors a number of gprofng internal functions for using more BFD data types and functions. Stabs::readSymSec is a function which reads the symbols of an ELF file mapping them into an internal structure. To use BFD asymbols, the Elf::elf_getsym is changed from custom reading of the symbols from .symtab and .dynsym section to BFD enable functions. A new function is introduced which returns the number of either static or dynamic symbols, named Elf::elf_getSymCount. Both Elf functions are used by Stabs::readSymSec refactoring. Also, this patch removes reading symbols, SUNW_ldnsym section as it is only used by now defunct Studio compiler. However, it adds the reading of both static and dynamic symbols, previously, only either one was processed. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-04-06gprofng: Remove check_Relocs() functionClaudiu Zissulescu2-140/+2
check_Relocs() function is not anylonger required as it can only handle Studio compiler relocs, now defunct. Remove this function. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-03-12gprofng: regenerate Makefile.inSam James1-0/+1
Needed after 90803ffdcc4d8c3d17566bf8dccadbad312f07a9. gprofng/ChangeLog * src/Makefile.in: Regenerate.
2025-03-12gprofng: Fix cross-compilation binary name.Zheng Junjie2-14/+10
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-01-17gprofng: fix Segmentation Fault in DbeInstr::mapPCtoLineVladimir Mezentsev1-2/+5
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-16gprofng: don't check Elf when file is in archiveVladimir Mezentsev1-14/+0
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-07Fix 32085 Source file not recognized for gcc 11.4.0-compiled codeVladimir Mezentsev2-8/+31
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-02gprofng: remove the old archiverVladimir Mezentsev4-358/+11
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-01Regen gprofng after copyright updateAlan Modra1-1/+1
2025-01-01Update year range in copyright notice of binutils filesAlan Modra196-197/+197
2024-12-10gprofng: fix sorting in Hist_data::sortVladimir Mezentsev1-2/+1
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-10Re: gprofng: use gprofng- prefix for gprofng binariesAlan Modra2-2/+2
Commit d25ba4596e85 mangled ZLIBINC to ZLIgp-C. Fix that.
2024-11-27gprofng: skip unrecognized input commandVladimir Mezentsev3-3/+18
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-22gprofng: fix build with -std=gnu23Vladimir Mezentsev1-1/+0
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-18gprofng: fix -std=gnu23 compatibility wrt unprototyped functionsSam James1-1/+1
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-01gprofng: use gprofng- prefix for gprofng binariesVladimir Mezentsev9-143/+151
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-10-16gprofng: use xmalloc/xrealloc/xcalloc/xstrdup/xstrndup from libibertyAndreas Schwab43-497/+356
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-13Fix 32110 gprofng segfaults on parsing DWARF of clang++ 18.1.3 produced binaryVladimir Mezentsev1-5/+33
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-07gprofng: add hardware counters for Neoverse-N1 and Ampere-1 processorsVladimir Mezentsev2-0/+639
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-09-26Fix 32207 [gprofng collect app] Error in parsing the -O optionVladimir Mezentsev1-1/+1
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-18Fix 32096 UBSAN issues in gprofngVladimir Mezentsev3-17/+24
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-11Fix 32096 UBSAN issues in gprofngVladimir Mezentsev5-24/+40
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-04Fix 32097 Warnings when building gprofng with ClangVladimir Mezentsev14-54/+30
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-08-19gprofng: add hardware counters for Appliedmicro processorVladimir Mezentsev2-1/+187
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-14gprofng: fix typo in src/collctrl.ccVladimir Mezentsev1-1/+2
gprofng/ChangeLog 2024-08-13 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/collctrl.cc (read_cpuinfo): Fix typo.
2024-08-12gprofng: specify the heap data collection rangeVladimir Mezentsev4-137/+48
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-07-10RISC-V:[gprofng] Minimal support gprofng for riscv.Yixuan Chen6-2/+16
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.