|generic profiler for C code? email@example.com (ssylee) (2009-01-27)|
|Re: generic profiler for C code? firstname.lastname@example.org (ssylee) (2009-01-27)|
|Re: generic profiler for C code? email@example.com (kamal) (2009-02-08)|
|Date:||Sun, 8 Feb 2009 01:48:46 -0800 (PST)|
|Keywords:||C, performance, tools|
|Posted-Date:||10 Feb 2009 09:36:26 EST|
On Jan 28, 9:39 am, ssylee <staniga...@gmail.com> wrote:
> On Jan 27, 12:43 pm, ssylee <staniga...@gmail.com> wrote:
> > I'm running the C/C++ file to be generated as a mex file, used by m-file
> > in Matlab. However, I'm not sure if there are any generic profiler
> > libraries where I can just insert profiler function calls between the
> > function execution that I want to test out. It would be great for some
> > feedback.
if it is a binary generated by a C/C++ compiler, you can use the
standard gprof utility that uses a profiler library.
It can tell you how many times a function was called in a call graph,
and also provide a histogram as to where the program spent most of its
time executing. The locatiion is in terms of which instructions or C/C+
+ language statements (approximately) the program spent executing. The
histogram is generated based on what the PC value was, when a clock
interrupt occurred in the kernel (once every 10 ms usually).
> > [What are you trying to profile? Time per call? Number of calls?
> > Ranges of arguments? Something else? -John]
> To add to my question, I'm trying to profile function call execution
> times in my mex-generating C++ source code for Matlab (i.e. time per
If the gprof output isn't good enough, you will have to extend the
framework (i.e. add calls in generated code to functions in profiler
Hope that helps.
Return to the
Search the comp.compilers archives again.