Re: -mprofile-kernel vs. notrace in ppc64(le) Linux kernels
From: Stewart Smith <hidden>
Date: 2015-09-28 00:08:50
From: Stewart Smith <hidden>
Date: 2015-09-28 00:08:50
Torsten Duwe [off-list ref] writes:
As I mentioned earlier this year, it's a bad idea to call _mcount from MMU helper functions (e.g. hash_page...), when the profiling/tracing/ live-patching/whatever framewok might in turn cause another such fault. Jikos suggested to use fine-grained control of these functions with the "notrace" keyword in the Linux kernel. It is mapped to GCC's (4.8, FWIW) __attribute__((no_instrument_function)), which, to my surprise, works for -p and -pg nicely, but does not affect -mprofile-kernel at all!
IIRC from when I was working on GCOV support in OPAL firmware (skiboot), this doesn't affect the code generated by -fprofile-arcs, so may not completely do what you want.