caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: rixed@happyleptic.org
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] ::how to locate the function in profile generated by gprof
Date: Fri, 1 Feb 2013 13:11:52 +0100	[thread overview]
Message-ID: <20130201121152.GA1262@securactive.lan> (raw)
In-Reply-To: <104129e3.ee2.13c953b6025.Coremail.syshen@nudt.edu.cn>

-[ Fri, Feb 01, 2013 at 06:09:21PM +0800, ?????? ]----
> For example, I have a module Misc, so there are function name like camlMisc__fun_1201.
> So how can I locate the this function in source code?

What I'd do is recompile the Misc module with -S to have the assembly temporary
file and look in there camlMisc__fun_1201.  First I'd note if this anonymous
function does raise some exception or allocate some memory (it's easy to tell
from the asm version), then I'd follow up the caller chain up to the first
named function.  Then back to the definition of this named function in misc.ml,
I'd look for all anonymous functions available from there that have the same
caracteristics reguarding exceptions and allocation.

In case there are many anonymous functions in there or because of inlining this
may be hard but in general it's quite easy to find out the culprit from there.


  reply	other threads:[~2013-02-01 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 10:09 沈胜宇
2013-02-01 12:11 ` rixed [this message]
2013-02-01 12:30   ` Török Edwin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130201121152.GA1262@securactive.lan \
    --to=rixed@happyleptic.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).