On Tue, Oct 26, 2021 at 04:00:41AM +0900, Ryo Shimizu wrote: > > >On Mon, Oct 25, 2021 at 07:54:45AM +0000, Ryo Shimizu wrote: > >> Module Name: src > >> Committed By: ryo > >> Date: Mon Oct 25 07:54:44 UTC 2021 > >> > >> Modified Files: > >> src/share/mk: bsd.README bsd.lib.mk > >> src/sys/conf: Makefile.kern.inc > >> src/sys/lib/libkern: Makefile.libkern > >> > >> Log Message: > >> In some arch, _mcount() would be called recursively when built with > >> COPTS=-O0. > >> > >> Normally, functions called from mcount.c are expected to be expanded > >> inline, > >> so _mcount() will never be called recursively. But when build with > >> COPTS=-O0, > >> `static inline' functions aren't inlined, and _mcount() will be called > >> recursively. > > > >So why not fix that by actually using always_inline (i.e. > >__always_inline)? > > > >Joerg > > Yes, that is correct. That method is also valid and should be done separately. > > However, it is more direct to not add -pg to mcount.c. > Also, I think this commit is valid because it is useful to be able to choose > not to do per-file profiling.
Personally, I would prefer to just kill -pg support completely, but that's a separate discussion. I don't think per-file profiling is that useful and just begging for very confusing results. So I would strongly prefer if this was done properly. Joerg