On Tue, Nov 24, 2009 at 7:07 PM, Mitani <[email protected]> wrote:
> Hi,
>
> Following failure occurred in mbind01 when I execute "runltp" using
> ltp-2009-11-12.tar.gz.
> Similer failure occured with several recent versions from
> ltp-2009-11-17.tar.gz
> to ltp-2009-11-24.tar.gz, too.
>
> <error message>

[...]

> On the other hand, with "ltp-full-20091031", it passed as following message
> (My system not supports NUMA).
>
> -----------------------------
> mbind01     1  TCONF  :  NUMA support not provided.
> -----------------------------
>
>
> Therefore, this problem seems to be after 2009/11/04 revision, I think.
>
>
> Following shows revision contribution contents.
>
> http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/syscalls/mbin
> d/mbind01.c?view=log
>
> -----------------------------
> Revision 1.7
> Wed Nov 4 06:18:27 2009 UTC (2 weeks, 6 days ago) by yaberauneya
> Branch: MAIN
> Changes since 1.6: +1 -13 lines
> Diff to previous 1.6
> I was confused, and numaif.h is in fact a header under
> testcases/kernel/syscalls/utils. As such:
>
> 1. The autoconf test for the header is removed.
> 2. An appropriate inclusion is added for numa.h in numaif.h
> 3. Remove overengineered code in get_mempolicy01.c because
> linux_syscall_numbers.h handles the unhandled numa syscall numbers.
>
> Signed-off-by: Garrett Cooper <[email protected]>
>
>
> Revision 1.6
> Wed Nov 4 04:59:44 2009 UTC (2 weeks, 6 days ago) by yaberauneya
> Branch: MAIN
> Changes since 1.5: +263 -281 lines
> Diff to previous 1.5
> 1. Disable the test whenever the appropriate headers and syscalls don't
> exist so this will compile on systems without numa and without.
> 2. Fix the indentation.
> 3. Use TFAIL | TERRNO instead of all of the ad-hoc (TFAIL ... TERRNO,
> strerror(TERRNO)) logic.
>
> Signed-off-by: Garrett Cooper <[email protected]>
> -----------------------------
>
>
> According to the contribution of these revisions, it is written that
> "Disable the test whenever the appropriate headers and syscalls don't
> exist.".
> However, when I compare these revisions, the judgement sentence
> whether numa is supported or not is deleted, and the error output sentence
> that numa is not supported is deleted.
>
> Following shows the result of compare of "Revision 1.6 and Revision 1.5"
> and "Revision 1.7 and Revision 1.6".
>
> <Revision 1.6 and Revision 1.5>
> -----------------------------
> --- mbind01.c   2009/10/09 17:55:57     1.5
> +++ mbind01.c   2009/11/04 04:59:44     1.6
> @@ -1,50 +1,51 @@
> .
> @@ -55,10 +56,12 @@
> .
> @@ -66,70 +69,72 @@
> .
> -#if HAS_NUMA_H
>  static struct test_case tcase[] = {
> .
> -#else
> -static struct test_case tcase[] = { };
> -#endif
> .
> @@ -261,82 +262,80 @@
> .
>  static int do_test(struct test_case *tc) {
> -#if HAS_NUMA_H
> .
> -#else
> -       return -1;
> -#endif
> .
> @@ -346,47 +345,43 @@
> .
> -#if HAS_NUMA_H
> .
> @@ -394,45 +389,32 @@
> .
>  #else
> +int main (void) {
>        tst_resm(TCONF, "NUMA support not provided.");
> -#endif
> -        cleanup();
>        tst_exit();
>  }
> +#endif
> -----------------------------
>
> <Revision 1.7 and Revision 1.6>
> -----------------------------
> --- mbind01.c   2009/11/04 04:59:44     1.6
> +++ mbind01.c   2009/11/04 06:18:27     1.7
> @@ -59,14 +59,11 @@
> .
> @@ -77,8 +74,6 @@
> .
> @@ -411,10 +406,3 @@
>        cleanup();
>        tst_exit();
>  }
> -
> -#else
> -int main (void) {
> -       tst_resm(TCONF, "NUMA support not provided.");
> -       tst_exit();
> -}
> -#endif
> -----------------------------
>
> I think that these revisions may contradict the above contribution.
> (Please forgive me if my opinion was wrong.)
>
>
> To revise this problem (error of "Function not implemented") like above
> contribution, it is necessary to judge numa supporting by using "#if
> HAS_NUMA_H".
> And it is necessary to end with " tst_resm(TCONF, "NUMA support not
> provided.") "
> when not support, I think.
> It is the point same as 2009/10/31 version.
>
>
> Following shows my revise draft.
>
>
> ============
> --- mbind01.c.org       2009-11-24 18:17:27.000000000 +0900
> +++ mbind01.c   2009-11-24 16:09:03.000000000 +0900
> @@ -176,6 +176,7 @@
>  *                   (only we can do is simulate 1-node NUMA)
>  */
>
> +#if HAS_NUMA_H
>  static struct test_case tcase[] = {
>        { /* case00 */
>                .policy     = MPOL_DEFAULT,
> @@ -246,6 +247,7 @@
>                .err        = EFAULT,
>        },
>  };
> +#endif
>
>  #define MEM_LENGTH           (4 * 1024 * 1024)
>  /*
> @@ -365,6 +367,7 @@
>
>        setup();
>
> +#if HAS_NUMA_H
>        int lc, i, ret;          /* loop counter */
>
>        /* Check looping state if -i option given */
> @@ -404,4 +407,9 @@
>        }
>        cleanup();
>        tst_exit();
> +
> +#else
> +       tst_resm(TCONF, "NUMA support not provided.");
> +#endif
> +
>  }
> ============
>
>
> Can I get opinion that my revision is right or not?

Something I realized after testing yesterday, is that although we're
overriding syscall, it doesn't catch ENOSYS and output tst_brkm(TCONF,
...) like I thought it would.

Would you please do the following?

1. cd $LTPSRC/testcases/kernel/include
2. Apply the following patch:

Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v
retrieving revision 1.12
diff -u -p -r1.12 regen.sh
--- regen.sh    19 Nov 2009 19:35:15 -0000      1.12
+++ regen.sh    25 Nov 2009 05:12:13 -0000
@@ -32,8 +32,13 @@ static void cleanup(void);
                tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your 
arch"); \\
                errno = ENOSYS; \\
                __ret = -1; \\
-       } else \\
+       } else { \\
                __ret = syscall(NR, ##__VA_ARGS__); \\
+               if (__ret == -1 && errno == ENOSYS) { \\
+                       tst_brkm(TCONF, cleanup, "syscall " #NR " not supported 
on your arch"); \\
+                       errno = ENOSYS; \\
+               } \\
+       } \\
        __ret; \\
 })
 EOF

3. make clean all
4. cd ../syscalls/mbind
5. make clean all
6. ./mbind01

Let me know how it goes -- if other folks agree with the solution
(ENOSYS is always TCONF with the syscall(2) wrapper) I'll check it
directly into CVS; otherwise I'll have to engineer a large scale
solution in a number of tests which have syscall numbers defined on
later kernel versions, s.t. they fail happily with TCONF when errno ==
ENOSYS.

Thanks!
-Garrett

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to