[PATCH] D43495: [XRay][compiler-rt] Add APIs for processing logs in memory

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 16:45:30 PST 2018


dberris created this revision.
dberris added reviewers: eizan, kpw, pelikan.

This change adds APIs to allow logging implementations to provide a
function for iterating through in-memory buffers (if they hold in-memory
buffers) and a way for users to generically deal with these buffers
in-process. These APIs are:

- __xray_log_set_buffer_iterator(...) and __xray_log_remove_buffer_iterator(): installs and removes an iterator function that takes an XRayBuffer and yields the next one.
- __xray_log_process_buffers(...): takes a function pointer that can take a mode identifier (string) and an XRayBuffer to process this data as they see fit.

The intent is to have the FDR mode implementation's buffers be
available through this `__xray_log_process_buffers(...)` API, so that
they can be streamed from memory instead of flushed to disk (useful for
getting the data to a network, or doing in-process analysis).

Basic mode logging will not support this mechanism as it's designed to
write the data mostly to disk.

Future implementations will may depend on this API as well, to allow for
programmatically working through the XRay buffers exposed to the
users in some fashion.


https://reviews.llvm.org/D43495

Files:
  compiler-rt/include/xray/xray_log_interface.h
  compiler-rt/lib/xray/xray_log_interface.cc
  compiler-rt/test/xray/TestCases/Linux/logging-modes.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43495.134992.patch
Type: text/x-patch
Size: 10612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180220/77e922eb/attachment.bin>


More information about the llvm-commits mailing list