[PATCH] D87120: [HeapProf] Heap profiling runtime support

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 17:37:32 PDT 2020


tejohnson added inline comments.


================
Comment at: compiler-rt/lib/heapprof/heapprof_rtl.cpp:307
+// TODO: Should we do something else so we can better track utilization?
+void __heapprof_record_access_range(void const volatile *addr,
+                                    UNUSED uptr size) {
----------------
Originally this incremented the access count for every 64 byte block included in "size", but then I convinced myself that this would overcount the accesses for an allocation (since all the shadow access counts corresponding to an allocation get accumulated in the end). Since this function is invoked by the interceptors for mem* intrinsics, this means that e.g. a memset of a huge array currently gets a single access count increment for the whole array. I'm now second guessing this and thinking we should mark this as N accesses (where N is the number of 64 byte blocks included in the size of the memset, since we map each 64 bytes to a single 8 byte shadow counter). What makes the most sense here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87120/new/

https://reviews.llvm.org/D87120



More information about the llvm-commits mailing list