Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --hot-func-list to llvm-profdata show for sample profiles
Summary: Add the --hot-func-list feature to llvm-profdata show for sample profiles. This feature prints a list of hot functions whose max sample count are above the 99% threshold, with their numbers of total samples, total samples percentage, max samples, entry samples, and their function names. Reviewers: wmi, hoyFB, wenlei Reviewed By: wmi Subscribers: hoyFB, wenlei, llvm-commits, weihe Tags: #llvm Differential Revision: https://reviews.llvm.org/D81800
- Loading branch information
Showing
4 changed files
with
209 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
llvm/test/tools/llvm-profdata/Inputs/sample-hot-func-list.proftext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
_Z3bari:20301:1437 | ||
1: 1437 | ||
_Z3fooi:7711:610 | ||
1: 610 | ||
main:184019:0 | ||
4: 534 | ||
4.2: 534 | ||
5: 1075 | ||
5.1: 1075 | ||
6: 2080 | ||
7: 534 | ||
9: 2300 _Z3bari:1471 _Z3fooi:631 | ||
10: inline1:1000 | ||
1: 1000 | ||
10: inline2:2000 | ||
1: 2000 | ||
_Z3bazi:20305:1000 | ||
1: 1000 | ||
Func1:1523:169 | ||
1: 169 | ||
7: 563 | ||
Func2:17043:1594 | ||
1: 1594 | ||
3: 1594 | ||
6: 2009 Func1:150 Func3:1789 | ||
13: 3105 | ||
17: 3105 | ||
19: 1594 | ||
Func3:97401:3035 | ||
1: 3035 | ||
5: 7344 | ||
9: 10640 | ||
11: 10640 | ||
15: 3035 | ||
Func4:465:210 | ||
1: 210 | ||
Func5:6948:470 | ||
1: 470 | ||
3: 3507 | ||
Func6:310:102 | ||
1: 102 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; 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). | ||
; CHECK-NEXT: 355251 out of 356026 profile counts (99.78%) are from hot functions. | ||
; CHECK-NEXT: Total sample (%) Max sample Entry sample Function name | ||
; CHECK-NEXT: 184019 (51.69%) 2300 534 main | ||
; CHECK-NEXT: 97401 (27.36%) 10640 3035 Func3 | ||
; CHECK-NEXT: 20305 (5.70%) 1000 1000 _Z3bazi | ||
; CHECK-NEXT: 20301 (5.70%) 1437 1437 _Z3bari | ||
; CHECK-NEXT: 17043 (4.79%) 3105 1594 Func2 | ||
; CHECK-NEXT: 7711 (2.17%) 610 610 _Z3fooi | ||
; CHECK-NEXT: 6948 (1.95%) 3507 470 Func5 | ||
; CHECK-NEXT: 1523 (0.43%) 563 169 Func1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters