Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
@ 2026-08-04 13:28 Cyril Hrubis
  2026-08-04 13:51 ` Andrea Cervesato via ltp
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Cyril Hrubis @ 2026-08-04 13:28 UTC (permalink / raw)
  To: ltp

Properly mask the ttype with TTYPE_MASK() when deciding if TDEBUG
messages should be printed, otherwise any combination of TERRNO etc.
flags is printed regardless the -D flag.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 lib/newlib_tests/tst_res_flags.c | 1 +
 lib/tst_test.c                   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
index cda097070..f4aaa0439 100644
--- a/lib/newlib_tests/tst_res_flags.c
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -22,6 +22,7 @@ static struct tcase {
 	{FLAG(TWARN)},
 	{FLAG(TINFO)},
 	{FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"},
+	{FLAG(TDEBUG | TERRNO), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"},
 };
 
 static void do_cleanup(void)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 5c3607016..9c5f2617f 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -495,7 +495,7 @@ void tst_res_(const char *file, const int lineno, int ttype,
 	 * 3. Debug output is only for test process (context->tdebug == 1).
 	 * 4. Debug output is enabled for both test and lib processes (context->tdebug == 2).
 	 */
-	if (ttype == TDEBUG) {
+	if (TTYPE_RESULT(ttype) == TDEBUG) {
 		if (!context)
 			return;
 
-- 
2.54.0


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

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

* Re: [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
@ 2026-08-04 13:51 ` Andrea Cervesato via ltp
  2026-08-04 14:01 ` Jan Stancek via ltp
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Andrea Cervesato via ltp @ 2026-08-04 13:51 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

* Re: [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
  2026-08-04 13:51 ` Andrea Cervesato via ltp
@ 2026-08-04 14:01 ` Jan Stancek via ltp
  2026-08-04 16:13 ` [LTP] " linuxtestproject.agent
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jan Stancek via ltp @ 2026-08-04 14:01 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

On Tue, Aug 4, 2026 at 3:29 PM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Properly mask the ttype with TTYPE_MASK() when deciding if TDEBUG
> messages should be printed, otherwise any combination of TERRNO etc.
> flags is printed regardless the -D flag.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>

Acked-by: Jan Stancek <jstancek@redhat.com>

> ---
>  lib/newlib_tests/tst_res_flags.c | 1 +
>  lib/tst_test.c                   | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
> index cda097070..f4aaa0439 100644
> --- a/lib/newlib_tests/tst_res_flags.c
> +++ b/lib/newlib_tests/tst_res_flags.c
> @@ -22,6 +22,7 @@ static struct tcase {
>         {FLAG(TWARN)},
>         {FLAG(TINFO)},
>         {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"},
> +       {FLAG(TDEBUG | TERRNO), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"},
>  };
>
>  static void do_cleanup(void)
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 5c3607016..9c5f2617f 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -495,7 +495,7 @@ void tst_res_(const char *file, const int lineno, int ttype,
>          * 3. Debug output is only for test process (context->tdebug == 1).
>          * 4. Debug output is enabled for both test and lib processes (context->tdebug == 2).
>          */
> -       if (ttype == TDEBUG) {
> +       if (TTYPE_RESULT(ttype) == TDEBUG) {
>                 if (!context)
>                         return;
>
> --
> 2.54.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>


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

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

* Re: [LTP] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
  2026-08-04 13:51 ` Andrea Cervesato via ltp
  2026-08-04 14:01 ` Jan Stancek via ltp
@ 2026-08-04 16:13 ` linuxtestproject.agent
  2026-08-05  2:44 ` [LTP] [PATCH] " Li Wang
  2026-08-05 10:09 ` Petr Vorel
  4 siblings, 0 replies; 7+ messages in thread
From: linuxtestproject.agent @ 2026-08-04 16:13 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

On Tue, 4 Aug 2026, Cyril Hrubis wrote:
> lib: tst_res(): Fix TDEBUG | TERRNO

Verdict - Reviewed

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

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

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

* Re: [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
                   ` (2 preceding siblings ...)
  2026-08-04 16:13 ` [LTP] " linuxtestproject.agent
@ 2026-08-05  2:44 ` Li Wang
  2026-08-05 10:09 ` Petr Vorel
  4 siblings, 0 replies; 7+ messages in thread
From: Li Wang @ 2026-08-05  2:44 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Reviewed-by: Li Wang <li.wang@linux.dev>

-- 
Regards,
Li Wang

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

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

* Re: [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
                   ` (3 preceding siblings ...)
  2026-08-05  2:44 ` [LTP] [PATCH] " Li Wang
@ 2026-08-05 10:09 ` Petr Vorel
  2026-08-06  8:34   ` Cyril Hrubis
  4 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2026-08-05 10:09 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> Properly mask the ttype with TTYPE_MASK() when deciding if TDEBUG
> messages should be printed, otherwise any combination of TERRNO etc.
> flags is printed regardless the -D flag.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Fixes: 018f555a44 ("lib: Add support for TDEBUG tst_res() flag")

Thanks for fixing my bug!

Kind regards,
Petr

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

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

* Re: [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO
  2026-08-05 10:09 ` Petr Vorel
@ 2026-08-06  8:34   ` Cyril Hrubis
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2026-08-06  8:34 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
Thanks for the reviews, pushed.

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

end of thread, other threads:[~2026-08-06  8:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 13:28 [LTP] [PATCH] lib: tst_res(): Fix TDEBUG | TERRNO Cyril Hrubis
2026-08-04 13:51 ` Andrea Cervesato via ltp
2026-08-04 14:01 ` Jan Stancek via ltp
2026-08-04 16:13 ` [LTP] " linuxtestproject.agent
2026-08-05  2:44 ` [LTP] [PATCH] " Li Wang
2026-08-05 10:09 ` Petr Vorel
2026-08-06  8:34   ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox