From 860247b1bb76448d159381d924056308f7f3d0c2 Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Thu, 9 Feb 2017 07:05:42 +0000 Subject: [PATCH] [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 llvm-svn: 294563 --- compiler-rt/lib/xray/xray_fdr_logging.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cc b/compiler-rt/lib/xray/xray_fdr_logging.cc index d08013171091..5f05c791eaa9 100644 --- a/compiler-rt/lib/xray/xray_fdr_logging.cc +++ b/compiler-rt/lib/xray/xray_fdr_logging.cc @@ -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: