* [LTP] [PATCH] fork13 output too large @ 2011-03-03 6:52 Caspar Zhang 2011-03-03 14:38 ` [LTP] [PATCH v2] " Caspar Zhang 0 siblings, 1 reply; 4+ messages in thread From: Caspar Zhang @ 2011-03-03 6:52 UTC (permalink / raw) To: LTP list [-- Attachment #1: Type: text/plain, Size: 1447 bytes --] Hi all, fork13 is a test program back-ported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1, however, this test produces too many outputs that may cause syscall output log too large (10GB+!!). Also 10e7 times fork is too time-consuming, 10e6 forking is valid enough to reproduce the issue and it takes less time (~5min). Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..e7dd192 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -103,8 +103,6 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); distance = pid_distance(last_pid, pid); if (distance == 0) tst_resm(TFAIL, -- 1.7.4.1 -- Quality Engineer (Kernel) in Red Hat Software (Beijing) Co., R&D Branch http://www.cn.redhat.com/ TEL: +86-10-62608150 [-- Attachment #2: 0002-fork13-output-too-large.patch --] [-- Type: text/plain, Size: 1513 bytes --] From c0a48a4c347ee7a7534f9695e7bc66a6649cb753 Mon Sep 17 00:00:00 2001 From: Caspar Zhang <czhang@redhat.com> Date: Thu, 3 Mar 2011 14:47:55 +0800 Subject: [PATCH 2/2] fork13 output too large Hi all, fork13 is a test program ported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1, however, this test produces too many outputs that may cause syscall output log too large (10GB+!!). Also 10e7 times fork is too time-consuming, 10e6 forking is valid enough to reproduce the issue and it takes less time (~5min). Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..e7dd192 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -103,8 +103,6 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); distance = pid_distance(last_pid, pid); if (distance == 0) tst_resm(TFAIL, -- 1.7.4.1 [-- Attachment #3: Type: text/plain, Size: 429 bytes --] ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev [-- Attachment #4: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH v2] fork13 output too large 2011-03-03 6:52 [LTP] [PATCH] fork13 output too large Caspar Zhang @ 2011-03-03 14:38 ` Caspar Zhang 2011-03-03 15:48 ` Caspar Zhang 0 siblings, 1 reply; 4+ messages in thread From: Caspar Zhang @ 2011-03-03 14:38 UTC (permalink / raw) To: LTP list [-- Attachment #1: Type: text/plain, Size: 3435 bytes --] fork13 is a test prog backported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1. However, it produces flooding outputs that may cause syscall output log too large (30GB+!!); also 10e+7 times fork is too time consuming, 10e+6 should be valid enough to reproduce the issue and it takes less time (~3min); if the test fails, it would put an error msg, this might cause flood error msg in output log as well, so I make it break the iteration when a failure occurs. v2: removed more flooding outputs, return immediately when failure occurs. Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 38 ++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..d9dc8b8 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -86,15 +86,14 @@ int main(int argc, char* argv[]) void check(void) { - int lc; + long lc; + int fail = 0; pid_t last_pid = 0; pid_t pid; int child_exit_code, distance, reaped, status; for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; - if (lc % PIDMAX == 0) - tst_resm(TINFO, "Iter: %d", lc/PIDMAX); child_exit_code = lc % RETURN; switch (pid = fork()) { case -1: @@ -103,31 +102,44 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); + if (lc % PIDMAX == 0) + tst_resm(TINFO, "Iter: %ld", lc/PIDMAX); distance = pid_distance(last_pid, pid); - if (distance == 0) + if (distance == 0) { tst_resm(TFAIL, "Unexpected pid sequence: " "previous fork: pid=%d, " "current fork: pid=%d for " - "iteration=%d.", last_pid, pid, + "iteration=%ld.", last_pid, pid, lc); + fail++; + break; + } } last_pid = pid; reaped = wait(&status); - if (reaped != pid) + if (reaped != pid) { tst_resm(TFAIL, "Wait return value: expected pid=%d, " - "got %d, iteration %d.", pid, reaped, + "got %d, iteration %ld.", pid, reaped, lc); - else if (WEXITSTATUS(status) != child_exit_code) + fail++; + break; + } + else if (WEXITSTATUS(status) != child_exit_code) { tst_resm(TFAIL, "Unexpected exit status %x, " - "iteration %d.", WEXITSTATUS(status), + "iteration %ld.", WEXITSTATUS(status), lc); + fail++; + break; + } } } + if (fail) + tst_resm(TFAIL, "%ld pids forked, failure occured", lc); + else + tst_resm(TPASS, "%ld pids forked, all passed", lc); } void setup(void) @@ -171,9 +183,9 @@ void cleanup(void) TEST_CLEANUP; } -/* The distance mod 32768 between two pids, where the first pid is +/* The distance mod PIDMAX between two pids, where the first pid is expected to be smaller than the second. */ int pid_distance(pid_t first, pid_t second) { - return (second + 32768 - first) % 32768; + return (second + PIDMAX - first) % PIDMAX; } -- 1.7.4.1 [-- Attachment #2: 0001-fork13-output-too-large.patch --] [-- Type: text/plain, Size: 3554 bytes --] From b30f6f184e293405ffdf0f7b8a2d293afcd2f853 Mon Sep 17 00:00:00 2001 From: Caspar Zhang <czhang@redhat.com> Date: Thu, 3 Mar 2011 21:45:25 +0800 Subject: [PATCH] fork13 output too large fork13 is a test prog backported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1. However, it produces flooding outputs that may cause syscall output log too large (30GB+!!); also 10e+7 times fork is too time consuming, 10e+6 should be valid enough to reproduce the issue and it takes less time (~3min); if the test fails, it would put an error msg, this might cause flood error msg in output log as well, so I make it break the iteration when a failure occurs. Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 38 ++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..d9dc8b8 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -86,15 +86,14 @@ int main(int argc, char* argv[]) void check(void) { - int lc; + long lc; + int fail = 0; pid_t last_pid = 0; pid_t pid; int child_exit_code, distance, reaped, status; for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; - if (lc % PIDMAX == 0) - tst_resm(TINFO, "Iter: %d", lc/PIDMAX); child_exit_code = lc % RETURN; switch (pid = fork()) { case -1: @@ -103,31 +102,44 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); + if (lc % PIDMAX == 0) + tst_resm(TINFO, "Iter: %ld", lc/PIDMAX); distance = pid_distance(last_pid, pid); - if (distance == 0) + if (distance == 0) { tst_resm(TFAIL, "Unexpected pid sequence: " "previous fork: pid=%d, " "current fork: pid=%d for " - "iteration=%d.", last_pid, pid, + "iteration=%ld.", last_pid, pid, lc); + fail++; + break; + } } last_pid = pid; reaped = wait(&status); - if (reaped != pid) + if (reaped != pid) { tst_resm(TFAIL, "Wait return value: expected pid=%d, " - "got %d, iteration %d.", pid, reaped, + "got %d, iteration %ld.", pid, reaped, lc); - else if (WEXITSTATUS(status) != child_exit_code) + fail++; + break; + } + else if (WEXITSTATUS(status) != child_exit_code) { tst_resm(TFAIL, "Unexpected exit status %x, " - "iteration %d.", WEXITSTATUS(status), + "iteration %ld.", WEXITSTATUS(status), lc); + fail++; + break; + } } } + if (fail) + tst_resm(TFAIL, "%ld pids forked, failure occured", lc); + else + tst_resm(TPASS, "%ld pids forked, all passed", lc); } void setup(void) @@ -171,9 +183,9 @@ void cleanup(void) TEST_CLEANUP; } -/* The distance mod 32768 between two pids, where the first pid is +/* The distance mod PIDMAX between two pids, where the first pid is expected to be smaller than the second. */ int pid_distance(pid_t first, pid_t second) { - return (second + 32768 - first) % 32768; + return (second + PIDMAX - first) % PIDMAX; } -- 1.7.4.1 [-- Attachment #3: Type: text/plain, Size: 429 bytes --] ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev [-- Attachment #4: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v2] fork13 output too large 2011-03-03 14:38 ` [LTP] [PATCH v2] " Caspar Zhang @ 2011-03-03 15:48 ` Caspar Zhang 2011-03-04 9:30 ` Garrett Cooper 0 siblings, 1 reply; 4+ messages in thread From: Caspar Zhang @ 2011-03-03 15:48 UTC (permalink / raw) To: LTP list [-- Attachment #1: Type: text/plain, Size: 3358 bytes --] Oh... I sent the wrong v2 patch. here is the correct PATCH v2. Sorry for noise... On 03/03/2011 10:38 PM, Caspar Zhang wrote: > > v2: removed more flooding outputs, return immediately when failure occurs. fork13 is a test prog backported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1. However, it produces flooding outputs that may cause syscall output log too large (30GB+!!); also 10e+7 times fork is too time consuming, 10e+6 should be valid enough to reproduce the issue and it takes less time (~3min); if the test fails, it would put an error msg, this might cause flood error msg in output log as well, so I make it return immediately when a failure occurs. Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..4804ea1 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -86,15 +86,13 @@ int main(int argc, char* argv[]) void check(void) { - int lc; + long lc; pid_t last_pid = 0; pid_t pid; int child_exit_code, distance, reaped, status; for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; - if (lc % PIDMAX == 0) - tst_resm(TINFO, "Iter: %d", lc/PIDMAX); child_exit_code = lc % RETURN; switch (pid = fork()) { case -1: @@ -103,31 +101,36 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); distance = pid_distance(last_pid, pid); - if (distance == 0) + if (distance == 0) { tst_resm(TFAIL, "Unexpected pid sequence: " "previous fork: pid=%d, " "current fork: pid=%d for " - "iteration=%d.", last_pid, pid, + "iteration=%ld.", last_pid, pid, lc); + return; + } } last_pid = pid; reaped = wait(&status); - if (reaped != pid) + if (reaped != pid) { tst_resm(TFAIL, "Wait return value: expected pid=%d, " - "got %d, iteration %d.", pid, reaped, + "got %d, iteration %ld.", pid, reaped, lc); - else if (WEXITSTATUS(status) != child_exit_code) + return; + } + else if (WEXITSTATUS(status) != child_exit_code) { tst_resm(TFAIL, "Unexpected exit status %x, " - "iteration %d.", WEXITSTATUS(status), + "iteration %ld.", WEXITSTATUS(status), lc); + return; + } } } + tst_resm(TPASS, "%ld pids forked, all passed", lc); } void setup(void) @@ -171,9 +174,9 @@ void cleanup(void) TEST_CLEANUP; } -/* The distance mod 32768 between two pids, where the first pid is +/* The distance mod PIDMAX between two pids, where the first pid is expected to be smaller than the second. */ int pid_distance(pid_t first, pid_t second) { - return (second + 32768 - first) % 32768; + return (second + PIDMAX - first) % PIDMAX; } -- 1.7.4.1 [-- Attachment #2: 0001-fork13-output-too-large.patch --] [-- Type: text/plain, Size: 3345 bytes --] From 4c1f6db5f41df2b4c9c55423f05ff37d48559f85 Mon Sep 17 00:00:00 2001 From: Caspar Zhang <czhang@redhat.com> Date: Thu, 3 Mar 2011 22:25:24 +0800 Subject: [PATCH] fork13 output too large fork13 is a test prog backported from upstream mainline: 5fdee8c4a5e1800489ce61963208f8cc55e42ea1. However, it produces flooding outputs that may cause syscall output log too large (30GB+!!); also 10e+7 times fork is too time consuming, 10e+6 should be valid enough to reproduce the issue and it takes less time (~3min); if the test fails, it would put an error msg, this might cause flood error msg in output log as well, so I make it return immediately when a failure occurs. Signed-off-by: Caspar Zhang <czhang@redhat.com> --- runtest/syscalls | 2 +- testcases/kernel/syscalls/fork/fork13.c | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index d402531..3bd9c50 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -274,7 +274,7 @@ fork08 fork08 fork09 fork09 fork10 fork10 fork11 fork11 -fork13 fork13 -c 2 -i 10000000 +fork13 fork13 -c 2 -i 1000000 fpathconf01 fpathconf01 diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c index 7c72352..4804ea1 100644 --- a/testcases/kernel/syscalls/fork/fork13.c +++ b/testcases/kernel/syscalls/fork/fork13.c @@ -86,15 +86,13 @@ int main(int argc, char* argv[]) void check(void) { - int lc; + long lc; pid_t last_pid = 0; pid_t pid; int child_exit_code, distance, reaped, status; for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; - if (lc % PIDMAX == 0) - tst_resm(TINFO, "Iter: %d", lc/PIDMAX); child_exit_code = lc % RETURN; switch (pid = fork()) { case -1: @@ -103,31 +101,36 @@ void check(void) exit(child_exit_code); default: if (lc > 0) { - tst_resm(TINFO, "last_pid = %d pid = %d", - last_pid, pid); distance = pid_distance(last_pid, pid); - if (distance == 0) + if (distance == 0) { tst_resm(TFAIL, "Unexpected pid sequence: " "previous fork: pid=%d, " "current fork: pid=%d for " - "iteration=%d.", last_pid, pid, + "iteration=%ld.", last_pid, pid, lc); + return; + } } last_pid = pid; reaped = wait(&status); - if (reaped != pid) + if (reaped != pid) { tst_resm(TFAIL, "Wait return value: expected pid=%d, " - "got %d, iteration %d.", pid, reaped, + "got %d, iteration %ld.", pid, reaped, lc); - else if (WEXITSTATUS(status) != child_exit_code) + return; + } + else if (WEXITSTATUS(status) != child_exit_code) { tst_resm(TFAIL, "Unexpected exit status %x, " - "iteration %d.", WEXITSTATUS(status), + "iteration %ld.", WEXITSTATUS(status), lc); + return; + } } } + tst_resm(TPASS, "%ld pids forked, all passed", lc); } void setup(void) @@ -171,9 +174,9 @@ void cleanup(void) TEST_CLEANUP; } -/* The distance mod 32768 between two pids, where the first pid is +/* The distance mod PIDMAX between two pids, where the first pid is expected to be smaller than the second. */ int pid_distance(pid_t first, pid_t second) { - return (second + 32768 - first) % 32768; + return (second + PIDMAX - first) % PIDMAX; } -- 1.7.4.1 [-- Attachment #3: Type: text/plain, Size: 429 bytes --] ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev [-- Attachment #4: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v2] fork13 output too large 2011-03-03 15:48 ` Caspar Zhang @ 2011-03-04 9:30 ` Garrett Cooper 0 siblings, 0 replies; 4+ messages in thread From: Garrett Cooper @ 2011-03-04 9:30 UTC (permalink / raw) To: Caspar Zhang; +Cc: LTP list On Thu, Mar 3, 2011 at 7:48 AM, Caspar Zhang <czhang@redhat.com> wrote: > Oh... I sent the wrong v2 patch. here is the correct PATCH v2. Sorry for > noise... Seems sane -- thanks! -Garrett ------------------------------------------------------------------------------ What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-04 9:30 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-03-03 6:52 [LTP] [PATCH] fork13 output too large Caspar Zhang 2011-03-03 14:38 ` [LTP] [PATCH v2] " Caspar Zhang 2011-03-03 15:48 ` Caspar Zhang 2011-03-04 9:30 ` Garrett Cooper
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox