summaryrefslogtreecommitdiff
path: root/gprofng/libcollector
Commit message (Collapse)AuthorAgeFilesLines
* gprofng: 30360 Seg. Fault when application uses std::threadVladimir Mezentsev2023-04-176-94/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gprofng: Add version symbols to libgprofng.verVladimir Mezentsev2023-03-292-42/+62
| | | | | | | | | gprofng/ChangeLog 2023-03-29 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30089 * libcollector/libgprofng.ver: Add version symbols. * libcollector/synctrace.c: Fix typo for pthread_mutex_lock.
* gprofng: 30089 [display text] Invalid number of threadsVladimir Mezentsev2023-03-2717-2328/+1229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The real problem is that libcollector doesn't interpose thread_create@GLIBC_2.34 We interpose a lot of libC functions (dlopen, fork, pthread_create, etc.). Some of these functions have versions. For example, dlopen@GLIBC_2.34, dlopen@GLIBC_2.17, dlopen@GLIBC_2.2.5, etc. We have to interpose each of the functions because we don't know which version of libC will be used during profiling. Historically, we have used three versions of scripts (mapfile.aarch64-Linux, mapfile.amd64-Linux, mapfile.intel-Linux). Three are not needed. One is enough The fixes below include: - merged all version symbols into one version script. - added new version symbols which are defined in latest versions of libC. - removed unused defines and duplicated code. - added the DCL_FUNC_VER macro to define the version symbols. Tested on x86_64 and aarch64 (OL8/OL9). No regression. gprofng/ChangeLog 2023-03-23 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30089 * libcollector/Makefile.am: Use libgprofng.ver instead of mapfile.* * libcollector/configure.ac: Delete GPROFNG_VARIANT. * src/collector_module.h: Move the SYMVER_ATTRIBUTE macro to collector.h * libcollector/collector.h: Add macros (SYMVER_ATTRIBUTE, DCL_FUNC_VER). Remove unused defines. * libcollector/dispatcher.c: Interpose functions from libC. Clean up the old code. * libcollector/iotrace.c: Likewise. * libcollector/libcol_util.c: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/mmaptrace.c: Likewise. * libcollector/synctrace.c: Likewise. * libcollector/libgprofng.ver: New file. * libcollector/Makefile.in: Rebuild. * libcollector/configure: Rebuild. * libcollector/mapfile.aarch64-Linux: Removed. * libcollector/mapfile.amd64-Linux: Removed. * libcollector/mapfile.intel-Linux: Removed. * libcollector/mapfile.sparc-Linux: Removed. * libcollector/mapfile.sparcv9-Linux: Removed.
* gprofng: Use prototype to call libc functionsVladimir Mezentsev2023-03-198-174/+150
| | | | | | | | | | | | | | | | | | | libcollector may not link against libC. We use dlsym() to get a function from libc. In some files, pointers to these functions do not have prototypes. I also moved the shared definitions to libcollector/collect.h. gprofng/ChangeLog 2023-03-15 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> libcollector/collector.c: Add prototypes. libcollector/dispatcher.c: Likewise. libcollector/heaptrace.c: Likewise. libcollector/iotrace.c: Likewise. libcollector/linetrace.c: Likewise. libcollector/mmaptrace.c: Likewise. libcollector/synctrace.c: Likewise. libcollector/collector.h: Add CALL_REAL(), NULL_PTR(), and DBG_LT.
* gprofng: PR30036 Build failure on aarch64 w/ glibc: symbol `pwrite64' is ↵Vladimir Mezentsev2023-02-172-8/+9
| | | | | | | | | | | | already defined gprofng/ChangeLog 2023-02-16 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30036 * libcollector/iotrace.c: Define creat64 and pwrite64 only when __USE_LARGEFILE64 and __USE_FILE_OFFSET64 are not defined. * libcollector/mmaptrace.c: Likewise for mmap64.
* Update year range in gprofng copyright noticesAlan Modra2023-01-0136-36/+36
| | | | | | | | | | | This adds 'Innovative Computing Labs' as an external author to update-copyright.py, to cover the copyright notice in gprofng/common/opteron_pcbe.c, and uses that plus another external author 'Oracle and' to update gprofng copyright dates. I'm not going to commit 'Oracle and' as an accepted author, but that covers the string "Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved." found in gprofng/testsuite/gprofng.display/jsynprog files.
* Update version number and regenerate filesNick Clifton2022-12-311-10/+10
|
* gprofng: PR29646 Various warningsVladimir Mezentsev2022-12-194-4/+9
| | | | | | | | | | | | | | | | | gprofng/ChangeLog 2022-12-19 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29646 * common/core_pcbe.c: Fix missingReturn warning. * libcollector/iolib.c: Fix -Waddress warnings. * src/Settings.cc: Likewise. * src/checks.cc: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/iotrace.c: Fix va_end_missing error. * libcollector/libcol_util.c: Fix uninitvar warning. * src/Command.cc: Fix arrayIndexOutOfBounds error. * src/Function.cc: Fix uninitStructMember warning. * src/ipc.cc: Fix -Wwrite-strings warnings.
* gprofng: fix build with --enable-pgo-build=ltoVladimir Mezentsev2022-10-045-28/+30
| | | | | | | | | | | | gprofng/ChangeLog 2022-10-04 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29579 * libcollector/dispatcher.c: Fix the symbol version in SYMVER_ATTRIBUTE. * libcollector/iotrace.c: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/mmaptrace.c: Likewise. * libcollector/synctrace.c: Likewise.
* gprofng: fix build issues on muslVladimir Mezentsev2022-09-1415-233/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gprofng/ChangeLog 2022-09-14 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29477 * configure.ac: Set __MUSL_LIBC. * configure: Rebuild. * common/config.h.in: Rebuild. * src/collector_module.h: Fix compiler errors because mmap64, open64, pwrite64 are macros and getcontext() is absent on musl. * libcollector/collector.c: Likewise. * libcollector/hwprofile.c: Likewise. * libcollector/iolib.c: Likewise. * libcollector/libcol_util.c: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/memmgr.c: Likewise. * libcollector/profile.c: Likewise. * libcollector/unwind.c: Likewise. * libcollector/dispatcher.c: Likewise. * src/Experiment.cc: Likewise. * libcollector/collector.h: Use dlsym() because dlvsym() is not defined on musl. * libcollector/iotrace.c: Remove interposition of versioned functions. * libcollector/mmaptrace.c: Likewise. * libcollector/libcol_util.h: Fix -Wint-to-pointer-cast warnings. * libcollector/jprofile.c: Likewise. * libcollector/synctrace.c: Include "collector.h". * src/Print.cc: Use get_basename() because basename() is not defined on musl. * common/hwcdrv.c: Fix -Wformat= warnings.
* gprofng: fix bug 29479 Collection fails when built without java supportVladimir Mezentsev2022-08-182-0/+4
| | | | | | | | | | gprofng/ChangeLog 2022-08-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29479 * libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for java specific code. * libcollector/unwind.c: Likewise.
* gprofng: fix regression in build and a race condition in autoreconfVladimir Mezentsev2022-07-183-6/+8
| | | | | | | | | | | | gprofng/ChangeLog 2022-07-14 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29338 * libcollector/configure.ac (AC_CONFIG_HEADERS): Fix a race condition. * libcollector/configure: Rebuild. * libcollector/Makefile.in: Rebuild. * common/config.h.in: Rebuild. * common/lib-config.h.in: Created by autoreconf.
* Regenerate with automake-1.15.1Alan Modra2022-07-093-339/+250
| | | | | | | | | | | | | | | | | Until we update the recommended versions of autoconf/automake, files should be regenerated with automake-1.15.1 and autoconf-2.69. That's not because we think those versions are golden, and newer versions are bad. It's simply because maintainers want to be able to update configury files without trouble, and if someone regenerates files with automake-1.16.5 then --enable-maintainer-mode builds will hit errors: checking that generated files are newer than configure... configure.ac:26: error: version mismatch. This is Automake 1.15.1, configure.ac:26: but the definition used by this AM_INIT_AUTOMAKE configure.ac:26: comes from Automake 1.16.5. You should recreate configure.ac:26: aclocal.m4 with aclocal and run automake again. WARNING: 'automake-1.15' is probably too old. Correcting this requires regenerating the files by hand.
* Update version to 2.39.50 and regenerate filesNick Clifton2022-07-083-260/+349
|
* gprofng: adjust GPROFNG_VARIANTVladimir Mezentsev2022-07-062-20/+26
| | | | | | | | | | | GPROFNG_VARIANT depends on compiler options, not on $(host). gprofng/ChangeLog 2022-07-06 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29116 * libcollector/configure.ac: Adjust GPROFNG_VARIANT. * libcollector/configure: Rebuild.
* gprofng: fix build with --disable-sharedVladimir Mezentsev2022-05-262-2/+3
| | | | | | | | gprofng/ChangeLog 2022-05-26 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * libcollector/configure.ac: Use AC_MSG_WARN instead of AC_MSG_ERROR * libcollector/configure: Rebuild.
* gprofng: fix build with -mx32Vladimir Mezentsev2022-05-266-46/+39
| | | | | | | | | | | | | | gprofng/ChangeLog 2022-05-26 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/28983 * libcollector/libcol_util.h (__collector_getsp, __collector_getfp, __collector_getpc): Adapt for build with -mx32 * libcollector/heaptrace.c: Fix -Wpointer-to-int-cast warnings. * libcollector/hwprofile.h: Likewise. * libcollector/mmaptrace.c: Likewise. * libcollector/synctrace.c: Likewise. * libcollector/unwind.c: Likewise.
* gprofng: use $host instead $targetVladimir Mezentsev2022-05-052-2/+2
| | | | | | | | | | | | | | By mistake, $target was used instead of $host to configure the gprogng build. gprofng/ChangeLog 2022-04-28 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29113 PR gprofng/29116 * configure.ac: Use $host instead $target. * libcollector/configure.ac: Likewise. * configure: Rebuild. * libcollector/configure: Rebuild.
* gprofng doesn't build with gcc 5.5Vladimir Mezentsev2022-04-111-7/+13
| | | | | | | | | | | | | | | | | | | | gprofng/ChangeLog 2022-04-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29026 * configure.ac: Check version of bison. * src/Makefile.am (QLParser.yy): Run bison * src/QLParser.yy: Adapted for bison 3.04 or later. * src/DbeSession.cc: make some params const. * src/DbeSession.h: Likewise. * configure: Regenerate. * Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * src/QLParser.tab.cc: Deleted. * src/QLParser.tab.hh: Deleted. * doc/Makefile.in: Regenerate. * gp-display-html/Makefile.in: Regenerate. * libcollector/configure: Regenerate.
* gprofng: fprintf_styled_func not inizialized for disassemblerVladimir Mezentsev2022-04-081-0/+9
| | | | | | | | gprofng/ChangeLog 2022-04-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * libcollector/unwind.c: inizialize fprintf_styled_func. * src/Disasm.cc: Likewise.
* Only .so files are used in libcollector. Remove the other files.Vladimir Mezentsev2022-03-232-2/+6
| | | | | | * libcollector/Makefile.am (install-data-local): Remove the *.la and *.a libraries. * libcollector/Makefile.in: Regenerate.
* Install gprofng libraries under $(pkglibdir)Vladimir Mezentsev2022-03-212-43/+54
| | | | | | | | | | | | | | | | | | | | | gprofng/ChangeLog 2022-03-21 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/28972 * gprofng/libcollector/Makefile.am: Rename lib_LTLIBRARIES to pkglib_LTLIBRARIES. Add install-data-local. * gprofng/src/Makefile.am: Likewise. * gprofng/src/envsets.cc (putenv_libcollector_ld_misc): New location of the gprofng libraries. * gprofng/configure.ac: Removed an unused GPROFNG_LIBDIR. * gprofng/Makefile.am: Removed an unused GPROFNG_LIBDIR. Add install-data-local. * gprofng/configure: Regenerate. * gprofng/Makefile.in: Likewise. * gprofng/doc/Makefile.in: Likewise. * gprofng/gp-display-htmllibcollector/Makefile.in: Likewise. * gprofng/libcollector/Makefile.in: Likewise. * gprofng/src/Makefile.in: Likewise.
* Fix Build issues due to patch "gprofng: a new GNU profiler"Nick Clifton2022-03-183-71/+3
| | | | Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
* gprofng configure target testsAlan Modra2022-03-173-81/+132
| | | | | | | | | | | | | | | | ${target} in configure.ac should be the canonical target, so that for example, someone configuring with --target=x86_64-linux will match x86_64-*-linux*. * configure.ac: Invoke AC_CANONICAL_TARGET. * libcollector/configure.ac: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * gp-display-html/Makefile.in: Regenerate. * libcollector/Makefile.in: Regenerate. * libcollector/configure: Regenerate. * src/Makefile.in: Regenerate.
* gprofng: Use symver attribute if availableH.J. Lu2022-03-165-86/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use symver attribute if available, instead of asm statement, to support LTO build. PR gprof/28962 * libcollector/dispatcher.c (timer_create@@GLIBC_2.3.3): Use SYMVER_ATTRIBUTE. (timer_create@GLIBC_2.2): Likewise. (timer_create@GLIBC_2.2.5): Likewise. (pthread_create@@GLIBC_2.1): Likewise. (pthread_create@GLIBC_2.0): Likewise. * libcollector/iotrace.c (open64@@GLIBC_2.2): Likewise. (open64@GLIBC_2.1): Likewise. (fopen@@GLIBC_2.1): Likewise. (fopen@GLIBC_2.0): Likewise. (fclose@@GLIBC_2.1): Likewise. (fclose@GLIBC_2.0): Likewise. (fdopen@@GLIBC_2.1): Likewise. (fdopen@GLIBC_2.0): Likewise. (pread@@GLIBC_2.2): Likewise. (pread@GLIBC_2.1): Likewise. (pwrite@@GLIBC_2.2): Likewise. (pwrite@GLIBC_2.1): Likewise. (pwrite64@@GLIBC_2.2): Likewise. (pwrite64@GLIBC_2.1): Likewise. (fgetpos@@GLIBC_2.2): Likewise. (fgetpos@GLIBC_2.0): Likewise. (fgetpos64@@GLIBC_2.2): Likewise. (fgetpos64@GLIBC_2.1): Likewise. (fsetpos@@GLIBC_2.2): Likewise. (fsetpos@GLIBC_2.0): Likewise. (fsetpos64@@GLIBC_2.2): Likewise. (fsetpos64@GLIBC_2.1): Likewise. * libcollector/linetrace.c (posix_spawn@@GLIBC_2.15): Likewise. (posix_spawn@GLIBC_2.2): Likewise. (posix_spawn@GLIBC_2.2.5): Likewise. (posix_spawnp@@GLIBC_2.15): Likewise. (posix_spawnp@GLIBC_2.2): Likewise. (posix_spawnp@GLIBC_2.2.5): Likewise. (popen@@GLIBC_2.1): Likewise. (popen@GLIBC_2.0): Likewise. (_popen@@GLIBC_2.1): Likewise. (_popen@GLIBC_2.0): Likewise. * libcollector/mmaptrace.c (dlopen@@GLIBC_2.1): Likewise. (dlopen@GLIBC_2.0): Likewise. * libcollector/synctrace.c (pthread_cond_wait@@GLIBC_2.3.2): Likewise. (pthread_cond_wait@GLIBC_2.0): Likewise. (pthread_cond_wait@GLIBC_2.2.5): Likewise. (pthread_cond_wait@GLIBC_2.2): Likewise. (pthread_cond_timedwait@@GLIBC_2.3.2): Likewise. (pthread_cond_timedwait@GLIBC_2.0): Likewise. (pthread_cond_timedwait@GLIBC_2.2.5): Likewise. (pthread_cond_timedwait@GLIBC_2.2): Likewise. (sem_wait@@GLIBC_2.1): Likewise. (sem_wait@GLIBC_2.0): Likewise. * src/collector_module.h (SYMVER_ATTRIBUTE): New.
* gprofng: Don't hardcode -Wno-nonnull-compareH.J. Lu2022-03-165-4/+69
| | | | | | | | | | | | | Use -Wno-nonnull-compare only if it is supported. PR gprof/28969 * libcollector/Makefile.am (AM_CFLAGS): Replace -Wno-nonnull-compare with GPROFNG_NO_NONNULL_COMPARE_CFLAGS. * libcollector/configure.ac (GPROFNG_NO_NONNULL_COMPARE_CFLAGS): New AC_SUBST for -Wno-nonnull-compare. * libcollector/Makefile.in: Regenerate. * libcollector/aclocal.m4: Likewise. * libcollector/configure: Likewise.
* gprofng: Add a configure test for clock_gettime and a use of the test in ↵Nick Clifton2022-03-155-11/+84
| | | | getthrtime.c
* gprofng: a new GNU profilerVladimir Mezentsev2022-03-1138-0/+46214
top-level * Makefile.def: Add gprofng module. * configure.ac: Add --enable-gprofng option. * src-release.sh: Add gprofng. * Makefile.in: Regenerate. * configure: Regenerate. * gprofng: New directory. binutils * MAINTAINERS: Add gprofng maintainer. * README-how-to-make-a-release: Add gprofng. include. * collectorAPI.h: New file. * libcollector.h: New file. * libfcollector.h: New file.