Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2011 19:54:49 +0100
From:      Roman Divacky <rdivacky@freebsd.org>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: How to build an executable with profiling?
Message-ID:  <20110120185449.GA92860@freebsd.org>
In-Reply-To: <20110118160252.GA6506@troutmask.apl.washington.edu>
References:  <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--MGYHOYXEY6WxJCY8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


ok, I sat down and implemented what Hans Ottevanger told me to do :)

        http://lev.vlakno.cz/~rdivacky/clang-gprof.patch

This patch does three things:

1) emits "call .mcount" at the begining of every function body

2) changes the driver to link in gcrt1.o instead of crt1.o

3) changes all -lfoo to -lfoo_p except when the foo ends with _s in
   the linker invocation

I am not sure that I did the right thing, especially in (3). Anyway,
the patch works for me (ie. produces a.out.gmon that seems to contain
meaningful data).

I would appreciate if you guys could test and review this. Letting me
know if this is correct.

Thank you!

roman

p.s. the patch is against TRUNK clang but there should not be any/much trouble
applying it to contrib/llvm/tools/clang I hope

--MGYHOYXEY6WxJCY8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAk04hPkACgkQLVEj6D3CBExztACeIvoImxMie+vyGF5yTn2W7Szz
NF8AnRGWWICgAKOr1QPmHNIzxo6YzeA/
=RYR8
-----END PGP SIGNATURE-----

--MGYHOYXEY6WxJCY8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110120185449.GA92860>