I'm trying to instrument clang with perf to mesure how much a certain llvm pass runs for (since -ftime-report seems to give inconsistent metrics and can't be used on multi file compilations). I have compiled clang in debug mode so it has debug symbols. To find the symbol I need I run:
perf probe -x ./llvm-project/build/bin/clang -F | grep InstCombinerImpl::run
Which outputs:
llvm::InstCombinerImpl::run()
llvm::InstCombinerImpl::run()::{lambda(llvm::Instruction*)#1}::operator()(llvm::Instruction*) const
The first function is the one I'm interested in and you can see that it is visible to perf. Next, I try to probe it with:
perf probe -x ./llvm-project/build/bin/clang "llvm\:\:InstCombinerImpl\:\:run"
But get the error:
Probe point 'llvm::InstCombinerImpl::run' not found.
Error: Failed to add events.
I've tried looking online for people experiencing the same problem but didn't find much. I also tried to look at the man pages but can't figure out what I'm doing wrong. Any help is appreciated! Event if you have a different idea on how to reliably measure the execution time of a llvm pass.