Skip mcount overflow and tunables tests on "--disable-tunables"

Message ID 20230307135459.1702324-1-bmahi496@linux.ibm.com
State Superseded
Headers
Series Skip mcount overflow and tunables tests on "--disable-tunables" |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

MAHESH BODAPATI March 7, 2023, 1:54 p.m. UTC
  From: Mahesh Bodapati <mahesh.bodapati@ibm.com>

Add a have_tunables check on the new tests added in recent commit
- "gmon: improve mcount overflow handling [BZ# 27576]"
commit ID  31be941e4367c001b2009308839db5c67bf9dcbc
---
 config.make.in | 1 +
 gmon/Makefile  | 8 ++++++++
 2 files changed, 9 insertions(+)
  

Comments

Adhemerval Zanella March 13, 2023, 5 p.m. UTC | #1
On 07/03/23 10:54, MAHESH BODAPATI via Libc-alpha wrote:
> From: Mahesh Bodapati <mahesh.bodapati@ibm.com>
> 
> Add a have_tunables check on the new tests added in recent commit
> - "gmon: improve mcount overflow handling [BZ# 27576]"
> commit ID  31be941e4367c001b2009308839db5c67bf9dcbc

Patch looks good, you might add the commit id that added the new
tests that requires tunable to be enabled.

> ---
>  config.make.in | 1 +
>  gmon/Makefile  | 8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/config.make.in b/config.make.in
> index d7c416cbea..ab2b7649f1 100644
> --- a/config.make.in
> +++ b/config.make.in
> @@ -65,6 +65,7 @@ have-ssp = @libc_cv_ssp@
>  stack-protector = @stack_protector@
>  no-stack-protector = @no_stack_protector@
>  have-selinux = @have_selinux@
> +have-tunables = @have_tunables@
>  have-libaudit = @have_libaudit@
>  have-libcap = @have_libcap@
>  have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
> diff --git a/gmon/Makefile b/gmon/Makefile
> index 213622a7ad..69119421ca 100644
> --- a/gmon/Makefile
> +++ b/gmon/Makefile
> @@ -26,7 +26,11 @@ include ../Makeconfig
>  headers	:= sys/gmon.h sys/gmon_out.h sys/profil.h
>  routines := gmon mcount profil sprofil prof-freq
>  
> +ifeq ($(have-tunables),yes)
>  tests	= tst-sprofil tst-gmon tst-mcount-overflow tst-mcleanup
> +else
> +tests   = tst-sprofil tst-gmon tst-mcleanup
> +endif

Do not duplicate the entries, rather add the test if have-tunables is set:

tests	= tst-sprofil tst-gmon tst-mcleanup
ifeq ($(have-tunables,yes)
tests  += tst-mcount-overflow
endif

>  ifeq ($(build-profile),yes)
>  tests	+= tst-profile-static
>  tests-static	+= tst-profile-static
> @@ -57,6 +61,7 @@ ifeq ($(run-built-tests),yes)
>  tests-special += $(objpfx)tst-gmon-gprof.out
>  endif
>  
> +ifeq ($(have-tunables),yes)
>  CFLAGS-tst-mcount-overflow.c := -fno-omit-frame-pointer -pg
>  tst-mcount-overflow-no-pie = yes
>  CRT-tst-mcount-overflow := $(csu-objpfx)g$(start-installed-name)
> @@ -68,6 +73,7 @@ tst-mcount-overflow-ARGS := 2>&1 1>/dev/null | cat
>  ifeq ($(run-built-tests),yes)
>  tests-special += $(objpfx)tst-mcount-overflow-check.out
>  endif
> +endif
>  
>  CFLAGS-tst-mcleanup.c := -fno-omit-frame-pointer -pg
>  tst-mcleanup-no-pie = yes
> @@ -124,6 +130,7 @@ $(objpfx)tst-gmon.out: clean-tst-gmon-data
>  clean-tst-gmon-data:
>  	rm -f $(objpfx)tst-gmon.data.*
>  
> +ifeq ($(have-tunables),yes)
>  $(objpfx)tst-mcount-overflow.o: clean-tst-mcount-overflow-data
>  clean-tst-mcount-overflow-data:
>  	rm -f $(objpfx)tst-mcount-overflow.data.*
> @@ -131,6 +138,7 @@ clean-tst-mcount-overflow-data:
>  $(objpfx)tst-mcount-overflow-check.out: tst-mcount-overflow-check.sh $(objpfx)tst-mcount-overflow.out
>  	$(SHELL) $< $(objpfx)tst-mcount-overflow > $@; \
>  	$(evaluate-test)
> +endif
>  
>  $(objpfx)tst-mcleanup.out: clean-tst-mcleanup-data
>  clean-tst-mcleanup-data:

Ok.
  

Patch

diff --git a/config.make.in b/config.make.in
index d7c416cbea..ab2b7649f1 100644
--- a/config.make.in
+++ b/config.make.in
@@ -65,6 +65,7 @@  have-ssp = @libc_cv_ssp@
 stack-protector = @stack_protector@
 no-stack-protector = @no_stack_protector@
 have-selinux = @have_selinux@
+have-tunables = @have_tunables@
 have-libaudit = @have_libaudit@
 have-libcap = @have_libcap@
 have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
diff --git a/gmon/Makefile b/gmon/Makefile
index 213622a7ad..69119421ca 100644
--- a/gmon/Makefile
+++ b/gmon/Makefile
@@ -26,7 +26,11 @@  include ../Makeconfig
 headers	:= sys/gmon.h sys/gmon_out.h sys/profil.h
 routines := gmon mcount profil sprofil prof-freq
 
+ifeq ($(have-tunables),yes)
 tests	= tst-sprofil tst-gmon tst-mcount-overflow tst-mcleanup
+else
+tests   = tst-sprofil tst-gmon tst-mcleanup
+endif
 ifeq ($(build-profile),yes)
 tests	+= tst-profile-static
 tests-static	+= tst-profile-static
@@ -57,6 +61,7 @@  ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)tst-gmon-gprof.out
 endif
 
+ifeq ($(have-tunables),yes)
 CFLAGS-tst-mcount-overflow.c := -fno-omit-frame-pointer -pg
 tst-mcount-overflow-no-pie = yes
 CRT-tst-mcount-overflow := $(csu-objpfx)g$(start-installed-name)
@@ -68,6 +73,7 @@  tst-mcount-overflow-ARGS := 2>&1 1>/dev/null | cat
 ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)tst-mcount-overflow-check.out
 endif
+endif
 
 CFLAGS-tst-mcleanup.c := -fno-omit-frame-pointer -pg
 tst-mcleanup-no-pie = yes
@@ -124,6 +130,7 @@  $(objpfx)tst-gmon.out: clean-tst-gmon-data
 clean-tst-gmon-data:
 	rm -f $(objpfx)tst-gmon.data.*
 
+ifeq ($(have-tunables),yes)
 $(objpfx)tst-mcount-overflow.o: clean-tst-mcount-overflow-data
 clean-tst-mcount-overflow-data:
 	rm -f $(objpfx)tst-mcount-overflow.data.*
@@ -131,6 +138,7 @@  clean-tst-mcount-overflow-data:
 $(objpfx)tst-mcount-overflow-check.out: tst-mcount-overflow-check.sh $(objpfx)tst-mcount-overflow.out
 	$(SHELL) $< $(objpfx)tst-mcount-overflow > $@; \
 	$(evaluate-test)
+endif
 
 $(objpfx)tst-mcleanup.out: clean-tst-mcleanup-data
 clean-tst-mcleanup-data: