diff options
author | Vladimir Mezentsev <vladimir.mezentsev@oracle.com> | 2023-03-16 17:19:23 -0700 |
---|---|---|
committer | Vladimir Mezentsev <vladimir.mezentsev@oracle.com> | 2023-03-19 18:03:58 -0700 |
commit | de8e70596896cc9f85498a9981196ebc4465172e (patch) | |
tree | 2bac4cf6bb0fd153bc943a18fc0f4deef1e921a2 /gprofng/libcollector/mmaptrace.c | |
parent | 2f5dea45584c09f23702f887b1ecbe16cf16ba05 (diff) | |
download | gdb-de8e70596896cc9f85498a9981196ebc4465172e.zip gdb-de8e70596896cc9f85498a9981196ebc4465172e.tar.gz gdb-de8e70596896cc9f85498a9981196ebc4465172e.tar.bz2 |
gprofng: Use prototype to call libc functions
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.
Diffstat (limited to 'gprofng/libcollector/mmaptrace.c')
-rw-r--r-- | gprofng/libcollector/mmaptrace.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/gprofng/libcollector/mmaptrace.c b/gprofng/libcollector/mmaptrace.c index 221b4e2..c46dac4 100644 --- a/gprofng/libcollector/mmaptrace.c +++ b/gprofng/libcollector/mmaptrace.c @@ -61,13 +61,6 @@ typedef struct prmap_t int pr_pagesize; /* pagesize (bytes) for this mapping */ } prmap_t; -/* TprintfT(<level>,...) definitions. Adjust per module as needed */ -#define DBG_LT0 0 // for high-level configuration, unexpected errors/warnings -#define DBG_LT1 1 // for configuration details, warnings -#define DBG_LT2 2 -#define DBG_LT3 3 -#define DBG_LT4 4 - #define SYS_MMAP_NAME "mmap" #define SYS_MMAP64_NAME "mmap64" #define SYS_MUNMAP_NAME "munmap" @@ -113,9 +106,6 @@ static int reentrance = 0; #define PUSH_REENTRANCE reentrance++ #define POP_REENTRANCE reentrance-- -#define CALL_REAL(x) (__real_##x) -#define NULL_PTR(x) (__real_##x == NULL) - /* interposition function handles */ static void *(*__real_mmap)(void* start, size_t length, int prot, int flags, int fd, off_t offset) = NULL; |