[sclug] Performance tuning

Derek M Jones derek at knosof.co.uk
Thu Nov 17 14:01:58 UTC 2005


David,

> I've knocked something up using LD_PRELOAD to overload the standard execve and waitpid functions. It outputs a timestamp, pid and filename and can send this to a file specified by an environment variable (PROFILE) or stdout if PROFILE is not set. You won't have to change any script code. Once you have the raw times you should be able to knock up some code to get the times you require.

LD_PRELOAD seems to provide everything I need (I will probably
use a finer resolution than 1 sec though).

> Credits:
> Idea: LD_PRELOAD: A little gem put in my head by Diccon Hood at a Sclug meet.
> Sample Code: http://uberhip.com/godber/interception/html/slide_4.html

I'm not sure the time_return calculation in
http://uberhip.com/godber/interception/html/slide_6.html
is correct.  But I get the idea.

If you have some code I would be interested to see it.

-- 
Derek M. Jones                              tel: +44 (0) 1252 520 667
Knowledge Software Ltd                      mailto:derek at knosof.co.uk
Applications Standards Conformance Testing    http://www.knosof.co.uk


More information about the Sclug mailing list