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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 14:07:51 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:505
+    uint64_t MaxCount = 0;
+    for (const auto &L : getBodySamples()) {
+      MaxCount = std::max(MaxCount, L.second.getSamples());
----------------
You have used many `auto` in this file. Please write the underlying type unless obvious.

Braces around simple statements can be dropped.


================
Comment at: llvm/test/tools/llvm-profdata/sample-hot-func-list.test:1
+; RUN: llvm-profdata show --sample --hot-func-list %S/Inputs/sample-hot-func-list.proftext | FileCheck %s
+; CHECK: 8 out of 10 functions with profile (80.00%) are considered hot functions (max sample >= 470).
----------------
Should use --match-full-lines --strict-whitespace


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:1072
+    FOS << " (" << HotFuncMetric << ")";
+  FOS << ".\n";
+  FOS << HotProfCount << " out of " << TotalProfCount << " profile counts ("
----------------
Please avoid trailing `dot` in informative diagnostics to be consistent with other tools (in coding standard now)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82355





More information about the llvm-commits mailing list