-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan McMahill wrote:
> is there an easy way to get some sort of log which clearly shows what
> commands (but not their outputs) are running at the same time during
> each part of a parallel make job?

It's hard (there are commercial tools like Electric Cloud that can get
deep into exactly what's happening when), but one simple thing to do in
GNU Make is to get start timing information for commands.  Here's how to
do it:

AT = @date +"$@: %s" ;

all: foo bar

foo:
        $(AT)sleep 5

bar:
        $(AT)sleep 10

I've replaced the standard @ prefix on commands with $(AT).  This gets
expanded and includes a call to GNU date to output the name of the
target being build followed by the epoch time.  Here's the output for
serial and parallel make:

$ make
foo: 1199694571
bar: 1199694576

$ make -j2
foo: 1199694592
bar: 1199694592

Hope that helps.  If you need subsecond timing then you'd need to wrap
gettimeofday(2) in a small C program and use it to output timing
information.   If you need end times then you could suffix each command
with something like:

END = ; date +"$@: %s"

John.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHgeNJLphrp73n/hARAsVEAJwM0lwZlJFDtRuWiIXTIne+SehosQCfRJzb
olPVCW+OyudLMnD7SI4gPho=
=qCW+
-----END PGP SIGNATURE-----


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to