[PATCH] D29698: [XRAY] [compiler-rt] [NFC] Fixing the bit twiddling of Function Id in FDR logging mode.

Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 17:47:40 PST 2017


kpw created this revision.

Fixing a bug I found when testing a reader for the FDR format. Function ID is
now correctly packed into the 28 bits which are documented for it instead of being
masked to all ones.


https://reviews.llvm.org/D29698

Files:
  lib/xray/xray_fdr_logging.cc


Index: lib/xray/xray_fdr_logging.cc
===================================================================
--- lib/xray/xray_fdr_logging.cc
+++ lib/xray/xray_fdr_logging.cc
@@ -459,7 +459,7 @@
   FuncRecord.Type = RecordType::Function;
 
   // Only get the lower 28 bits of the function id.
-  FuncRecord.FuncId = FuncId | ~(0x03 << 28);
+  FuncRecord.FuncId = FuncId & ~(0x0F << 28);
 
   // Here we compute the TSC Delta. There are a few interesting situations we
   // need to account for:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29698.87573.patch
Type: text/x-patch
Size: 490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170208/0c77e65b/attachment.bin>


More information about the llvm-commits mailing list