How to generate an html coverage report for a profraw file version 9

Hi all,
I have a profraw file version 9 and I’m trying to generate a HTML coverage report.

I have tried the following

➜  /tmp file data.profraw         
data.profraw: LLVM raw profile data, version 9
➜  /tmp llvm-profdata-17 --version
llvm-profdata-17
Ubuntu LLVM version 17.0.6
  Optimized build.
➜  /tmp llvm-profdata-17 merge -o data.profdata data.profraw 
warning: data.profraw: raw profile version mismatch: Profile uses raw profile format version = 9; expected version = 8
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
error: no profile can be merged
➜  /tmp 

I understand that the version of llvm-profdata isn’t correct but I cannot understand which version I should install for solving this problem

Any suggestion?

Thanks

LLVM raw profile version 9 will be supported by LLVM 18 which should be released soon.

What toolchain did you use to compile the instrumented binary? Could you use the same toolchain to to generate the HTML report?

HI @petrhosek ,
thanks for the suggestion. In the end the tool-chain was llvm-18 but it was installed in the wrong directory…

I did what you suggested and the problem is now fixed.

Thanks