[PATCH] D157632: [Profile] Allow online merging with debug info correlation.
Zequan Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 11 09:28:04 PDT 2023
zequanwu added a comment.
BTW, I noticed something strange with `-pgo-function-entry-coverage` when merging via llvm-profdata.
In this file `compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c`, I ran the following:
// RUN: %clang_pgogen -o %t.cov.normal -mllvm --pgo-function-entry-coverage -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
// RUN: rm -rf %t.dir && mkdir %t.dir
// RUN: env LLVM_PROFILE_FILE=%t.dir/%m.profraw %run %t.cov.normal
// RUN: env LLVM_PROFILE_FILE=%t.dir/%m.profraw %run %t.cov.normal
// RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.dir/
// RUN: llvm-profdata show --all-functions --counts %t.cov.normal.profdata
// It shows block counts 1.
Counters:
main:
Hash: 0x06d15c67b2c35b9c
Counters: 1
Block counts: [1]
_Z3fooi:
Hash: 0x0209aa3e3852da94
Counters: 1
Block counts: [1]
_Z3bari:
Hash: 0x0209aa3e1d398548
Counters: 1
Block counts: [1]
_Z6unusedi:
Hash: 0x0a4d0ad3efffffff
Counters: 1
Block counts: [0]
Instrumentation level: IR entry_first = 0
Functions shown: 4
Total functions: 4
Maximum function count: 1
Maximum internal block count: 0
// RUN: rm -rf %t.dir && mkdir %t.dir
// RUN: env LLVM_PROFILE_FILE=%t.dir/%t.cov-1.profraw %run %t.cov.normal
// RUN: env LLVM_PROFILE_FILE=%t.dir/%t.cov-2.profraw %run %t.cov.normal
// RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.dir/
// RUN: llvm-profdata show --all-functions --counts %t.cov.normal.profdata
// It shows block counts 2, as opposed to 1.
Counters:
main:
Hash: 0x06d15c67b2c35b9c
Counters: 1
Block counts: [2]
_Z3fooi:
Hash: 0x0209aa3e3852da94
Counters: 1
Block counts: [2]
_Z3bari:
Hash: 0x0209aa3e1d398548
Counters: 1
Block counts: [2]
_Z6unusedi:
Hash: 0x0a4d0ad3efffffff
Counters: 1
Block counts: [0]
Instrumentation level: IR entry_first = 0
Functions shown: 4
Total functions: 4
Maximum function count: 2
Maximum internal block count: 0
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157632/new/
https://reviews.llvm.org/D157632
More information about the cfe-commits
mailing list