[cfe-dev] Unexpected behavior of -finstrument-functions

Jan-Patrick Lehr my.new.social.email at gmail.com
Fri Jul 3 01:13:13 PDT 2015


Hi all,
I was experimenting with Clang and state of the art performance
profiling and tracing tools such as ScoreP [1]. It basically uses
compiler instrumentation to generate call-path profiles / traces.

When used with GCC everything works as expected.

Unfortunately, when used with Clang one runs into problems if the code
under investigation uses exceptions. One example would be the
483.Xalancbmk benchmark of the SPEC CPU 2006 suite [2].

The problem is that Clang does function instrumentation in a way that
the function body itself seems to not getting wrapped in a try/catch.
Thus, if a callee throws, the instrumentation code does not generate
"balanced" enter/exit trees.

I already had a look into the Clang sources, but I was unsure how to fix
this. I will have a look at it and see whether I can supply a patch.
However, ideas and hints how to do that are well appreciated.

Besides this email should I file a bug report somewhere?

Thanks,
JP

[1] http://www.vi-hps.org/projects/score-p/
[2] https://www.spec.org/cpu2006/Docs/483.xalancbmk.html



More information about the cfe-dev mailing list