From: Sean.McKnight on

I have used the "--enable-symbols" configure switch in the past to
compile and debug Tcl/Tk extensions with
"gdb".

I would also like to use "gprof" at some point. I have dug around on
the newsgroup and Wiki but have
not found a specific example of how to get this to work with an
extension (I saw an example with just
the "tclsh" interpreter itself but not an extension).

Just wondering if someone has done this before and can provide an
example.

Thanks for any help,
Sean





From: Alexandre Ferrieux on
On Jan 14, 6:13 pm, "Sean.McKnight" <mcknigh...(a)gmail.com> wrote:
> I have used the "--enable-symbols" configure switch in the past to
> compile and debug Tcl/Tk extensions with
> "gdb".
>
> I would also like to use "gprof" at some point.  I have dug around on
> the newsgroup and Wiki but have
> not found a specific example of how to get this to work with an
> extension (I saw an example with just
> the "tclsh" interpreter itself but not an extension).
>
> Just wondering if someone has done this before and can provide an
> example.

Sorry for the obvious, uninformative answer, but since nobody
reacted...

One easy thing is to link your ext statically and call your init func
manually somewhere in the Tcl init sequence (see other
Tcl_CreateObjCommand's). This way you have one single monolithic
executable for gprof to chew on.

-Alex
From: Sean.McKnight on
On Jan 14, 6:15 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
wrote:
> On Jan 14, 6:13 pm, "Sean.McKnight" <mcknigh...(a)gmail.com> wrote:
>
> > I have used the "--enable-symbols" configure switch in the past to
> > compile and debug Tcl/Tk extensions with
> > "gdb".
>
> > I would also like to use "gprof" at some point.  I have dug around on
> > the newsgroup and Wiki but have
> > not found a specific example of how to get this to work with an
> > extension (I saw an example with just
> > the "tclsh" interpreter itself but not an extension).
>
> > Just wondering if someone has done this before and can provide an
> > example.
>
> Sorry for the obvious, uninformative answer, but since nobody
> reacted...
>
> One easy thing is to link your ext statically and call your init func
> manually somewhere in the Tcl init sequence (see other
> Tcl_CreateObjCommand's). This way you have one single monolithic
> executable for gprof to chew on.
>
> -Alex


Thanks for your reply...I suspected that "gprof" and the like would
not
be able to handle the "load"ing of shared libraries during runtime.
from
what little testing i have done it seems like that is the case...

I will try the static link idea...thanks again...

sean
From: Alexandre Ferrieux on
On Jan 19, 8:22 pm, "Sean.McKnight" <mcknigh...(a)gmail.com> wrote:
> On Jan 14, 6:15 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com>
> wrote:
>
>
>
>
>
> > On Jan 14, 6:13 pm, "Sean.McKnight" <mcknigh...(a)gmail.com> wrote:
>
> > > I have used the "--enable-symbols" configure switch in the past to
> > > compile and debug Tcl/Tk extensions with
> > > "gdb".
>
> > > I would also like to use "gprof" at some point.  I have dug around on
> > > the newsgroup and Wiki but have
> > > not found a specific example of how to get this to work with an
> > > extension (I saw an example with just
> > > the "tclsh" interpreter itself but not an extension).
>
> > > Just wondering if someone has done this before and can provide an
> > > example.
>
> > Sorry for the obvious, uninformative answer, but since nobody
> > reacted...
>
> > One easy thing is to link your ext statically and call your init func
> > manually somewhere in the Tcl init sequence (see other
> > Tcl_CreateObjCommand's). This way you have one single monolithic
> > executable for gprof to chew on.
>
> > -Alex
>
> Thanks for your reply...I suspected that "gprof" and the like would
> not
> be able to handle the "load"ing of shared libraries during runtime.
> from
> what little testing i have done it seems like that is the case...
>
> I will try the static link idea...thanks again...
>
> sean

Note that I'm not saying it is impossible, just no firsthand
experience ;-)

-Alex