* Re: [LTP] [PATCH] Adapt the cgroup/test_6_2 test to the various ways clone is called on different architectures
[not found] <200906220256.n5M2uvax024525@e33.co.us.ibm.com>
@ 2009-06-23 14:50 ` Subrata Modak
0 siblings, 0 replies; 3+ messages in thread
From: Subrata Modak @ 2009-06-23 14:50 UTC (permalink / raw)
To: Jiri Palecek; +Cc: ltp-list
On Fri, 2009-06-19 at 16:14 +0200, Jiri Palecek > wrote:
> Code shamelessly taken from clone01 test
>
> Signed-off-by: Jiri Palecek <jpalecek@web.de>
Thanks.
Regards--
Subrata
> ---
> .../kernel/controllers/cgroup/clone_platform.h | 34 ++++++++++++++++++++
> testcases/kernel/controllers/cgroup/test_6_2.c | 12 ++++++-
> 2 files changed, 45 insertions(+), 1 deletions(-)
> create mode 100644 testcases/kernel/controllers/cgroup/clone_platform.h
>
> diff --git a/testcases/kernel/controllers/cgroup/clone_platform.h b/testcases/kernel/controllers/cgroup/clone_platform.h
> new file mode 100644
> index 0000000..1785dd1
> --- /dev/null
> +++ b/testcases/kernel/controllers/cgroup/clone_platform.h
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of version 2 of the GNU General Public License as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it would be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write the Free Software Foundation, Inc., 59
> + * Temple Place - Suite 330, Boston MA 02111-1307, USA.
> + *
> + */
> +/* Common platform specific defines for the clone system call tests */
> +
> +//#define CHILD_STACK_SIZE 8192
> +#define CHILD_STACK_SIZE 16384
> +
> +#if defined (__s390__) || (__s390x__)
> +#define clone __clone
> +extern int __clone(int(void*),void*,int,void*);
> +#elif defined(__ia64__)
> +#define clone2 __clone2
> +/* Prototype provided by David Mosberger */
> +/* int __clone2(int (*fn) (void *arg), void *child_stack_base, */
> +/* size_t child_stack_size, int flags, void *arg, */
> +/* pid_t *parent_tid, void *tls, pid_t *child_tid) */
> +extern int __clone2(int (*fn) (void *arg), void *child_stack_base,
> + size_t child_stack_size, int flags, void *arg,
> + pid_t *parent_tid, void *tls, pid_t *child_tid);
> +#endif
> diff --git a/testcases/kernel/controllers/cgroup/test_6_2.c b/testcases/kernel/controllers/cgroup/test_6_2.c
> index e5bddb2..79f5c20 100644
> --- a/testcases/kernel/controllers/cgroup/test_6_2.c
> +++ b/testcases/kernel/controllers/cgroup/test_6_2.c
> @@ -24,6 +24,8 @@
> #include <unistd.h>
> #include <sched.h>
>
> +#include "clone_platform.h"
> +
> #define DEFAULT_USEC 30000
>
> int foo(void __attribute__((unused)) *arg)
> @@ -42,7 +44,15 @@ int main(int argc, char **argv)
>
> while (1) {
> usleep(usec);
> - clone(foo, stack+4096, CLONE_NEWNS, NULL);
> +#if defined(__hppa__)
> + clone(foo, stack, CLONE_NEWNS, NULL);
> +#elif defined(__ia64__)
> + clone2(foo, stack,
> + 4096, CLONE_NEWNS, NULL, NULL, NULL, NULL);
> +#else
> + clone
> + (foo, stack + 4096, CLONE_NEWNS, NULL);
> +#endif
> }
>
> return 0;
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] Adapt the cgroup/test_6_2 test to the various ways clone is called on different architectures
@ 2009-06-24 14:12 Cyril Hrubis
0 siblings, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2009-06-24 14:12 UTC (permalink / raw)
To: Jiri Palecek >; +Cc: ltp-list
Hi,
that's the clone() check I was speaking about here. IMHO much cleaner solution
is to create some directory in ltp root (someting like libftest) and put all
such headers and code there, so they are not copied and spread all around ltp.
> Code shamelessly taken from clone01 test
>
> Signed-off-by: Jiri Palecek <jpalecek@web.de>
> ---
> .../kernel/controllers/cgroup/clone_platform.h | 34 ++++++++++++++++++++
> testcases/kernel/controllers/cgroup/test_6_2.c | 12 ++++++-
> 2 files changed, 45 insertions(+), 1 deletions(-)
> create mode 100644 testcases/kernel/controllers/cgroup/clone_platform.h
>
> diff --git a/testcases/kernel/controllers/cgroup/clone_platform.h b/testcases/kernel/controllers/cgroup/clone_platform.h
> new file mode 100644
> index 0000000..1785dd1
> --- /dev/null
> +++ b/testcases/kernel/controllers/cgroup/clone_platform.h
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of version 2 of the GNU General Public License as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it would be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write the Free Software Foundation, Inc., 59
> + * Temple Place - Suite 330, Boston MA 02111-1307, USA.
> + *
> + */
> +/* Common platform specific defines for the clone system call tests */
> +
> +//#define CHILD_STACK_SIZE 8192
> +#define CHILD_STACK_SIZE 16384
> +
> +#if defined (__s390__) || (__s390x__)
> +#define clone __clone
> +extern int __clone(int(void*),void*,int,void*);
> +#elif defined(__ia64__)
> +#define clone2 __clone2
> +/* Prototype provided by David Mosberger */
> +/* int __clone2(int (*fn) (void *arg), void *child_stack_base, */
> +/* size_t child_stack_size, int flags, void *arg, */
> +/* pid_t *parent_tid, void *tls, pid_t *child_tid) */
> +extern int __clone2(int (*fn) (void *arg), void *child_stack_base,
> + size_t child_stack_size, int flags, void *arg,
> + pid_t *parent_tid, void *tls, pid_t *child_tid);
> +#endif
> diff --git a/testcases/kernel/controllers/cgroup/test_6_2.c b/testcases/kernel/controllers/cgroup/test_6_2.c
> index e5bddb2..79f5c20 100644
> --- a/testcases/kernel/controllers/cgroup/test_6_2.c
> +++ b/testcases/kernel/controllers/cgroup/test_6_2.c
> @@ -24,6 +24,8 @@
> #include <unistd.h>
> #include <sched.h>
>
> +#include "clone_platform.h"
> +
> #define DEFAULT_USEC 30000
>
> int foo(void __attribute__((unused)) *arg)
> @@ -42,7 +44,15 @@ int main(int argc, char **argv)
>
> while (1) {
> usleep(usec);
> - clone(foo, stack+4096, CLONE_NEWNS, NULL);
> +#if defined(__hppa__)
> + clone(foo, stack, CLONE_NEWNS, NULL);
> +#elif defined(__ia64__)
> + clone2(foo, stack,
> + 4096, CLONE_NEWNS, NULL, NULL, NULL, NULL);
> +#else
> + clone
> + (foo, stack + 4096, CLONE_NEWNS, NULL);
> +#endif
> }
>
> return 0;
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread* [LTP] [PATCH] Adapt the cgroup/test_6_2 test to the various ways clone is called on different architectures
@ 2009-06-19 14:14 Jiri Palecek >
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Palecek > @ 2009-06-19 14:14 UTC (permalink / raw)
Cc: ltp-list
Code shamelessly taken from clone01 test
Signed-off-by: Jiri Palecek <jpalecek@web.de>
---
.../kernel/controllers/cgroup/clone_platform.h | 34 ++++++++++++++++++++
testcases/kernel/controllers/cgroup/test_6_2.c | 12 ++++++-
2 files changed, 45 insertions(+), 1 deletions(-)
create mode 100644 testcases/kernel/controllers/cgroup/clone_platform.h
diff --git a/testcases/kernel/controllers/cgroup/clone_platform.h b/testcases/kernel/controllers/cgroup/clone_platform.h
new file mode 100644
index 0000000..1785dd1
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/clone_platform.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ */
+/* Common platform specific defines for the clone system call tests */
+
+//#define CHILD_STACK_SIZE 8192
+#define CHILD_STACK_SIZE 16384
+
+#if defined (__s390__) || (__s390x__)
+#define clone __clone
+extern int __clone(int(void*),void*,int,void*);
+#elif defined(__ia64__)
+#define clone2 __clone2
+/* Prototype provided by David Mosberger */
+/* int __clone2(int (*fn) (void *arg), void *child_stack_base, */
+/* size_t child_stack_size, int flags, void *arg, */
+/* pid_t *parent_tid, void *tls, pid_t *child_tid) */
+extern int __clone2(int (*fn) (void *arg), void *child_stack_base,
+ size_t child_stack_size, int flags, void *arg,
+ pid_t *parent_tid, void *tls, pid_t *child_tid);
+#endif
diff --git a/testcases/kernel/controllers/cgroup/test_6_2.c b/testcases/kernel/controllers/cgroup/test_6_2.c
index e5bddb2..79f5c20 100644
--- a/testcases/kernel/controllers/cgroup/test_6_2.c
+++ b/testcases/kernel/controllers/cgroup/test_6_2.c
@@ -24,6 +24,8 @@
#include <unistd.h>
#include <sched.h>
+#include "clone_platform.h"
+
#define DEFAULT_USEC 30000
int foo(void __attribute__((unused)) *arg)
@@ -42,7 +44,15 @@ int main(int argc, char **argv)
while (1) {
usleep(usec);
- clone(foo, stack+4096, CLONE_NEWNS, NULL);
+#if defined(__hppa__)
+ clone(foo, stack, CLONE_NEWNS, NULL);
+#elif defined(__ia64__)
+ clone2(foo, stack,
+ 4096, CLONE_NEWNS, NULL, NULL, NULL, NULL);
+#else
+ clone
+ (foo, stack + 4096, CLONE_NEWNS, NULL);
+#endif
}
return 0;
--
1.6.3.1
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-24 14:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200906220256.n5M2uvax024525@e33.co.us.ibm.com>
2009-06-23 14:50 ` [LTP] [PATCH] Adapt the cgroup/test_6_2 test to the various ways clone is called on different architectures Subrata Modak
2009-06-24 14:12 Cyril Hrubis
-- strict thread matches above, loose matches on Subject: below --
2009-06-19 14:14 Jiri Palecek >
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox