All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Proposal for new LTP config knob: LTP_QUIET
@ 2025-09-17  9:07 Martin Cermak via ltp
  2025-09-17 10:37 ` Petr Vorel
  2025-09-22  8:01 ` Cyril Hrubis
  0 siblings, 2 replies; 10+ messages in thread
From: Martin Cermak via ltp @ 2025-09-17  9:07 UTC (permalink / raw)
  To: ltp, valgrind-developers, Mark Wielaard, Martin Cermak, Bird, Tim

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Hi folks,

some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
I'd like to propose a new, related LTP knob for our Valgrind
test automation purposes: LTP_QUIET.  See attached patch.

LTP_QUIET is supposed to suppress certain types of test output
messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
help us keep our test logs briefer, while still keeping the
information we need in the logs.

Please, consider merging upstream.

Thank you,
Martin



[-- Attachment #2: 0001-Introduce-and-use-LTP_QUIET.patch --]
[-- Type: text/plain, Size: 4509 bytes --]

From fb13e461ac76f6843f0fd9cc37ff42b971e8057c Mon Sep 17 00:00:00 2001
From: Martin Cermak <mcermak@redhat.com>
Date: Tue, 16 Sep 2025 16:15:22 +0200
Subject: [PATCH] Introduce and use LTP_QUIET

Introduce LTP_QUIET env variable.  When set to  1 or y, it will
suppress printing TCONF, TWARN, TINFO, and TDEBUG messages, making
valgrind ltp test logs cleaner.  In some cases such as  eventfd2_03,
shmctl05, mlock03, poll02, prctl09, setsockopt10, and select02 this
update avoids false positives.
---
 .../0002-Introduce-LTP_QUIET-env-var.patch    | 73 +++++++++++++++++++
 auxprogs/ltp-tester.sh                        |  7 ++
 2 files changed, 80 insertions(+)
 create mode 100644 auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch

diff --git a/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
new file mode 100644
index 000000000..a77162bfc
--- /dev/null
+++ b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
@@ -0,0 +1,73 @@
+From 183df3240f8e7ca38fbe2fd472c31c9417ae7eb2 Mon Sep 17 00:00:00 2001
+From: Martin Cermak <mcermak@redhat.com>
+Date: Tue, 16 Sep 2025 15:46:40 +0200
+Subject: [PATCH] Introduce LTP_QUIET env var
+
+Introduce LTP_QUIET env variable.  When set to  1 or y, it will
+suppress printing TCONF, TWARN, TINFO, and TDEBUG messages.
+---
+ lib/tst_test.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/lib/tst_test.c b/lib/tst_test.c
+index 92872cc89..609a7b075 100644
+--- a/lib/tst_test.c
++++ b/lib/tst_test.c
+@@ -68,6 +68,7 @@ static int iterations = 1;
+ static float duration = -1;
+ static float timeout_mul = -1;
+ static int reproducible_output;
++static int quiet_output;
+ 
+ struct context {
+ 	int32_t lib_pid;
+@@ -307,15 +308,19 @@ static void print_result(const char *file, const int lineno, int ttype,
+ 		res = "TBROK";
+ 	break;
+ 	case TCONF:
++		if (quiet_output) return;
+ 		res = "TCONF";
+ 	break;
+ 	case TWARN:
++		if (quiet_output) return;
+ 		res = "TWARN";
+ 	break;
+ 	case TINFO:
++		if (quiet_output) return;
+ 		res = "TINFO";
+ 	break;
+ 	case TDEBUG:
++		if (quiet_output) return;
+ 		res = "TDEBUG";
+ 	break;
+ 	default:
+@@ -670,6 +675,7 @@ static void print_help(void)
+ 	fprintf(stderr, "LTP_DEV_FS_TYPE          Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
+ 	fprintf(stderr, "LTP_ENABLE_DEBUG         Print debug messages (set 1 or y)\n");
+ 	fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT  Values 1 or y discard the actual content of the messages printed by the test\n");
++	fprintf(stderr, "LTP_QUIET                Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
+ 	fprintf(stderr, "LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for .all_filesystems)\n");
+ 	fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n");
+ 	fprintf(stderr, "LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1)\n");
+@@ -1361,6 +1367,7 @@ static void do_setup(int argc, char *argv[])
+ {
+ 	char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
+ 	char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
++	char *quiet_env = getenv("LTP_QUIET");
+ 
+ 	if (!tst_test)
+ 		tst_brk(TBROK, "No tests to run");
+@@ -1391,6 +1398,10 @@ static void do_setup(int argc, char *argv[])
+ 	    (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y")))
+ 		reproducible_output = 1;
+ 
++	if (quiet_env &&
++	    (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y")))
++		quiet_output = 1;
++
+ 	assert_test_fn();
+ 
+ 	TCID = tcid = get_tcid(argv);
+-- 
+2.48.1
+
diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh
index ba8fd8be4..a95c603c5 100755
--- a/auxprogs/ltp-tester.sh
+++ b/auxprogs/ltp-tester.sh
@@ -21,6 +21,7 @@ PARALLEL_JOBS=${PARALLEL_JOBS:-$(nproc)}
 # https://lore.kernel.org/ltp/20250505195003.GB137650@pevik/T/#t
 export LTP_COLORIZE_OUTPUT=0
 export LTP_REPRODUCIBLE_OUTPUT=1
+export LTP_QUIET=1
 
 # Initialize LOGDIR for bunsen upload (https://sourceware.org/bunsen/)
 mkdir -p $LOGDIR; rm -rf ${LOGDIR:?}/*
@@ -110,4 +111,10 @@ done
 
 wait
 
+echo -e "\nBrief LTP test results summary"
+echo "-----------------------------------------"
+find $LOGDIR -type f -name '*.trs' -exec grep -F ':test-result:' '{}' ';' |\
+    sort -r | uniq -c | awk '{print $NF": "$1}'
+echo -e "-----------------------------------------\n"
+
 echo "TESTING FINISHED, logs in $LOGDIR"
-- 
2.48.1


[-- Attachment #3: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17  9:07 [LTP] Proposal for new LTP config knob: LTP_QUIET Martin Cermak via ltp
@ 2025-09-17 10:37 ` Petr Vorel
  2025-09-17 11:13   ` Martin Cermak via ltp
  2025-09-17 11:13   ` Andrea Cervesato via ltp
  2025-09-22  8:01 ` Cyril Hrubis
  1 sibling, 2 replies; 10+ messages in thread
From: Petr Vorel @ 2025-09-17 10:37 UTC (permalink / raw)
  To: Martin Cermak; +Cc: valgrind-developers, Mark Wielaard, ltp

Hi Martin,

> Hi folks,

> some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> I'd like to propose a new, related LTP knob for our Valgrind
> test automation purposes: LTP_QUIET.  See attached patch.

> LTP_QUIET is supposed to suppress certain types of test output
> messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> help us keep our test logs briefer, while still keeping the
> information we need in the logs.

> Please, consider merging upstream.

Thanks for contributing this. So the point is to have only the final summary
printed, right? (summary of TCONF/TWARN/TBROK/...).

I'm ok for merging this + to introduce the same for shell API (tst_test.sh),
although you in valgrind don't use it.  And we could even introduce '-q' getopt
(easier for manual debugging).

Do we then want to keep the "reproducible output" part? Or should it quiet
replace it?

@Cyril, if you agree, do we dare to have it before the release?

> Thank you,
> Martin



> From fb13e461ac76f6843f0fd9cc37ff42b971e8057c Mon Sep 17 00:00:00 2001
> From: Martin Cermak <mcermak@redhat.com>
> Date: Tue, 16 Sep 2025 16:15:22 +0200
> Subject: [PATCH] Introduce and use LTP_QUIET

> Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> suppress printing TCONF, TWARN, TINFO, and TDEBUG messages, making
> valgrind ltp test logs cleaner.  In some cases such as  eventfd2_03,
> shmctl05, mlock03, poll02, prctl09, setsockopt10, and select02 this
> update avoids false positives.
> ---
>  .../0002-Introduce-LTP_QUIET-env-var.patch    | 73 +++++++++++++++++++
>  auxprogs/ltp-tester.sh                        |  7 ++
>  2 files changed, 80 insertions(+)
>  create mode 100644 auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch

> diff --git a/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> new file mode 100644
> index 000000000..a77162bfc
> --- /dev/null
> +++ b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> @@ -0,0 +1,73 @@
> +From 183df3240f8e7ca38fbe2fd472c31c9417ae7eb2 Mon Sep 17 00:00:00 2001
> +From: Martin Cermak <mcermak@redhat.com>
> +Date: Tue, 16 Sep 2025 15:46:40 +0200
> +Subject: [PATCH] Introduce LTP_QUIET env var
> +
> +Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> +suppress printing TCONF, TWARN, TINFO, and TDEBUG messages.
> +---
> + lib/tst_test.c | 11 +++++++++++
> + 1 file changed, 11 insertions(+)
> +
> +diff --git a/lib/tst_test.c b/lib/tst_test.c
> +index 92872cc89..609a7b075 100644
> +--- a/lib/tst_test.c
> ++++ b/lib/tst_test.c
> +@@ -68,6 +68,7 @@ static int iterations = 1;
> + static float duration = -1;
> + static float timeout_mul = -1;
> + static int reproducible_output;
> ++static int quiet_output;
> + 
> + struct context {
> + 	int32_t lib_pid;
> +@@ -307,15 +308,19 @@ static void print_result(const char *file, const int lineno, int ttype,
> + 		res = "TBROK";
> + 	break;
> + 	case TCONF:
> ++		if (quiet_output) return;
> + 		res = "TCONF";
> + 	break;
> + 	case TWARN:
> ++		if (quiet_output) return;
> + 		res = "TWARN";
> + 	break;
> + 	case TINFO:
> ++		if (quiet_output) return;
> + 		res = "TINFO";
> + 	break;
> + 	case TDEBUG:
> ++		if (quiet_output) return;
> + 		res = "TDEBUG";
> + 	break;
> + 	default:
> +@@ -670,6 +675,7 @@ static void print_help(void)
> + 	fprintf(stderr, "LTP_DEV_FS_TYPE          Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
> + 	fprintf(stderr, "LTP_ENABLE_DEBUG         Print debug messages (set 1 or y)\n");
> + 	fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT  Values 1 or y discard the actual content of the messages printed by the test\n");
> ++	fprintf(stderr, "LTP_QUIET                Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
> + 	fprintf(stderr, "LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for .all_filesystems)\n");
> + 	fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n");
> + 	fprintf(stderr, "LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1)\n");
> +@@ -1361,6 +1367,7 @@ static void do_setup(int argc, char *argv[])
> + {
> + 	char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
> + 	char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
> ++	char *quiet_env = getenv("LTP_QUIET");
> + 
> + 	if (!tst_test)
> + 		tst_brk(TBROK, "No tests to run");
> +@@ -1391,6 +1398,10 @@ static void do_setup(int argc, char *argv[])
> + 	    (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y")))
> + 		reproducible_output = 1;
> + 
> ++	if (quiet_env &&
> ++	    (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y")))
> ++		quiet_output = 1;
> ++
> + 	assert_test_fn();
> + 
> + 	TCID = tcid = get_tcid(argv);
> +-- 
> +2.48.1
> +
> diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh
> index ba8fd8be4..a95c603c5 100755
> --- a/auxprogs/ltp-tester.sh
> +++ b/auxprogs/ltp-tester.sh

This part is your valgrind runner right? (i.e. not for LTP).

Kind regards,
Petr

> @@ -21,6 +21,7 @@ PARALLEL_JOBS=${PARALLEL_JOBS:-$(nproc)}
>  # https://lore.kernel.org/ltp/20250505195003.GB137650@pevik/T/#t
>  export LTP_COLORIZE_OUTPUT=0
>  export LTP_REPRODUCIBLE_OUTPUT=1
> +export LTP_QUIET=1

>  # Initialize LOGDIR for bunsen upload (https://sourceware.org/bunsen/)
>  mkdir -p $LOGDIR; rm -rf ${LOGDIR:?}/*
> @@ -110,4 +111,10 @@ done

>  wait

> +echo -e "\nBrief LTP test results summary"
> +echo "-----------------------------------------"
> +find $LOGDIR -type f -name '*.trs' -exec grep -F ':test-result:' '{}' ';' |\
> +    sort -r | uniq -c | awk '{print $NF": "$1}'
> +echo -e "-----------------------------------------\n"
> +
>  echo "TESTING FINISHED, logs in $LOGDIR"

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17 10:37 ` Petr Vorel
@ 2025-09-17 11:13   ` Martin Cermak via ltp
  2025-09-17 11:30     ` Petr Vorel
  2025-09-17 11:13   ` Andrea Cervesato via ltp
  1 sibling, 1 reply; 10+ messages in thread
From: Martin Cermak via ltp @ 2025-09-17 11:13 UTC (permalink / raw)
  To: Petr Vorel; +Cc: valgrind-developers, Mark Wielaard, ltp

On  Wed  2025-09-17  12:37 , Petr Vorel wrote:
> Hi Martin,
> 
> > Hi folks,
> 
> > some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> > I'd like to propose a new, related LTP knob for our Valgrind
> > test automation purposes: LTP_QUIET.  See attached patch.
> 
> > LTP_QUIET is supposed to suppress certain types of test output
> > messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> > help us keep our test logs briefer, while still keeping the
> > information we need in the logs.
> 
> > Please, consider merging upstream.
> 
> Thanks for contributing this. So the point is to have only the final summary
> printed, right? (summary of TCONF/TWARN/TBROK/...).
> 
> I'm ok for merging this + to introduce the same for shell API (tst_test.sh),
> although you in valgrind don't use it.  And we could even introduce '-q' getopt
> (easier for manual debugging).
> 
> Do we then want to keep the "reproducible output" part? Or should it quiet
> replace it?

Hi Petr,  you are right that these two knobs (LTP_QUIET and
LTP_REPRODUCIBLE_OUTPUT) partly overlap.  In my proposal, LTP_QUIET
doesn't silence everything.  It does silence TCONF, TWARN, TINFO,
and TDEBUG messages.  But it keeps TPASS, TFAIL, and TBROK.

Suppressing everything except the final summary seemed too
aggressive to me initially.  But as we speak, it would work for
Valgrind testing purposes just fine.

> @Cyril, if you agree, do we dare to have it before the release?



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17 10:37 ` Petr Vorel
  2025-09-17 11:13   ` Martin Cermak via ltp
@ 2025-09-17 11:13   ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 10+ messages in thread
From: Andrea Cervesato via ltp @ 2025-09-17 11:13 UTC (permalink / raw)
  To: Petr Vorel, Martin Cermak; +Cc: valgrind-developers, Mark Wielaard, ltp

Hi!

On 9/17/25 12:37 PM, Petr Vorel wrote:
> LTP_QUIET is supposed to suppress certain types of test output
> messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> help us keep our test logs briefer, while still keeping the
> information we need in the logs.

It totally makes sense to me and I also would like to see this feature 
merged. Thanks for sending the patch.

- Andrea


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17 11:13   ` Martin Cermak via ltp
@ 2025-09-17 11:30     ` Petr Vorel
  2025-09-17 11:36       ` Martin Cermak via ltp
  0 siblings, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2025-09-17 11:30 UTC (permalink / raw)
  To: Martin Cermak; +Cc: valgrind-developers, Mark Wielaard, ltp

> On  Wed  2025-09-17  12:37 , Petr Vorel wrote:
> > Hi Martin,

> > > Hi folks,

> > > some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> > > I'd like to propose a new, related LTP knob for our Valgrind
> > > test automation purposes: LTP_QUIET.  See attached patch.

> > > LTP_QUIET is supposed to suppress certain types of test output
> > > messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> > > help us keep our test logs briefer, while still keeping the
> > > information we need in the logs.

> > > Please, consider merging upstream.

> > Thanks for contributing this. So the point is to have only the final summary
> > printed, right? (summary of TCONF/TWARN/TBROK/...).

> > I'm ok for merging this + to introduce the same for shell API (tst_test.sh),
> > although you in valgrind don't use it.  And we could even introduce '-q' getopt
> > (easier for manual debugging).

> > Do we then want to keep the "reproducible output" part? Or should it quiet
> > replace it?

> Hi Petr,  you are right that these two knobs (LTP_QUIET and
> LTP_REPRODUCIBLE_OUTPUT) partly overlap.  In my proposal, LTP_QUIET
> doesn't silence everything.  It does silence TCONF, TWARN, TINFO,
> and TDEBUG messages.  But it keeps TPASS, TFAIL, and TBROK.

Ah, correct (I was wrong). If there were users who need to separate these (i.e.
using just single of these) I would keep it separate. But IMHO you valgrind
folks are the only ones who use it, therefore feel free to modify it to fix your
needs. OTOH, if you're ok to using 2 variables, I guess we are ok to have both.
Let's see what others think (Andrea already acked).

> Suppressing everything except the final summary seemed too
> aggressive to me initially.  But as we speak, it would work for
> Valgrind testing purposes just fine.

If you compare whole output mismatch in Summary would catch a difference.

OTOH you're right that it's safer to keep at least TFAIL and TBROK.
I'd personally add also TWARN (not that many messages).

Kind regards,
Petr

> > @Cyril, if you agree, do we dare to have it before the release?



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17 11:30     ` Petr Vorel
@ 2025-09-17 11:36       ` Martin Cermak via ltp
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Cermak via ltp @ 2025-09-17 11:36 UTC (permalink / raw)
  To: Petr Vorel; +Cc: valgrind-developers, Mark Wielaard, ltp

On  Wed  2025-09-17  13:30 , Petr Vorel wrote:
> > On  Wed  2025-09-17  12:37 , Petr Vorel wrote:
> > > Hi Martin,
> 
> > > > Hi folks,
> 
> > > > some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> > > > I'd like to propose a new, related LTP knob for our Valgrind
> > > > test automation purposes: LTP_QUIET.  See attached patch.
> 
> > > > LTP_QUIET is supposed to suppress certain types of test output
> > > > messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> > > > help us keep our test logs briefer, while still keeping the
> > > > information we need in the logs.
> 
> > > > Please, consider merging upstream.
> 
> > > Thanks for contributing this. So the point is to have only the final summary
> > > printed, right? (summary of TCONF/TWARN/TBROK/...).
> 
> > > I'm ok for merging this + to introduce the same for shell API (tst_test.sh),
> > > although you in valgrind don't use it.  And we could even introduce '-q' getopt
> > > (easier for manual debugging).
> 
> > > Do we then want to keep the "reproducible output" part? Or should it quiet
> > > replace it?
> 
> > Hi Petr,  you are right that these two knobs (LTP_QUIET and
> > LTP_REPRODUCIBLE_OUTPUT) partly overlap.  In my proposal, LTP_QUIET
> > doesn't silence everything.  It does silence TCONF, TWARN, TINFO,
> > and TDEBUG messages.  But it keeps TPASS, TFAIL, and TBROK.
> 
> Ah, correct (I was wrong). If there were users who need to separate these (i.e.
> using just single of these) I would keep it separate. But IMHO you valgrind
> folks are the only ones who use it, therefore feel free to modify it to fix your
> needs. OTOH, if you're ok to using 2 variables, I guess we are ok to have both.
> Let's see what others think (Andrea already acked).
> 
> > Suppressing everything except the final summary seemed too
> > aggressive to me initially.  But as we speak, it would work for
> > Valgrind testing purposes just fine.
> 
> If you compare whole output mismatch in Summary would catch a difference.
> 
> OTOH you're right that it's safer to keep at least TFAIL and TBROK.
> I'd personally add also TWARN (not that many messages).

Right.  Agreed re TWARN.

> 
> Kind regards,
> Petr
> 
> > > @Cyril, if you agree, do we dare to have it before the release?
> 
> 


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-17  9:07 [LTP] Proposal for new LTP config knob: LTP_QUIET Martin Cermak via ltp
  2025-09-17 10:37 ` Petr Vorel
@ 2025-09-22  8:01 ` Cyril Hrubis
  2025-09-22 11:06   ` Martin Cermak via ltp
  1 sibling, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2025-09-22  8:01 UTC (permalink / raw)
  To: Martin Cermak; +Cc: valgrind-developers, Mark Wielaard, Bird, Tim, ltp

Hi!
> some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> I'd like to propose a new, related LTP knob for our Valgrind
> test automation purposes: LTP_QUIET.  See attached patch.
> 
> LTP_QUIET is supposed to suppress certain types of test output
> messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> help us keep our test logs briefer, while still keeping the
> information we need in the logs.
> 
> Please, consider merging upstream.

Generally looks good, a few minor points below.

> From fb13e461ac76f6843f0fd9cc37ff42b971e8057c Mon Sep 17 00:00:00 2001
> From: Martin Cermak <mcermak@redhat.com>
> Date: Tue, 16 Sep 2025 16:15:22 +0200
> Subject: [PATCH] Introduce and use LTP_QUIET
> 
> Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> suppress printing TCONF, TWARN, TINFO, and TDEBUG messages, making
> valgrind ltp test logs cleaner.  In some cases such as  eventfd2_03,
> shmctl05, mlock03, poll02, prctl09, setsockopt10, and select02 this
> update avoids false positives.
> ---
>  .../0002-Introduce-LTP_QUIET-env-var.patch    | 73 +++++++++++++++++++
>  auxprogs/ltp-tester.sh                        |  7 ++
>  2 files changed, 80 insertions(+)
>  create mode 100644 auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> 
> diff --git a/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> new file mode 100644
> index 000000000..a77162bfc
> --- /dev/null
> +++ b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> @@ -0,0 +1,73 @@
> +From 183df3240f8e7ca38fbe2fd472c31c9417ae7eb2 Mon Sep 17 00:00:00 2001
> +From: Martin Cermak <mcermak@redhat.com>
> +Date: Tue, 16 Sep 2025 15:46:40 +0200
> +Subject: [PATCH] Introduce LTP_QUIET env var
> +
> +Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> +suppress printing TCONF, TWARN, TINFO, and TDEBUG messages.

Can you please send a diff and not diff of a diff so that we don't have
to hand edit it before applying?

> +---
> + lib/tst_test.c | 11 +++++++++++
> + 1 file changed, 11 insertions(+)
> +
> +diff --git a/lib/tst_test.c b/lib/tst_test.c
> +index 92872cc89..609a7b075 100644
> +--- a/lib/tst_test.c
> ++++ b/lib/tst_test.c
> +@@ -68,6 +68,7 @@ static int iterations = 1;
> + static float duration = -1;
> + static float timeout_mul = -1;
> + static int reproducible_output;
> ++static int quiet_output;
> + 
> + struct context {
> + 	int32_t lib_pid;
> +@@ -307,15 +308,19 @@ static void print_result(const char *file, const int lineno, int ttype,
> + 		res = "TBROK";
> + 	break;
> + 	case TCONF:
> ++		if (quiet_output) return;
> + 		res = "TCONF";
> + 	break;
> + 	case TWARN:
> ++		if (quiet_output) return;
> + 		res = "TWARN";
> + 	break;
> + 	case TINFO:
> ++		if (quiet_output) return;
> + 		res = "TINFO";
> + 	break;
> + 	case TDEBUG:
> ++		if (quiet_output) return;

The LKML coding style requires the return to be on a separate line.

> + 		res = "TDEBUG";
> + 	break;
> + 	default:
> +@@ -670,6 +675,7 @@ static void print_help(void)
> + 	fprintf(stderr, "LTP_DEV_FS_TYPE          Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
> + 	fprintf(stderr, "LTP_ENABLE_DEBUG         Print debug messages (set 1 or y)\n");
> + 	fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT  Values 1 or y discard the actual content of the messages printed by the test\n");
> ++	fprintf(stderr, "LTP_QUIET                Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
> + 	fprintf(stderr, "LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for .all_filesystems)\n");
> + 	fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n");
> + 	fprintf(stderr, "LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1)\n");
> +@@ -1361,6 +1367,7 @@ static void do_setup(int argc, char *argv[])
> + {
> + 	char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
> + 	char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
> ++	char *quiet_env = getenv("LTP_QUIET");
> + 
> + 	if (!tst_test)
> + 		tst_brk(TBROK, "No tests to run");
> +@@ -1391,6 +1398,10 @@ static void do_setup(int argc, char *argv[])
> + 	    (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y")))
> + 		reproducible_output = 1;
> + 
> ++	if (quiet_env &&
> ++	    (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y")))
> ++		quiet_output = 1;
> ++
> + 	assert_test_fn();
> + 
> + 	TCID = tcid = get_tcid(argv);
> +-- 
> +2.48.1
> +
> diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh
> index ba8fd8be4..a95c603c5 100755
> --- a/auxprogs/ltp-tester.sh
> +++ b/auxprogs/ltp-tester.sh
> @@ -21,6 +21,7 @@ PARALLEL_JOBS=${PARALLEL_JOBS:-$(nproc)}
>  # https://lore.kernel.org/ltp/20250505195003.GB137650@pevik/T/#t
>  export LTP_COLORIZE_OUTPUT=0
>  export LTP_REPRODUCIBLE_OUTPUT=1
> +export LTP_QUIET=1
>  
>  # Initialize LOGDIR for bunsen upload (https://sourceware.org/bunsen/)
>  mkdir -p $LOGDIR; rm -rf ${LOGDIR:?}/*
> @@ -110,4 +111,10 @@ done
>  
>  wait
>  
> +echo -e "\nBrief LTP test results summary"
> +echo "-----------------------------------------"
> +find $LOGDIR -type f -name '*.trs' -exec grep -F ':test-result:' '{}' ';' |\
> +    sort -r | uniq -c | awk '{print $NF": "$1}'
> +echo -e "-----------------------------------------\n"
> +
>  echo "TESTING FINISHED, logs in $LOGDIR"

This is a part of valgrind, not applicable to LTP...

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-22  8:01 ` Cyril Hrubis
@ 2025-09-22 11:06   ` Martin Cermak via ltp
  2025-09-29 10:46     ` Cyril Hrubis
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Cermak via ltp @ 2025-09-22 11:06 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: valgrind-developers, Mark Wielaard, Bird, Tim, ltp

[-- Attachment #1: Type: text/plain, Size: 5961 bytes --]

Hi Cyril,

I'm attaching updated patch.  Hope it does address your comments.
Please check.

Cheers,
Martin

On  Mon  2025-09-22  10:01 , Cyril Hrubis wrote:
> Hi!
> > some time back, LTP_REPRODUCIBLE_OUTPUT was introduced in LTP.
> > I'd like to propose a new, related LTP knob for our Valgrind
> > test automation purposes: LTP_QUIET.  See attached patch.
> > 
> > LTP_QUIET is supposed to suppress certain types of test output
> > messages, such as: TCONF, TWARN, TINFO, and TDEBUG.  This would
> > help us keep our test logs briefer, while still keeping the
> > information we need in the logs.
> > 
> > Please, consider merging upstream.
> 
> Generally looks good, a few minor points below.
> 
> > From fb13e461ac76f6843f0fd9cc37ff42b971e8057c Mon Sep 17 00:00:00 2001
> > From: Martin Cermak <mcermak@redhat.com>
> > Date: Tue, 16 Sep 2025 16:15:22 +0200
> > Subject: [PATCH] Introduce and use LTP_QUIET
> > 
> > Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> > suppress printing TCONF, TWARN, TINFO, and TDEBUG messages, making
> > valgrind ltp test logs cleaner.  In some cases such as  eventfd2_03,
> > shmctl05, mlock03, poll02, prctl09, setsockopt10, and select02 this
> > update avoids false positives.
> > ---
> >  .../0002-Introduce-LTP_QUIET-env-var.patch    | 73 +++++++++++++++++++
> >  auxprogs/ltp-tester.sh                        |  7 ++
> >  2 files changed, 80 insertions(+)
> >  create mode 100644 auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> > 
> > diff --git a/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> > new file mode 100644
> > index 000000000..a77162bfc
> > --- /dev/null
> > +++ b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch
> > @@ -0,0 +1,73 @@
> > +From 183df3240f8e7ca38fbe2fd472c31c9417ae7eb2 Mon Sep 17 00:00:00 2001
> > +From: Martin Cermak <mcermak@redhat.com>
> > +Date: Tue, 16 Sep 2025 15:46:40 +0200
> > +Subject: [PATCH] Introduce LTP_QUIET env var
> > +
> > +Introduce LTP_QUIET env variable.  When set to  1 or y, it will
> > +suppress printing TCONF, TWARN, TINFO, and TDEBUG messages.
> 
> Can you please send a diff and not diff of a diff so that we don't have
> to hand edit it before applying?
> 
> > +---
> > + lib/tst_test.c | 11 +++++++++++
> > + 1 file changed, 11 insertions(+)
> > +
> > +diff --git a/lib/tst_test.c b/lib/tst_test.c
> > +index 92872cc89..609a7b075 100644
> > +--- a/lib/tst_test.c
> > ++++ b/lib/tst_test.c
> > +@@ -68,6 +68,7 @@ static int iterations = 1;
> > + static float duration = -1;
> > + static float timeout_mul = -1;
> > + static int reproducible_output;
> > ++static int quiet_output;
> > + 
> > + struct context {
> > + 	int32_t lib_pid;
> > +@@ -307,15 +308,19 @@ static void print_result(const char *file, const int lineno, int ttype,
> > + 		res = "TBROK";
> > + 	break;
> > + 	case TCONF:
> > ++		if (quiet_output) return;
> > + 		res = "TCONF";
> > + 	break;
> > + 	case TWARN:
> > ++		if (quiet_output) return;
> > + 		res = "TWARN";
> > + 	break;
> > + 	case TINFO:
> > ++		if (quiet_output) return;
> > + 		res = "TINFO";
> > + 	break;
> > + 	case TDEBUG:
> > ++		if (quiet_output) return;
> 
> The LKML coding style requires the return to be on a separate line.
> 
> > + 		res = "TDEBUG";
> > + 	break;
> > + 	default:
> > +@@ -670,6 +675,7 @@ static void print_help(void)
> > + 	fprintf(stderr, "LTP_DEV_FS_TYPE          Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
> > + 	fprintf(stderr, "LTP_ENABLE_DEBUG         Print debug messages (set 1 or y)\n");
> > + 	fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT  Values 1 or y discard the actual content of the messages printed by the test\n");
> > ++	fprintf(stderr, "LTP_QUIET                Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
> > + 	fprintf(stderr, "LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for .all_filesystems)\n");
> > + 	fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n");
> > + 	fprintf(stderr, "LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1)\n");
> > +@@ -1361,6 +1367,7 @@ static void do_setup(int argc, char *argv[])
> > + {
> > + 	char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
> > + 	char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
> > ++	char *quiet_env = getenv("LTP_QUIET");
> > + 
> > + 	if (!tst_test)
> > + 		tst_brk(TBROK, "No tests to run");
> > +@@ -1391,6 +1398,10 @@ static void do_setup(int argc, char *argv[])
> > + 	    (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y")))
> > + 		reproducible_output = 1;
> > + 
> > ++	if (quiet_env &&
> > ++	    (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y")))
> > ++		quiet_output = 1;
> > ++
> > + 	assert_test_fn();
> > + 
> > + 	TCID = tcid = get_tcid(argv);
> > +-- 
> > +2.48.1
> > +
> > diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh
> > index ba8fd8be4..a95c603c5 100755
> > --- a/auxprogs/ltp-tester.sh
> > +++ b/auxprogs/ltp-tester.sh
> > @@ -21,6 +21,7 @@ PARALLEL_JOBS=${PARALLEL_JOBS:-$(nproc)}
> >  # https://lore.kernel.org/ltp/20250505195003.GB137650@pevik/T/#t
> >  export LTP_COLORIZE_OUTPUT=0
> >  export LTP_REPRODUCIBLE_OUTPUT=1
> > +export LTP_QUIET=1
> >  
> >  # Initialize LOGDIR for bunsen upload (https://sourceware.org/bunsen/)
> >  mkdir -p $LOGDIR; rm -rf ${LOGDIR:?}/*
> > @@ -110,4 +111,10 @@ done
> >  
> >  wait
> >  
> > +echo -e "\nBrief LTP test results summary"
> > +echo "-----------------------------------------"
> > +find $LOGDIR -type f -name '*.trs' -exec grep -F ':test-result:' '{}' ';' |\
> > +    sort -r | uniq -c | awk '{print $NF": "$1}'
> > +echo -e "-----------------------------------------\n"
> > +
> >  echo "TESTING FINISHED, logs in $LOGDIR"
> 
> This is a part of valgrind, not applicable to LTP...
> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz
> 

[-- Attachment #2: 0001-Introduce-LTP_QUIET-env-var.patch --]
[-- Type: text/plain, Size: 2555 bytes --]

From 3b77308f8f71a4dfd10815b35d783aaddbecb149 Mon Sep 17 00:00:00 2001
From: Martin Cermak <mcermak@redhat.com>
Date: Mon, 22 Sep 2025 12:58:13 +0200
Subject: [PATCH] Introduce LTP_QUIET env var

Introduce LTP_QUIET env variable.  When set to  1 or y, it will
suppress printing TCONF, TWARN, TINFO, and TDEBUG messages.
---
 lib/tst_test.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 92872cc89..53b53af1a 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -68,6 +68,7 @@ static int iterations = 1;
 static float duration = -1;
 static float timeout_mul = -1;
 static int reproducible_output;
+static int quiet_output;
 
 struct context {
 	int32_t lib_pid;
@@ -307,15 +308,21 @@ static void print_result(const char *file, const int lineno, int ttype,
 		res = "TBROK";
 	break;
 	case TCONF:
+		if (quiet_output)
+			return;
 		res = "TCONF";
 	break;
 	case TWARN:
 		res = "TWARN";
 	break;
 	case TINFO:
+		if (quiet_output)
+			return;
 		res = "TINFO";
 	break;
 	case TDEBUG:
+		if (quiet_output)
+			return;
 		res = "TDEBUG";
 	break;
 	default:
@@ -670,6 +677,7 @@ static void print_help(void)
 	fprintf(stderr, "LTP_DEV_FS_TYPE          Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
 	fprintf(stderr, "LTP_ENABLE_DEBUG         Print debug messages (set 1 or y)\n");
 	fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT  Values 1 or y discard the actual content of the messages printed by the test\n");
+	fprintf(stderr, "LTP_QUIET                Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
 	fprintf(stderr, "LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for .all_filesystems)\n");
 	fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n");
 	fprintf(stderr, "LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1)\n");
@@ -1361,6 +1369,7 @@ static void do_setup(int argc, char *argv[])
 {
 	char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
 	char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
+	char *quiet_env = getenv("LTP_QUIET");
 
 	if (!tst_test)
 		tst_brk(TBROK, "No tests to run");
@@ -1391,6 +1400,10 @@ static void do_setup(int argc, char *argv[])
 	    (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y")))
 		reproducible_output = 1;
 
+	if (quiet_env &&
+	    (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y")))
+		quiet_output = 1;
+
 	assert_test_fn();
 
 	TCID = tcid = get_tcid(argv);
-- 
2.48.1


[-- Attachment #3: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-22 11:06   ` Martin Cermak via ltp
@ 2025-09-29 10:46     ` Cyril Hrubis
  2025-09-29 10:52       ` Martin Cermak via ltp
  0 siblings, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2025-09-29 10:46 UTC (permalink / raw)
  To: Martin Cermak; +Cc: valgrind-developers, Mark Wielaard, Bird, Tim, ltp

Hi!
> I'm attaching updated patch.  Hope it does address your comments.
> Please check.

I dared to add your Signed-off-by: (I hope you do not mind) and merged,
thanks.

Ah, and also removed the TWARN from the patch description since we does
not skip TWARN in this patch revision.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] Proposal for new LTP config knob: LTP_QUIET
  2025-09-29 10:46     ` Cyril Hrubis
@ 2025-09-29 10:52       ` Martin Cermak via ltp
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Cermak via ltp @ 2025-09-29 10:52 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: valgrind-developers, Mark Wielaard, Bird, Tim, ltp

Thank-you Cyril.  Looks perfect.

Martin

On  Mon  2025-09-29  12:46 , Cyril Hrubis wrote:
> Hi!
> > I'm attaching updated patch.  Hope it does address your comments.
> > Please check.
> 
> I dared to add your Signed-off-by: (I hope you do not mind) and merged,
> thanks.
> 
> Ah, and also removed the TWARN from the patch description since we does
> not skip TWARN in this patch revision.
> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz
> 


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-29 10:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17  9:07 [LTP] Proposal for new LTP config knob: LTP_QUIET Martin Cermak via ltp
2025-09-17 10:37 ` Petr Vorel
2025-09-17 11:13   ` Martin Cermak via ltp
2025-09-17 11:30     ` Petr Vorel
2025-09-17 11:36       ` Martin Cermak via ltp
2025-09-17 11:13   ` Andrea Cervesato via ltp
2025-09-22  8:01 ` Cyril Hrubis
2025-09-22 11:06   ` Martin Cermak via ltp
2025-09-29 10:46     ` Cyril Hrubis
2025-09-29 10:52       ` Martin Cermak via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.