On 03/05/2014 10:15 PM, [email protected] wrote:
> Hi!
>> Delete some useless comments and fix some.
>>
>> Use SAFE_* macros.
>>
>> Make a re-arrangement on original code: let parent process
>> work in do_parent(), child process work in do_child(), and
>> arguments parse and initialization work in setup().
>>
>> Some cleanup.
>>
>> Signed-off-by: Xiaoguang Wang <[email protected]>
>> ---
>> testcases/kernel/ipc/pipeio/pipeio.c | 945
>> ++++++++++++++++-------------------
>> 1 file changed, 429 insertions(+), 516 deletions(-)
>>
>> diff --git a/testcases/kernel/ipc/pipeio/pipeio.c
>> b/testcases/kernel/ipc/pipeio/pipeio.c
>> index 7dfbe44..3e1b4a6 100644
>> --- a/testcases/kernel/ipc/pipeio/pipeio.c
>> +++ b/testcases/kernel/ipc/pipeio/pipeio.c
>> @@ -52,28 +52,18 @@
>>
>> + for (i = num_writers; i > 0; --i) {
>> + child = FORK_OR_VFORK();
> Do not use FORK_OR_VFORK() in testcases that are not ported to uClinux.
OK, got it, thanks.
>
>> +
>> + if (ret == 1) {
>> + usage();
>> + return ret;
>> + }
>> }
>>
>> + return ret;
>> +}
> I see some changes in the option parsing code.
This patch is a long cleanup, thanks for reviewing this.
>
> * The C option is removed
> (this one makes sense because it's not supported)
Yes.
>
> * The B background option is removed
Here I think the "-B" option does not make much sense.
And if "-B" option is specified, the parent process will always
return 0, which won't reflect the correct test results.
>
> * The d dir option no longer copies the dir name, why?
"-d" option is used to specify a directory, where named pipe is created, other
than the current directory. Tst_tmpdir() will create a temporary directory, so
I think
"-d" option may be removed.
>
>
> This should be exaplained in the commit message, or even better for a
> patch of this size split it into part that only moves codeblocks around
> and patch that changes behavior.
>
>
> Also have you tried to run the test with options we have in runtest
> files before and after the changes? Was the test output and runtime
> the same?
Yes, I had run these tests and compared the test results, which were
almost the same.
Here is the diff info between "before" and "after".
------------------------------------------------------------------------------------------
Running tests.......
<<<test_start>>>
-tag=pipeio_1 stime=1394075443
+tag=pipeio_1 stime=1394075325
cmdline="pipeio -T pipeio_1 -c 5 -s 4090 -i 100 -b -f x80"
contacts=""
analysis=exit
<<<test_output>>>
-pipeio_1 1 TPASS : 1 PASS 501 pipe reads complete, read size = 4090,
named pipe, blking,
+pipeio_1 1 TPASS : PASS 501 pipe reads complete, read size = 4090, named
pipe, blking,
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
-tag=pipeio_3 stime=1394075443
+tag=pipeio_3 stime=1394075325
cmdline="pipeio -T pipeio_3 -c 5 -s 4090 -i 100 -u -b -f x80"
contacts=""
analysis=exit
<<<test_output>>>
-pipeio_3 1 TPASS : 1 PASS 501 pipe reads complete, read size = 4090, sys
pipe,
+pipeio_3 1 TPASS : PASS 501 pipe reads complete, read size = 4090, sys
pipe,
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
-tag=pipeio_4 stime=1394075443
+tag=pipeio_4 stime=1394075325
cmdline="pipeio -T pipeio_4 -c 5 -s 4090 -i 100 -u -f x80"
contacts=""
analysis=exit
<<<test_output>>>
-pipeio_4 1 TPASS : 1 PASS 501 pipe reads complete, read size = 4090, sys
pipe,
+pipeio_4 1 TPASS : PASS 501 pipe reads complete, read size = 4090, sys
pipe,
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
-tag=pipeio_5 stime=1394075443
+tag=pipeio_5 stime=1394075325
cmdline="pipeio -T pipeio_5 -c 5 -s 5000 -i 10 -b -f x80"
contacts=""
analysis=exit
<<<test_output>>>
pipeio_5 0 TINFO : adjusting i/o size to 4096, and # of writes to 13
-pipeio_5 1 TPASS : 1 PASS 66 pipe reads complete, read size = 4096,
named pipe, blking,
+pipeio_5 1 TPASS : PASS 66 pipe reads complete, read size = 4096, named
pipe, blking,
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
-tag=pipeio_6 stime=1394075443
+tag=pipeio_6 stime=1394075325
cmdline="pipeio -T pipeio_6 -c 5 -s 5000 -i 10 -b -u -f x80"
contacts=""
analysis=exit
<<<test_output>>>
pipeio_6 0 TINFO : adjusting i/o size to 4096, and # of writes to 13
-pipeio_6 1 TPASS : 1 PASS 66 pipe reads complete, read size = 4096, sys
pipe,
+pipeio_6 1 TPASS : PASS 66 pipe reads complete, read size = 4096, sys
pipe,
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
<<<test_start>>>
-tag=pipeio_8 stime=1394075443
+tag=pipeio_8 stime=1394075325
cmdline="pipeio -T pipeio_8 -c 5 -s 5000 -i 10 -u -f x80"
contacts=""
analysis=exit
<<<test_output>>>
pipeio_8 0 TINFO : adjusting i/o size to 4096, and # of writes to 13
-pipeio_8 1 TPASS : 1 PASS 66 pipe reads complete, read size = 4096, sys
pipe,
+pipeio_8 1 TPASS : PASS 66 pipe reads complete, read size = 4096, sys
pipe,
incrementing stop
<<<execution_status>>>
initiation_status="ok"
--------------------------------------------------------------------------------------------------------
Regards,
Xiaoguang Wang
>
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list