Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2011 16:06:12 +0100
From:      Roman Divacky <rdivacky@freebsd.org>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org, Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject:   Re: How to build an executable with profiling?
Message-ID:  <20110121150612.GA61861@freebsd.org>
In-Reply-To: <4D3885A3.80407@freebsd.org>
References:  <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> <4D3885A3.80407@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 20, 2011 at 12:57:39PM -0600, Nathan Whitehorn wrote:
> On 01/20/11 12:54, Roman Divacky wrote:
> >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
> 
> It's not always called .mcount. See /sys/$ARCH/include/profile.h
> -Nathan

fwiw - I updated the patch to use different names on different archs,
can you guys review?

        case llvm::Triple::x86:
        case llvm::Triple::x86_64:
          return ".mcount";
        case llvm::Triple::mips:
        case llvm::Triple::mipsel:
        case llvm::Triple::ppc:
        case llvm::Triple::ppc64:
          return "_mcount";
        case llvm::Triple::arm:
          return "__mcount";



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