[PATCH] D52361: [XRay][compiler-rt] Update use of internal_mmap

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 08:21:59 PDT 2018


dberris created this revision.
dberris added reviewers: cryptoad, mboerger.

The implementation of `internal_mmap(...)` deviates from the contract of
`mmap(...)` -- i.e. error returns are actually the equivalent of `errno`
results. We update how XRay uses `internal_mmap(...)` to better handle
these error conditions.

In the process, we change the default pointers we're using from `char*`
to `uint8_t*` to prevent potential usage of the pointers in the string
library functions that expect to operate on `char*`.

We also take the chance to "promote" sizes of individual `internal_mmap`
requests to at least page size bytes, consistent with the expectations
of calls to `mmap`.


https://reviews.llvm.org/D52361

Files:
  compiler-rt/lib/xray/xray_allocator.h
  compiler-rt/lib/xray/xray_buffer_queue.h
  compiler-rt/lib/xray/xray_fdr_logging.cc
  compiler-rt/lib/xray/xray_profile_collector.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52361.166485.patch
Type: text/x-patch
Size: 6412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180921/f81694c5/attachment.bin>


More information about the llvm-commits mailing list