gprofng: 30089 [display text] Invalid number of threads
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 23 Mar 2023 18:46:08 +0000 (11:46 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Mon, 27 Mar 2023 18:47:52 +0000 (11:47 -0700)
commit66f76c545b293f8b89fef0f996a3a48fa59fae61
tree156a39c23f3c0e0dd694ee12e0a921b248ede4d3
parent57573e54afb9f7ed957eec43dfd2830f2384c970
gprofng: 30089 [display text] Invalid number of threads

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.
18 files changed:
gprofng/libcollector/Makefile.am
gprofng/libcollector/Makefile.in
gprofng/libcollector/collector.h
gprofng/libcollector/configure
gprofng/libcollector/configure.ac
gprofng/libcollector/dispatcher.c
gprofng/libcollector/iotrace.c
gprofng/libcollector/libcol_util.c
gprofng/libcollector/libgprofng.ver [new file with mode: 0644]
gprofng/libcollector/linetrace.c
gprofng/libcollector/mapfile.aarch64-Linux [deleted file]
gprofng/libcollector/mapfile.amd64-Linux [deleted file]
gprofng/libcollector/mapfile.intel-Linux [deleted file]
gprofng/libcollector/mapfile.sparc-Linux [deleted file]
gprofng/libcollector/mapfile.sparcv9-Linux [deleted file]
gprofng/libcollector/mmaptrace.c
gprofng/libcollector/synctrace.c
gprofng/src/collector_module.h