Skip to contentSkip to conversation

syscalls/profil01: disable this test for uClibc

PATCH New Yuriy Kolerov 3 participants 6 messages Mar 4, 2016 – Mar 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

uClibc doesn't have profiling support.

---
 testcases/kernel/syscalls/profil/profil01.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-syscalls-profil01-disable-this-test-for-uClibc.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160304/8ceac2bb/attachment.bin>

#1 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

Quoted 3 lines · Yuriy Kolerov

uClibc doesn't have profiling support.

As you are here, would you check all of the uclibc unsupported and submit patches for us? BTW, I found a patch[1] for your reference, if you can make, test and fix them all, it's great!

[1] https://patchwork.ozlabs.org/patch/592345/

Thanks,
Wanlong Gao

Quoted 35 lines
---
 testcases/kernel/syscalls/profil/profil01.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
testcases/kernel/syscalls/profil/profil01.c +10 -0
index 2fc47aa..c44daa7 100644
@@ -39,6 +39,8 @@
 char *TCID = "profil01";
 int TST_TOTAL = 1;
 
+#if !defined(__UCLIBC__)
+
 static volatile sig_atomic_t profil_done;
 
 static void alrm_handler(int sig)
@@ -124,3 +126,11 @@ int main(int ac, char *av[])
 
 	tst_exit();
 }
+
+#else
+int main(void)
+{
+	tst_brkm(TCONF, NULL, "system doesn't have profiling support");
+}
+#endif
+
Signature · 2 lines
-- 
Mailing list info: http://lists.linux.it/listinfo/ltp
#2 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

In reply to Yuriy Kolerov

Hi!

Quoted 14 lines
testcases/kernel/syscalls/profil/profil01.c +2 -0
index 2fc47aa..c44daa7 100644
@@ -39,6 +39,8 @@
 char *TCID = "profil01";
 int TST_TOTAL = 1;
 
+#if !defined(__UCLIBC__)
+
 static volatile sig_atomic_t profil_done;
 
 static void alrm_handler(int sig)

testcases/kernel/syscalls/profil/profil01.c int main(int ac, char *av[]) · line 135

Quoted 10 lines
testcases/kernel/syscalls/profil/profil01.c +7 -0
@@ -124,3 +126,11 @@ int main(int ac, char *av[])
 
 	tst_exit();
 }
+
+#else
+int main(void)
+{
+	tst_brkm(TCONF, NULL, "system doesn't have profiling support");
+}
+#endif

Adding #ifdefs for each platform/libc implementation like this does not really scale.

What about handling it the same way we handle UCLINUX in the Makefiles?

Have a look at:

ltp/testcases/kernel/syscalls/Makefile
ltp/testcases/kernel/syscalls/writev/Makefile

Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

Hi Cyril,

Thanks! I've not noticed it earlier. I will make a proper fix. Indeed there are more tests which are excluded for uClibc and uClinux by that ugly way so they must be fixed properly in future too.

Regards,
Yuriy Kolerov

Quoted 47 lines

-----Original Message-----
From: Cyril Hrubis [mailto:[email protected]]
Sent: Monday, March 07, 2016 12:54 PM
To: Yuriy Kolerov <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [LTP] [PATCH] syscalls/profil01: disable this test for uClibc

Hi!

Quoted 15 lines
testcases/kernel/syscalls/profil/profil01.c +2 -0
index 2fc47aa..c44daa7 100644
@@ -39,6 +39,8 @@
 char *TCID = "profil01";
 int TST_TOTAL = 1;
 
+#if !defined(__UCLIBC__)
+
 static volatile sig_atomic_t profil_done;
 
 static void alrm_handler(int sig)

testcases/kernel/syscalls/profil/profil01.c int main(int ac, char *av[]) · line 134

Quoted 9 lines
testcases/kernel/syscalls/profil/profil01.c +6 -0
@@ -124,3 +126,11 @@ int main(int ac, char *av[])
 
 	tst_exit();
 }
+
+#else
+int main(void)
+{
+	tst_brkm(TCONF, NULL, "system doesn't have profiling support"); }
+#endif

Adding #ifdefs for each platform/libc implementation like this does not really scale.

What about handling it the same way we handle UCLINUX in the Makefiles?

Have a look at:

ltp/testcases/kernel/syscalls/Makefile
ltp/testcases/kernel/syscalls/writev/Makefile

--
Cyril Hrubis
[email protected]

#4 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

The problem is that an environment variable must be defined to exclude tests for uClibc in Makefiles. And tests must be built by this way (as it done in uClinux):

make UCLIBC=1

Exclusion may be implemented in "testcases/kernel/syscalls/Makefile" like this:

ifeq ($(__UCLIBC__),1)
FILTER_OUT_DIRS += profil
endif

So UCLIBC variable must be set explicitly. Is it a right way?

Regards,
Yuriy Kolerov

Quoted 67 lines

-----Original Message-----
From: Yuriy Kolerov [mailto:[email protected]]
Sent: Wednesday, March 09, 2016 12:29 PM
To: Cyril Hrubis <[email protected]>; Yuriy Kolerov <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [LTP] [PATCH] syscalls/profil01: disable this test for uClibc

Hi Cyril,

Thanks! I've not noticed it earlier. I will make a proper fix. Indeed there are more tests which are excluded for uClibc and uClinux by that ugly way so they must be fixed properly in future too.

Regards,
Yuriy Kolerov

Quoted 38 lines

-----Original Message-----
From: Cyril Hrubis [mailto:[email protected]]
Sent: Monday, March 07, 2016 12:54 PM
To: Yuriy Kolerov <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [LTP] [PATCH] syscalls/profil01: disable this test for uClibc

Hi!

Quoted 15 lines
testcases/kernel/syscalls/profil/profil01.c +2 -0
index 2fc47aa..c44daa7 100644
@@ -39,6 +39,8 @@
 char *TCID = "profil01";
 int TST_TOTAL = 1;
 
+#if !defined(__UCLIBC__)
+
 static volatile sig_atomic_t profil_done;
 
 static void alrm_handler(int sig)

testcases/kernel/syscalls/profil/profil01.c int main(int ac, char *av[]) · line 134

Quoted 9 lines
testcases/kernel/syscalls/profil/profil01.c +6 -0
@@ -124,3 +126,11 @@ int main(int ac, char *av[])
 
 	tst_exit();
 }
+
+#else
+int main(void)
+{
+	tst_brkm(TCONF, NULL, "system doesn't have profiling support"); }
+#endif

Adding #ifdefs for each platform/libc implementation like this does not really scale.

Quoted 1 line

What about handling it the same way we handle UCLINUX in the

Makefiles?

Quoted 9 lines

Have a look at:

ltp/testcases/kernel/syscalls/Makefile
ltp/testcases/kernel/syscalls/writev/Makefile

--
Cyril Hrubis
[email protected]

#5 lore raw

PATCH 1/1 syscalls/profil01: disable this test for uClibc

Hi!

Quoted 5 lines

The problem is that an environment variable must be defined to exclude tests for uClibc in Makefiles. And tests must be built by this way (as it done in uClinux):

make UCLIBC=1

Yes. It's the same for UCLINUX. You have to set UCLINUX=1 (which causes env_post.mk to add -DUCLINUX and -D__UCLIBC__). But it's the UCLINUX variable that is used in the Makefiles.

Quoted 5 lines

Exclusion may be implemented in "testcases/kernel/syscalls/Makefile" like this:

ifeq ($(__UCLIBC__),1)
FILTER_OUT_DIRS += profil
endif

Why the double underscores here? I would rather go for simple $(UCLIBC) hre.

Quoted 1 line

So UCLIBC variable must be set explicitly. Is it a right way?

Yes.

Signature · 2 lines
Cyril Hrubis
[email protected]