aboutsummaryrefslogtreecommitdiff
path: root/gprofng/libcollector/collector.c
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-09-14 01:11:45 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-09-14 18:38:09 -0700
commitfe39ffdc202f04397f31557f17170b40bc42b77a (patch)
treec3ca6dc745c7d4a6d13d1403fabf2240844b7ba9 /gprofng/libcollector/collector.c
parent8422cbe455d762f068ed1edefc717f36a105da42 (diff)
downloadgdb-fe39ffdc202f04397f31557f17170b40bc42b77a.zip
gdb-fe39ffdc202f04397f31557f17170b40bc42b77a.tar.gz
gdb-fe39ffdc202f04397f31557f17170b40bc42b77a.tar.bz2
gprofng: fix build issues on musl
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.
Diffstat (limited to 'gprofng/libcollector/collector.c')
-rw-r--r--gprofng/libcollector/collector.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
index ceff2c1..9301530 100644
--- a/gprofng/libcollector/collector.c
+++ b/gprofng/libcollector/collector.c
@@ -2155,7 +2155,7 @@ log_header_write (sp_origin_t origin)
ucontext_t ucp;
ucp.uc_stack.ss_sp = NULL;
ucp.uc_stack.ss_size = 0;
- if (getcontext (&ucp) == 0)
+ if (CALL_UTIL (getcontext) (&ucp) == 0)
{
(void) __collector_log_write ("<process stackbase=\"0x%lx\"></process>\n",
(unsigned long) ucp.uc_stack.ss_sp + ucp.uc_stack.ss_size);
@@ -2413,10 +2413,9 @@ __collector_dlog (int tflag, int level, char *format, ...)
int left = bufsz;
if ((tflag & SP_DUMP_NOHEADER) == 0)
{
- p += CALL_UTIL (snprintf)(p, left, "P%d,L%02u,t%02lu",
- (int) getpid (),
- (unsigned int) __collector_lwp_self (),
- __collector_no_threads ? 0 : __collector_thr_self ());
+ p += CALL_UTIL (snprintf) (p, left, "P%ld,L%02lu,t%02lu",
+ (long) getpid (), (unsigned long) __collector_lwp_self (),
+ (unsigned long) (__collector_no_threads ? 0 : __collector_thr_self ()));
left = bufsz - (p - buf);
if (tflag)
{