[Scons-users] time profile

Jay Damask jaydamask at gmail.com
Sat Jun 8 14:29:22 EDT 2013


Philipp Kraus <philipp.kraus <at> flashpixx.de> writes:


>

> Hello,

>

> can I get some "profile information" of the building steps? I have got a

project with different build

> targets (resources, dlls, ...) and I would like to get the compile &

linking time of each source.

> My idea is to implementate a pseudo builder, that starts the time before

the builder is called and stop it

> after that and stores the difference in a global data structure. I would

like to

> push the profiling information at the end into a database.

>

> Do you have an idea to create this profiling information?

>

> Thanks

>

> Phil

> _______________________________________________

> Scons-users mailing list

> Scons-users <at> scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>


Phil,

Yours is an interesting question. Dirk or Bill I'm sure will give the
authoritative answer, but here's what I would do.

Define a trivial builder, perhaps called TimeStamp, and set the $COM string
to something like date +%c (linux).

Then, using Depend(), make all your builds depend on a first TimeStamp call.
That's easy. On the tail end, it seems to me that you actually need to build
a time-stamped build of your target... so I would use Alias to give a
command-line target like ts-lib, ts-release (whatever). The TimeStamp is
what is built, which Depends() on your underlying build (lib, release, etc).

Add a token to the $COM string, like COM = "echo 'ts-token:' %% date +%c",
so you can then grep stdout to extract your profile.

A reason I've thought of this design is, in part, b/c you'll want the right
answer w/ a parallel build as well.

I just reread your question -- you can save your timestamps in a python
variable.

I haven't tried this myself...

Regards,
-Jay






More information about the Scons-users mailing list