summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/esan/cache_frag.cpp
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2016-07-02 03:25:55 +0000
committerQin Zhao <zhaoqin@google.com>2016-07-02 03:25:55 +0000
commit91ea3fb698bc33c2a7e6537d461333fe02000bfa (patch)
treea6cc441aa431076e1135b6e05e99aa8ac212911e /compiler-rt/lib/esan/cache_frag.cpp
parentb463c23c10f8417b0f9df2e10bd922c9b6a2170e (diff)
downloadbcm5719-llvm-91ea3fb698bc33c2a7e6537d461333fe02000bfa.tar.gz
bcm5719-llvm-91ea3fb698bc33c2a7e6537d461333fe02000bfa.zip
[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 llvm-svn: 274421
Diffstat (limited to 'compiler-rt/lib/esan/cache_frag.cpp')
-rw-r--r--compiler-rt/lib/esan/cache_frag.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler-rt/lib/esan/cache_frag.cpp b/compiler-rt/lib/esan/cache_frag.cpp
index 2096bec7569..e3384a982eb 100644
--- a/compiler-rt/lib/esan/cache_frag.cpp
+++ b/compiler-rt/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],
OpenPOWER on IntegriCloud