diff options
author | Qin Zhao <zhaoqin@google.com> | 2016-07-02 03:25:55 +0000 |
---|---|---|
committer | Qin Zhao <zhaoqin@google.com> | 2016-07-02 03:25:55 +0000 |
commit | 0ef859b2aaaaf976fb32d0e6c6a28cfecb57a1e7 (patch) | |
tree | 7e3ba8c611b392834ddaf7c68ef7e1fad96c75e8 /lib/esan | |
parent | 5e3cd2850efde6299133aa126ccda5de0e055c02 (diff) |
[esan|cfrag] Add struct array access report
Summary:
Adds struct array access counter report.
Updates test struct-simple.cpp.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D21595
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan')
-rw-r--r-- | lib/esan/cache_frag.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/esan/cache_frag.cpp b/lib/esan/cache_frag.cpp index 2096bec75..e3384a982 100644 --- a/lib/esan/cache_frag.cpp +++ b/lib/esan/cache_frag.cpp @@ -30,8 +30,9 @@ struct StructInfo { u32 NumFields; u32 *FieldOffsets; u32 *FieldSize; - u64 *FieldCounters; const char **FieldTypeNames; + u64 *FieldCounters; + u64 *ArrayCounter; }; // This should be kept consistent with LLVM's EfficiencySanitizer CacheFragInfo. @@ -96,8 +97,8 @@ static void reportStructCounter(StructHashMap::Handle &Handle) { end = strchr(start, '#'); CHECK(end != nullptr); Report(" %s %.*s\n", type, end - start, start); - Report(" size = %u, count = %llu, ratio = %llu\n", Struct->Size, - Handle->Count, Handle->Ratio); + Report(" size = %u, count = %llu, ratio = %llu, array access = %llu\n", + Struct->Size, Handle->Count, Handle->Ratio, *Struct->ArrayCounter); for (u32 i = 0; i < Struct->NumFields; ++i) { Report(" #%2u: offset = %u,\t size = %u,\t count = %llu,\t type = %.*s\n", i, Struct->FieldOffsets[i], Struct->FieldSize[i], |