[compiler-rt] 4e6c778 - [XRay] Record the XRay data size as a property of the VMO

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 19:01:28 PDT 2020


Author: Petr Hosek
Date: 2020-03-19T19:01:05-07:00
New Revision: 4e6c778eca42aca1082511aa35cf2b81031ed21d

URL: https://github.com/llvm/llvm-project/commit/4e6c778eca42aca1082511aa35cf2b81031ed21d
DIFF: https://github.com/llvm/llvm-project/commit/4e6c778eca42aca1082511aa35cf2b81031ed21d.diff

LOG: [XRay] Record the XRay data size as a property of the VMO

While the VMO size is always page aligned, we can record the content
size as a property and then use this metadata when writing the data to
a file.

Differential Revision: https://reviews.llvm.org/D76462

Added: 
    

Modified: 
    compiler-rt/lib/xray/xray_utils.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/xray/xray_utils.cpp b/compiler-rt/lib/xray/xray_utils.cpp
index 1036d17a7725..4c8ad5b92be7 100644
--- a/compiler-rt/lib/xray/xray_utils.cpp
+++ b/compiler-rt/lib/xray/xray_utils.cpp
@@ -69,6 +69,10 @@ void LogWriter::WriteAll(const char *Begin, const char *End) XRAY_NEVER_INSTRUME
     return;
   }
   Offset += TotalBytes;
+
+  // Record the data size as a property of the VMO.
+  _zx_object_set_property(Vmo, ZX_PROP_VMO_CONTENT_SIZE,
+                          &Offset, sizeof(Offset));
 }
 
 void LogWriter::Flush() XRAY_NEVER_INSTRUMENT {


        


More information about the llvm-commits mailing list