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

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 23:05:42 PST 2017


Author: dberris
Date: Thu Feb  9 01:05:42 2017
New Revision: 294563

URL: http://llvm.org/viewvc/llvm-project?rev=294563&view=rev
Log:
[XRAY] [compiler-rt] [NFC] Fixing the bit twiddling of Function Id in FDR logging mode.

Summary:
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.

Reviewers: dberris, pelikan, eugenis

Reviewed By: dberris

Subscribers: llvm-commits

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

Modified:
    compiler-rt/trunk/lib/xray/xray_fdr_logging.cc

Modified: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_fdr_logging.cc?rev=294563&r1=294562&r2=294563&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc Thu Feb  9 01:05:42 2017
@@ -459,7 +459,7 @@ void fdrLoggingHandleArg0(int32_t FuncId
   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:




More information about the llvm-commits mailing list