Date: Thu, 11 Dec 2025 10:13:27 -0800 From: Steve Kargl <kargls@comcast.net> To: freebsd-hackers@freebsd.org Subject: profiling a user executable? Message-ID: <f32da5eb-1c80-48a2-a990-c762a8258495@comcast.net>
index | next in thread | raw e-mail
In the days of yore, one could add the '-pg' option to the compilers options to generate profiling information, which could be consumed by gprof(1). FreeBSD stopped shipping libc_p.a, libm_p.m, etc (disabled in fe52b7f60ef4 and deleted in 3750ccefb8). This breaks all lang/gcc* ports if one uses '-pg'. It is not too difficult to fix lang/gcc* to avoid the missing *_p.a files, but this seems to lead to invalid *.gmon files. At least, for a Fortran application that I would like to profile (compiled with gfortran), procedures in my libfoo_p.a, appear in the profile, which I know with 100% certainty are not referenced. So, how does one in modern FreeBSD, as mere normal user, profile an executable? A google search suggests pmcstat(8) may be of use, but all attempts to use it lead to a usage message printed to the terminal. I'm simply trying to determine where my code is spending all of its time. -- stevehelp
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f32da5eb-1c80-48a2-a990-c762a8258495>
