Because the recompilation time of one patched php is nearly 20 seconds, so if 
the sum of degradation time is more than 20 seconds, then our method of 
indirecting function will perorm worse than native regression testing.

Then, can we  group test cases into one test script(.sh), then run the script 
with valgrind(--track-child=yes) to suppress the start up time? In this way,  
will the mechanism of wrapping function in valgrind work well for each test 
case? Thanks very much.


At 2012-06-01 15:24:26,"David Chapman" <dcchap...@acm.org> wrote:
Please remember to use "reply all" so messages go to the list.

On 5/31/2012 11:58 PM, 齐玉华 wrote:
Thanks for your quick reply again. It is probable that the valgrind startup 
time to slow down the short-running scipt. I will validate it later(the 
computer with linux installed is in laboratory).
Then, i seek to wrap some functions in php system to the patched ones in a .so 
file. In this way, the recompilation time-overhead of the patched php will be 
cut down. But to validate the candidate patch, we need to regression testing 
(running the original php system with valgrind against numberous test cases ). 
And the degradation due to valgrind will trade off the recompilation-time cost 
reduction. Thus,  if the valgrind startup time can be somewhat reduced, the way 
to indirect the patched function will have advantage of time-overhead.
Can you give me some advice to reduce the valgrind startup time? Thanks very 
much.


I do not know whether valgrind startup time can be reduced; perhaps Julian 
Seward  (the author of valgrind) would know.  I suspect the answer is no; most 
programs spend much more time running than initializing, so valgrind startup 
time has probably not been a concern to anyone else.

I am not sure I understand your run-time concerns.  You would be using valgrind 
only during testing, so the penalty would be paid only during testing.  Will 
the tests fail simply because they are slower?  Are there so many tests that 
they will take substantially more than 20 minutes?




在 2012-06-01 14:03:14,"David Chapman" <dcchap...@acm.org> 写道:
On 5/31/2012 10:18 PM, 齐玉华 wrote:
Thanks for your quick reply. Here is the detailed information:

The good2.php is attached.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
grace@grace:~/software/WAutoRepair/experiment/php/php_null$ valgrind --version
valgrind-3.7.0
grace@grace:~/software/WAutoRepair/experiment/php/php_null$ uname -a
Linux grace 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 
i686 GNU/Linux
grace@grace:~/software/WAutoRepair/experiment/php/php_null$ 
/home/grace/software/WAutoRepair/experiment/php/php_null/php-src-5.3/sapi/cli/php
 --version
PHP 5.3.7RC4-dev (cli) (built: May 21 2012 23:48:55)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
grace@grace:~/software/WAutoRepair/experiment/php/php_null$ time 
/home/grace/software/WAutoRepair/experiment/php/php_null/php-src-5.3/sapi/cli/php
 good2.php 6

real    0m0.009s
user    0m0.004s
sys    0m0.008s
grace@grace:~/software/WAutoRepair/experiment/php/php_null$time valgrind 
--tool=none -q  
/home/grace/software/WAutoRepair/experiment/php/php_null/php-src-5.3/sapi/cli/php
 good2.php
6

real    0m1.086s
user    0m1.048s
sys    0m0.040s


This could very easily be valgrind startup time, not the slowdown from 
valgrind's instruction simulator.

As requested by the previous post, please try "valgrind --tool=none ls" and 
compare the run time with "ls" by itself.



grace@grace:~/software/WAutoRepair/experiment/php/php_null$ time 
/home/grace/software/WAutoRepair/experiment/php/php_null/php-src-5.3/sapi/cli/php
 --version
PHP 5.3.7RC4-dev (cli) (built: May 21 2012 23:48:55)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

real    0m0.008s
user    0m0.004s
sys    0m0.008s
grace@grace:~/software/WAutoRepair/experiment/php/php_null$ time valgrind 
--tool=none -q  
/home/grace/software/WAutoRepair/experiment/php/php_null/php-src-5.3/sapi/cli/php
 --version
PHP 5.3.7RC4-dev (cli) (built: May 21 2012 23:48:55)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

real    0m0.948s
user    0m0.904s
sys    0m0.044s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 If the set of test cases are numerous(e.g. 1000), then the php will incur 
significantly performance degradation. I am waiting in hope for your insightful 
advices. Thanks again.


If your test cases run in 0.01 seconds each now but will run in 1 second under 
valgrind, 1000 tests will take about 20 minutes.  Why is this a problem?  You 
won't be running valgrind every time you launch PHP.

What happens when you run a large PHP script under valgrind?  Do you still see 
25x or 100x slowdown?





在 2012-06-01 10:40:59,"John Reiser" <jrei...@bitwagon.com> 写道:
>On 05/31/2012 07:10 PM, 齐玉华 wrote:
>>  I try to use Valgrind to wrap some functions in target sotfwares such as 
>> php, libtiff. But i found that valgrind will slow down them significantly(up 
>> to 25 times slowwer), even if run valgrind with '--tool=none'. And as 
>> described in valgrind mannual, there should be 5 times slowwer than native
>> running. I am confused, so anyone can help me to reduce the 
>> instrumentation-cost with some suggestions? I am waiting in hope for your 
>> advices. Thanks.
>
>Please tell us the version of valgrind (the output of "valgrind --version"
>when fed to a shell), which hardware (x86_64, i686, PowerPC 64-bit, ARMv7,
>etc.), and which operating system and release (Ubuntu Linux 12.04, Android 4.1,
>MacOS 10.8 Darwin, etc.)
>
>How much slow-down do you observe for simple programs, such as
>"valgrind --tool=none date", or 'ls', 'who', etc?
>
>-- 
>












------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/



_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/valgrind-users



-- 
    David Chapman      dcchap...@acm.org
    Chapman Consulting -- San Jose, CA
    Software Development Done Right.
    www.chapman-consulting-sj.com





-- 
    David Chapman      dcchap...@acm.org
    Chapman Consulting -- San Jose, CA
    Software Development Done Right.
    www.chapman-consulting-sj.com





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to