Maik Scholz <[EMAIL PROTECTED]> wrote:
> This is a multi-part message in MIME format.
> --------------1F07FB5F88037AD88E921C93
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Hi,
> i need profiling on our embedded system.
> For the the mcount function is necessary.
> Is there a possibility to implement this
> function on the embedded system, with writes
> all data (stack, pc, ...) trought a high speed interface
> to a desktop.
I doubt that to be a good plan. mcount's raw output is *huge*, if you
capture all of it. For a rough comparison, try to imagine 2 million
calls to a 20-byte subroutine. If every call to mcount is transported
over the link, that'll be 2 million times 8 bytes, or 16 Megabytes.
The actual data collected will be no more than 40 bytes, all in all
(20 bytes of timing histogram, plus execution counts in all arcs
leading to this routine). Even for a rather fast connection, your
program would probably be spending most of its time in mcount(), then.
It'll probably be better to leave mcount untouched (i.e. let it put
together the profiling data in memory), and instead change the
atexit() function it registers which writes out the gmon.out file,
later. That'll be a whole lot faster. It only works if you have the
memory for the profiling data to spare, on that embedded system, of
course.
> Where is the linux mcount implementation?
Where it always is, with GNU compilers: in libgcc.a. Mcount is part of
the gcc sources, as the implementation of mcount calls is extremely
platform and compiler-specific, i.e. only gcc usually knows how to do
that, for gcc-compiled programs.
BTW: I really wonder why you posted this to the *gdb* forum...
--
Hans-Bernhard Broeker ([EMAIL PROTECTED])
Even if all the snow were burnt, ashes would remain.