[PATCH] D81800: Add --hot-func-list to llvm-profdata show for sample profiles

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 21 10:35:57 PDT 2020


wenlei added a comment.

In D81800#2105701 <https://reviews.llvm.org/D81800#2105701>, @riccibruno wrote:

> This is causing an Asan failure (see for example: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/17880).
>  I have reverted it for now. Thanks!


Thanks for the heads up. We'll fix and resubmit later.



================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1054
+static void dumpHotFunctionList(
+    const uint64_t &ColNum, const std::vector<std::string> &ColumnTitle,
+    const std::vector<uint64_t> &ColumnOffset,
----------------
`ColNum` isn't modified in the function, no need to pass by reference.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1141
+                                       "Entry sample", "Function name"};
+  std::vector<uint64_t> ColumnOffset{24, 42, 58};
+  std::string Metric =
----------------
`ColumnOffset` needs 4 slots too, otherwise `dumpHotFunctionList` will access out-of-bound. I think this is what's causing the asan failure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81800





More information about the llvm-commits mailing list