Skip to content

Commit

Permalink
[XRAY] [compiler-rt] [NFC] Fixing the bit twiddling of Function Id in…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
deanberris committed Feb 9, 2017
1 parent 3cac763 commit 860247b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/xray/xray_fdr_logging.cc
Expand Up @@ -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:
Expand Down

0 comments on commit 860247b

Please sign in to comment.