|
From: Sitos L. <sit...@gm...> - 2009-06-01 08:59:05
|
Dear all: The valgrind tool can instrument the program at the beginning of execution by the command: valgrind .... However, how can I instrument the running program? Because I want to skip the initialization phase of the program and only profile the main function of the program by valgrind tool. I know Pin can instrument the running program with a specific pid. Can valgrind do this? Thank you. Best regards, sitos |
|
From: Konstantin S. <kon...@gm...> - 2009-06-01 09:19:05
|
On Mon, Jun 1, 2009 at 12:59 PM, Sitos Lin <sit...@gm...> wrote: > Dear all: > The valgrind tool can instrument the program at the beginning of > execution by the command: valgrind .... However, how can I instrument > the running program? > Because I want to skip the initialization phase > of the program and only profile the main function of the program by > valgrind tool. I know Pin can instrument the running program with a > specific pid. Can valgrind do this? No. :( --kcc > Thank you. > Best regards, > sitos > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp as they present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > > |
|
From: Josef W. <Jos...@gm...> - 2009-06-01 18:45:24
|
On Monday 01 June 2009, Sitos Lin wrote: > Dear all: > The valgrind tool can instrument the program at the beginning of > execution by the command: valgrind .... However, how can I instrument > the running program? Because I want to skip the initialization phase > of the program and only profile the main function of the program by > valgrind tool. I know Pin can instrument the running program with a > specific pid. Can valgrind do this? Thank you. Valgrind can not attach to a running program. However, the Callgrind tool allows to start a program doing no instrumentation at all, leading to a slowdown factor of "only" around 2-3, and you can switch to full instrumentation later on. No idea if that is enough for you or not. Josef > Best regards, > sitos > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp as they present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Nicholas N. <n.n...@gm...> - 2009-06-01 23:01:24
|
On Mon, Jun 1, 2009 at 6:59 PM, Sitos Lin <sit...@gm...> wrote:
> Dear all:
> The valgrind tool can instrument the program at the beginning of
> execution by the command: valgrind .... However, how can I instrument
> the running program? Because I want to skip the initialization phase
> of the program and only profile the main function of the program by
> valgrind tool. I know Pin can instrument the running program with a
> specific pid. Can valgrind do this? Thank you.
There's an entry in the FAQ about this, but it's still only on the SVN
trunk and not in any releases. I've just added it to the 3.4.X branch
so it will be in 3.4.2 if/when that is released.
<qandaentry id="faq.attach">
<question id="q-attach">
<para>Is it possible to attach Valgrind to a program that is already
running?</para>
</question>
<answer id="a-attach">
<para>No. The environment that Valgrind provides for running programs
is significantly different to that for normal programs, e.g. due to
different layout of memory. Therefore Valgrind has to have full control
from the very start.</para>
<para>It is possible to achieve something like this by running your
program without any instrumentation (which involves a slow-down of about
5x, less than that of most tools), and then adding instrumentation once
you get to a point of interest. Support for this must be provided by
the tool, however, and Callgrind is the only tool that currently has
such support. See the instructions on the
<computeroutput>callgrind_control</computeroutput> program for details.
</para>
</answer>
</qandaentry>
Nick
|