Is there a way to trace what code block in a bitcode file is run?

Hi Peng,

Do you require basic block coverage? As far as I know, there is no such trace provided in LLVM.

If you just want simple basic block trace (without overhead), you could try instrument all basic blocks and print information you want.

If you have higher expectations and care about performance overhead, it’s better to check academic paper for existing solutions.

BTW, Clang 9 has a new feature (with coverage):


------------------ Original ------------------