summaryrefslogtreecommitdiff
path: root/lib/esan
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2016-06-10 02:10:34 +0000
committerQin Zhao <zhaoqin@google.com>2016-06-10 02:10:34 +0000
commite00c72b6b97e99f07f0f6b79f83a4e446592577d (patch)
treec92e4e74f31f9cb10a62f30effa66acc93f7b738 /lib/esan
parent180059d601ada3d56fbcb26287b0d792791fe22f (diff)
[esan|cfrag] Add the struct field offset array in StructInfo
Summary: Adds the struct field offset array in the struct StructInfo. Prints struct size and field offset info in the report. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan')
-rw-r--r--lib/esan/cache_frag.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/esan/cache_frag.cpp b/lib/esan/cache_frag.cpp
index 39dfcb1a0..a68598f1f 100644
--- a/lib/esan/cache_frag.cpp
+++ b/lib/esan/cache_frag.cpp
@@ -26,7 +26,9 @@ namespace __esan {
// This should be kept consistent with LLVM's EfficiencySanitizer StructInfo.
struct StructInfo {
const char *StructName;
+ u32 Size;
u32 NumFields;
+ u32 *FieldOffsets;
u64 *FieldCounters;
const char **FieldTypeNames;
};
@@ -89,9 +91,11 @@ static void reportStructCounter(StructHashMap::Handle &Handle) {
end = strchr(start, '#');
CHECK(end != nullptr);
Report(" %s %.*s\n", type, end - start, start);
- Report(" count = %llu, ratio = %llu\n", Handle->Count, Handle->Ratio);
+ Report(" size = %u, count = %llu, ratio = %llu\n",
+ Struct->Size, Handle->Count, Handle->Ratio);
for (u32 i = 0; i < Struct->NumFields; ++i) {
- Report(" #%2u: count = %llu,\t type = %s\n", i, Struct->FieldCounters[i],
+ Report(" #%2u: offset = %u,\t count = %llu,\t type = %s\n", i,
+ Struct->FieldOffsets[i], Struct->FieldCounters[i],
Struct->FieldTypeNames[i]);
}
}