public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag
@ 2023-12-14 15:19 Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 01/10] lib/tests: Add test for testing tst_res() flags Petr Vorel
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

Changes v3->v4:
* Use -D instead of -v. That requires rename options in various tests
* Activate also with TST_ENABLE_DEBUG=1 environment variable
* Add also shell test
* Add 2 shell RFC fixes

Petr Vorel (10):
  lib/tests: Add test for testing tst_res() flags
  tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup
  tst_test.sh/tst_brk(): Allow only TBROK and TCONF
  ioctl02: Rename option -D => -d
  can_filter: Rename option -D => -d
  can_rcv_own_msgs: Rename option -D => -d
  tst_netload(): Rename option -d => -f
  netstress: Rename option -D => -d
  lib: Add support for TDEBUG tst_res() flag
  fsx-linux: Reduce log output with TDEBUG

 doc/C-Test-API.asciidoc                       | 10 +++--
 doc/User-Guidelines.asciidoc                  |  1 +
 include/tst_ansi_color.h                      |  3 ++
 include/tst_common.h                          |  2 +-
 include/tst_res_flags.h                       |  1 +
 include/tst_test.h                            |  5 ++-
 lib/newlib_tests/shell/tst_res_flags.sh       | 24 ++++++++++
 lib/newlib_tests/tst_res_flags.c              | 44 +++++++++++++++++++
 lib/tst_ansi_color.c                          |  3 ++
 lib/tst_res.c                                 |  5 +++
 lib/tst_test.c                                | 19 ++++++++
 runtest/syscalls                              |  2 +-
 testcases/kernel/fs/fsx-linux/fsx-linux.c     | 33 +++++---------
 testcases/kernel/syscalls/ioctl/ioctl02.c     |  2 +-
 testcases/kernel/syscalls/ioctl/test_ioctl    |  2 +-
 testcases/lib/tst_net.sh                      | 12 ++---
 testcases/lib/tst_test.sh                     | 12 ++++-
 testcases/network/busy_poll/busy_poll01.sh    |  2 +-
 testcases/network/busy_poll/busy_poll02.sh    |  2 +-
 testcases/network/busy_poll/busy_poll03.sh    |  2 +-
 .../network/can/filter-tests/can_filter.c     |  2 +-
 .../can/filter-tests/can_rcv_own_msgs.c       |  2 +-
 testcases/network/netstress/netstress.c       |  2 +-
 testcases/network/virt/virt_lib.sh            |  6 +--
 24 files changed, 149 insertions(+), 49 deletions(-)
 create mode 100755 lib/newlib_tests/shell/tst_res_flags.sh
 create mode 100644 lib/newlib_tests/tst_res_flags.c

-- 
2.43.0


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

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

* [LTP] [PATCH v4 01/10] lib/tests: Add test for testing tst_res() flags
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 02/10] tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup Petr Vorel
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/newlib_tests/shell/tst_res_flags.sh | 24 +++++++++++++++
 lib/newlib_tests/tst_res_flags.c        | 41 +++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100755 lib/newlib_tests/shell/tst_res_flags.sh
 create mode 100644 lib/newlib_tests/tst_res_flags.c

diff --git a/lib/newlib_tests/shell/tst_res_flags.sh b/lib/newlib_tests/shell/tst_res_flags.sh
new file mode 100755
index 000000000..bca3d26c0
--- /dev/null
+++ b/lib/newlib_tests/shell/tst_res_flags.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
+
+TST_TESTFUNC=test
+TST_CLEANUP=cleanup
+
+test()
+{
+	tst_res TPASS "TPASS message"
+	tst_res TFAIL "TFAIL message"
+	tst_res TBROK "TBROK message"
+	tst_res TCONF "TCONF message"
+	tst_res TWARN "TWARN message"
+	tst_res TINFO "TINFO message"
+}
+
+cleanup()
+{
+	tst_brk TBROK "TBROK message should be TWARN in cleanup"
+}
+
+. tst_test.sh
+tst_run
diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
new file mode 100644
index 000000000..85eee09a6
--- /dev/null
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
+ */
+
+/*
+ * Test tst_res() flags.
+ */
+
+#include "tst_test.h"
+
+#define FLAG(x) .flag = x, .str = #x
+static struct tcase {
+	int flag;
+	const char *str;
+} tcases[] = {
+	{FLAG(TPASS)},
+	{FLAG(TFAIL)},
+	{FLAG(TBROK)},
+	{FLAG(TCONF)},
+	{FLAG(TWARN)},
+	{FLAG(TINFO)},
+};
+
+static void do_cleanup(void)
+{
+	tst_brk(TBROK, "TBROK message should be TWARN in cleanup");
+}
+
+static void do_test(void)
+{
+	size_t i;
+
+	for (i = 0; i < ARRAY_SIZE(tcases); i++)
+		tst_res(tcases[i].flag, "%s message", tcases[i].str);
+}
+
+static struct tst_test test = {
+	.test_all = do_test,
+	.cleanup = do_cleanup,
+};
-- 
2.43.0


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

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

* [LTP] [PATCH v4 02/10] tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 01/10] lib/tests: Add test for testing tst_res() flags Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 03/10] tst_test.sh/tst_brk(): Allow only TBROK and TCONF Petr Vorel
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

C API specifies (since 6440c5d0d):

    WARNING: Calling tst_brk() in test cleanup() does not exit the test as well
	     and TBROK is converted to TWARN.

But shell API 1) changed *anything* to TWARN 2) do change only in exit.
Unify with C API => change also on cleanup() and convert only TBROK.

Also, TBROK in cleanup() was printed 2x (as TBROK and then as TWARN).
Fixing it requires TST_DO_CLEANUP to be unset *before* running cleanup
function ($TST_CLEANUP).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index b5b38f524..a6a5d82a4 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -28,6 +28,7 @@ _tst_do_cleanup()
 {
 	if [ -n "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" -a -z "$TST_NO_CLEANUP" ]; then
 		if command -v $TST_CLEANUP >/dev/null 2>/dev/null; then
+			TST_DO_CLEANUP=
 			$TST_CLEANUP
 		else
 			tst_res TWARN "TST_CLEANUP=$TST_CLEANUP declared, but function not defined (or cmd not found)"
@@ -126,8 +127,10 @@ tst_brk()
 	local res=$1
 	shift
 
-	if [ "$TST_DO_EXIT" = 1 ]; then
+	# TBROK => TWARN on cleanup or exit
+	if [ "$res" = TBROK ] && [ "$TST_DO_EXIT" = 1 -o -z "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" ]; then
 		tst_res TWARN "$@"
+		TST_DO_CLEANUP=
 		return
 	fi
 
-- 
2.43.0


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

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

* [LTP] [PATCH v4 03/10] tst_test.sh/tst_brk(): Allow only TBROK and TCONF
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 01/10] lib/tests: Add test for testing tst_res() flags Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 02/10] tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d Petr Vorel
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

C API has compilation check TST_BRK_SUPPORTS_ONLY_TCONF_TBROK()
which allows only TBROK and TCONF. Allow only these in shell API as well.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index a6a5d82a4..5f178a1be 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -134,7 +134,12 @@ tst_brk()
 		return
 	fi
 
-	tst_res "$res" "$@"
+	if [ "$res" != TBROK -a "$res" != TCONF ]; then
+		tst_res TBROK "tst_brk can be called only with TBROK or TCONF"
+	else
+		tst_res "$res" "$@"
+	fi
+
 	_tst_do_exit
 }
 
-- 
2.43.0


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

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

* [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (2 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 03/10] tst_test.sh/tst_brk(): Allow only TBROK and TCONF Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-19 11:00   ` Li Wang
  2023-12-14 15:19 ` [LTP] [PATCH v4 05/10] can_filter: " Petr Vorel
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

-D will be used for enabling debug info.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/syscalls                           | 2 +-
 testcases/kernel/syscalls/ioctl/ioctl02.c  | 2 +-
 testcases/kernel/syscalls/ioctl/test_ioctl | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/runtest/syscalls b/runtest/syscalls
index f723320c1..8216d86b0 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -557,7 +557,7 @@ init_module01 init_module01
 init_module02 init_module02
 
 #Needs tty device.
-#ioctl02 ioctl02 -D /dev/tty0
+#ioctl02 ioctl02 -d /dev/tty0
 
 # Introducing ioctl tests for all /dev/tty* devices
 ioctl01      ioctl01
diff --git a/testcases/kernel/syscalls/ioctl/ioctl02.c b/testcases/kernel/syscalls/ioctl/ioctl02.c
index ce0e6bdb8..9fbdd66a9 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
@@ -250,7 +250,7 @@ static struct tst_test test = {
 	.test_all = verify_ioctl,
 	.test_variants = 2,
 	.options = (struct tst_option[]) {
-		{"D:", &device, "Tty device. For example, /dev/tty[0-9]"},
+		{"d:", &device, "Tty device. For example, /dev/tty[0-9]"},
 		{}
 	}
 };
diff --git a/testcases/kernel/syscalls/ioctl/test_ioctl b/testcases/kernel/syscalls/ioctl/test_ioctl
index 43836a229..8549e5608 100755
--- a/testcases/kernel/syscalls/ioctl/test_ioctl
+++ b/testcases/kernel/syscalls/ioctl/test_ioctl
@@ -45,7 +45,7 @@ case "$device_no" in
         continue
     fi
     tst_resm TINFO "Testing ioctl02 with $tttype"
-    ioctl02 -D $tttype
+    ioctl02 -d $tttype
     RC=$?
     if  [ $RC -eq 0 ]
     then
-- 
2.43.0


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

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

* [LTP] [PATCH v4 05/10] can_filter: Rename option -D => -d
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (3 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 06/10] can_rcv_own_msgs: " Petr Vorel
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

-D will be used for enabling debug info.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/can/filter-tests/can_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/can/filter-tests/can_filter.c b/testcases/network/can/filter-tests/can_filter.c
index 19c7fc48d..1ea8ea18f 100644
--- a/testcases/network/can/filter-tests/can_filter.c
+++ b/testcases/network/can/filter-tests/can_filter.c
@@ -172,7 +172,7 @@ static void run(unsigned int n)
 static struct tst_test test = {
 	.tcnt = TC,
 	.options = (struct tst_option[]) {
-		{"D:", &can_dev_name, "CAN device name"},
+		{"d:", &can_dev_name, "CAN device name"},
 		{}
 	},
 	.setup = setup,
-- 
2.43.0


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

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

* [LTP] [PATCH v4 06/10] can_rcv_own_msgs: Rename option -D => -d
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (4 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 05/10] can_filter: " Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 07/10] tst_netload(): Rename option -d => -f Petr Vorel
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

-D will be used for enabling debug info.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/can/filter-tests/can_rcv_own_msgs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/can/filter-tests/can_rcv_own_msgs.c b/testcases/network/can/filter-tests/can_rcv_own_msgs.c
index 6bb2619f4..ba40666dc 100644
--- a/testcases/network/can/filter-tests/can_rcv_own_msgs.c
+++ b/testcases/network/can/filter-tests/can_rcv_own_msgs.c
@@ -134,7 +134,7 @@ static void run(void)
 
 static struct tst_test test = {
 	.options = (struct tst_option[]) {
-		{"D:", &can_dev_name, "CAN device name"},
+		{"d:", &can_dev_name, "CAN device name"},
 		{}
 	},
 	.setup = setup,
-- 
2.43.0


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

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

* [LTP] [PATCH v4 07/10] tst_netload(): Rename option -d => -f
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (5 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 06/10] can_rcv_own_msgs: " Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 08/10] netstress: Rename option -D => -d Petr Vorel
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

-D will be used for enabling debug info, thus netstress.c -D parameter
needs to be renamed to -d.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh                   | 6 +++---
 testcases/network/busy_poll/busy_poll01.sh | 2 +-
 testcases/network/busy_poll/busy_poll02.sh | 2 +-
 testcases/network/busy_poll/busy_poll03.sh | 2 +-
 testcases/network/virt/virt_lib.sh         | 6 +++---
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 6168db86b..0718a8ad1 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -745,12 +745,12 @@ tst_netload()
 	fi
 
 	OPTIND=0
-	while getopts :a:H:d:n:N:r:R:S:b:t:T:fFe:m:A:D: opt; do
+	while getopts :a:f:H:n:N:r:R:S:b:t:T:fFe:m:A:D: opt; do
 		case "$opt" in
 		a) c_num="$OPTARG" ;;
 		H) c_opts="${c_opts}-H $OPTARG "
 		   hostopt="$OPTARG" ;;
-		d) rfile="$OPTARG" ;;
+		f) rfile="$OPTARG" ;;
 		n) c_opts="${c_opts}-n $OPTARG " ;;
 		N) c_opts="${c_opts}-N $OPTARG " ;;
 		r) c_requests="$OPTARG" ;;
@@ -790,7 +790,7 @@ tst_netload()
 	fi
 
 	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
-	c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -d $PWD/$rfile"
+	c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -f $PWD/$rfile"
 
 	tst_res_ TINFO "run server 'netstress $s_opts'"
 	tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times"
diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 65f4db3fe..fa4e57d11 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -39,7 +39,7 @@ test()
 	for x in 50 0; do
 		tst_res TINFO "set low latency busy poll to $x"
 		set_busy_poll $x
-		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x
 	done
 
 	tst_netload_compare $(cat res_0) $(cat res_50) 1
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index ebae4d2f5..363562112 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -31,7 +31,7 @@ test()
 	for x in 50 0; do
 		tst_res TINFO "set low latency busy poll to $x per socket"
 		set_busy_poll $x
-		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x -b $x
 	done
 
 	tst_netload_compare $(cat res_0) $(cat res_50) 1
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index 04d5978f7..4fe958db9 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -33,7 +33,7 @@ test()
 	for x in 50 0; do
 		tst_res TINFO "set low latency busy poll to $x per $2 socket"
 		set_busy_poll $x
-		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x \
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x \
 			    -b $x -T $2
 	done
 
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index e919bc3a5..dd7ac895b 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -284,10 +284,10 @@ virt_compare_netperf()
 	local expect_res="${1:-pass}"
 	local opts="$2"
 
-	tst_netload -H $ip_virt_remote $opts -d res_ipv4 -e $expect_res \
+	tst_netload -H $ip_virt_remote $opts -f res_ipv4 -e $expect_res \
 		-D ltp_v0 || ret1="fail"
 
-	tst_netload -H ${ip6_virt_remote} $opts -d res_ipv6 -e $expect_res \
+	tst_netload -H ${ip6_virt_remote} $opts -f res_ipv6 -e $expect_res \
 		-D ltp_v0 || ret2="fail"
 
 	[ "$ret1" = "fail" -o "$ret2" = "fail" ] && return
@@ -295,7 +295,7 @@ virt_compare_netperf()
 	local vt="$(cat res_ipv4)"
 	local vt6="$(cat res_ipv6)"
 
-	tst_netload -H $(tst_ipaddr rhost) $opts -d res_lan
+	tst_netload -H $(tst_ipaddr rhost) $opts -f res_lan
 
 	local lt="$(cat res_lan)"
 	tst_res TINFO "time lan IPv${TST_IPVER}($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
-- 
2.43.0


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

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

* [LTP] [PATCH v4 08/10] netstress: Rename option -D => -d
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (6 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 07/10] tst_netload(): Rename option -d => -f Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag Petr Vorel
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

-D will be used for enabling debug info.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh                | 6 +++---
 testcases/network/netstress/netstress.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 0718a8ad1..e47ee9676 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -766,7 +766,7 @@ tst_netload()
 		f) cs_opts="${cs_opts}-f " ;;
 		F) cs_opts="${cs_opts}-F " ;;
 		e) expect_res="$OPTARG" ;;
-		D) [ "$TST_NETLOAD_BINDTODEVICE" = 1 ] && cs_opts="${cs_opts}-D $OPTARG "
+		D) [ "$TST_NETLOAD_BINDTODEVICE" = 1 ] && cs_opts="${cs_opts}-d $OPTARG "
 		   bind_to_device=0 ;;
 		*) tst_brk_ TBROK "tst_netload: unknown option: $OPTARG" ;;
 		esac
@@ -776,8 +776,8 @@ tst_netload()
 	[ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt "
 
 	if [ "$bind_to_device" = 1 -a "$TST_NETLOAD_BINDTODEVICE" = 1 ]; then
-		c_opts="${c_opts}-D $(tst_iface) "
-		s_opts="${s_opts}-D $(tst_iface rhost) "
+		c_opts="${c_opts}-d $(tst_iface) "
+		s_opts="${s_opts}-d $(tst_iface rhost) "
 	fi
 
 	local expect_ret=0
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index fb6281cd0..5958150cc 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -1009,7 +1009,7 @@ static struct tst_test test = {
 		{"T:", &type, "Tcp (default), udp, udp_lite, dccp, sctp"},
 		{"z", &zcopy, "Enable SO_ZEROCOPY"},
 		{"P:", &reuse_port, "Enable SO_REUSEPORT"},
-		{"D:", &dev, "Bind to device x"},
+		{"d:", &dev, "Bind to device x"},
 
 		{"H:", &server_addr, "Server name or IP address"},
 		{"l", &client_mode, "Become client, default is server"},
-- 
2.43.0


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

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

* [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (7 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 08/10] netstress: Rename option -D => -d Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2024-01-04 11:36   ` Petr Vorel
  2023-12-14 15:19 ` [LTP] [PATCH v4 10/10] fsx-linux: Reduce log output with TDEBUG Petr Vorel
  2023-12-19 10:58 ` [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Li Wang
  10 siblings, 1 reply; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

To print more verbose info. By default it's off, printing enabled with
-D option or TST_ENABLE_DEBUG=1.

Use unused value 8 (former TRETR).
Assigned color is white.
Legacy API does not support it.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/C-Test-API.asciidoc          | 10 ++++++----
 doc/User-Guidelines.asciidoc     |  1 +
 include/tst_ansi_color.h         |  3 +++
 include/tst_common.h             |  2 +-
 include/tst_res_flags.h          |  1 +
 include/tst_test.h               |  5 +++--
 lib/newlib_tests/tst_res_flags.c |  5 ++++-
 lib/tst_ansi_color.c             |  3 +++
 lib/tst_res.c                    |  5 +++++
 lib/tst_test.c                   | 19 +++++++++++++++++++
 10 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/doc/C-Test-API.asciidoc b/doc/C-Test-API.asciidoc
index dab811564..979ec5ccf 100644
--- a/doc/C-Test-API.asciidoc
+++ b/doc/C-Test-API.asciidoc
@@ -224,10 +224,12 @@ void tst_res(int ttype, char *arg_fmt, ...);
 Printf-like function to report test result, it's mostly used with ttype:
 
 |==============================
-| 'TPASS' | Test has passed.
-| 'TFAIL' | Test has failed.
-| 'TINFO' | General message.
-| 'TWARN' | Something went wrong but we decided to continue. Mostly used in cleanup functions.
+| 'TPASS'  | Test has passed.
+| 'TFAIL'  | Test has failed.
+| 'TINFO'  | General message.
+| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'TST_ENABLE_DEBUG=1' or 'y'
+             environment variable), only for messages which would be too verbose for normal run.
+| 'TWARN'  | Something went wrong but we decided to continue. Mostly used in cleanup functions.
 |==============================
 
 The 'ttype' can be combined bitwise with 'TERRNO' or 'TTERRNO' to print
diff --git a/doc/User-Guidelines.asciidoc b/doc/User-Guidelines.asciidoc
index 8f2418df0..ec6d89b65 100644
--- a/doc/User-Guidelines.asciidoc
+++ b/doc/User-Guidelines.asciidoc
@@ -41,6 +41,7 @@ For running LTP network tests see `testcases/network/README.md`.
                           and others, which imply it, shell: 'TST_NEEDS_TMPDIR=1').
                           Must be an absolute path (default: '/tmp').
 | 'TST_NO_CLEANUP'      | Disable running test cleanup (defined in 'TST_CLEANUP').
+| 'TST_ENABLE_DEBUG'    | Enable debug info (value 'y' or '1').
 |==============================================================================
 
 
diff --git a/include/tst_ansi_color.h b/include/tst_ansi_color.h
index 770bf46d9..376d4ad63 100644
--- a/include/tst_ansi_color.h
+++ b/include/tst_ansi_color.h
@@ -4,14 +4,17 @@
 
 #ifndef TST_ANSI_COLOR_H__
 #define TST_ANSI_COLOR_H__
+
 /*
  * NOTE: these colors should match colors defined in tst_flag2color() in
  * testcases/lib/tst_ansi_color.sh
  */
+
 #define ANSI_COLOR_BLUE		"\033[1;34m"
 #define ANSI_COLOR_GREEN	"\033[1;32m"
 #define ANSI_COLOR_MAGENTA	"\033[1;35m"
 #define ANSI_COLOR_RED		"\033[1;31m"
+#define ANSI_COLOR_WHITE	"\033[1;37m"
 #define ANSI_COLOR_YELLOW	"\033[1;33m"
 
 #define ANSI_COLOR_RESET	"\033[0m"
diff --git a/include/tst_common.h b/include/tst_common.h
index 520cca72c..b14bbae04 100644
--- a/include/tst_common.h
+++ b/include/tst_common.h
@@ -80,7 +80,7 @@
 #define TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition) \
 	TST_BUILD_BUG_ON(condition)
 
-#define TST_RES_SUPPORTS_TCONF_TFAIL_TINFO_TPASS_TWARN(condition) \
+#define TST_RES_SUPPORTS_TCONF_TDEBUG_TFAIL_TINFO_TPASS_TWARN(condition) \
 	TST_BUILD_BUG_ON(condition)
 
 /* stringification */
diff --git a/include/tst_res_flags.h b/include/tst_res_flags.h
index 8eda2f8b8..872352144 100644
--- a/include/tst_res_flags.h
+++ b/include/tst_res_flags.h
@@ -11,6 +11,7 @@
 #define TFAIL	1	/* Test failed flag */
 #define TBROK	2	/* Test broken flag */
 #define TWARN	4	/* Test warning flag */
+#define TDEBUG	8	/* Test debug information flag */
 #define TINFO	16	/* Test information flag */
 #define TCONF	32	/* Test not appropriate for configuration flag */
 #define TTYPE_RESULT(ttype)	((ttype) & TTYPE_MASK)
diff --git a/include/tst_test.h b/include/tst_test.h
index 75c2109b9..0c3171e5b 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -54,8 +54,9 @@ void tst_res_(const char *file, const int lineno, int ttype,
 
 #define tst_res(ttype, arg_fmt, ...) \
 	({									\
-		TST_RES_SUPPORTS_TCONF_TFAIL_TINFO_TPASS_TWARN(!((TTYPE_RESULT(ttype) ?: TCONF) & \
-			(TCONF | TFAIL | TINFO | TPASS | TWARN))); 				\
+		TST_RES_SUPPORTS_TCONF_TDEBUG_TFAIL_TINFO_TPASS_TWARN(\
+			!((TTYPE_RESULT(ttype) ?: TCONF) & \
+			(TCONF | TDEBUG | TFAIL | TINFO | TPASS | TWARN))); 				\
 		tst_res_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
 	})
 
diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
index 85eee09a6..b104808d7 100644
--- a/lib/newlib_tests/tst_res_flags.c
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -13,6 +13,7 @@
 static struct tcase {
 	int flag;
 	const char *str;
+	const char *note;
 } tcases[] = {
 	{FLAG(TPASS)},
 	{FLAG(TFAIL)},
@@ -20,6 +21,7 @@ static struct tcase {
 	{FLAG(TCONF)},
 	{FLAG(TWARN)},
 	{FLAG(TINFO)},
+	{FLAG(TDEBUG), " (printed only with -D or TST_ENABLE_DEBUG=1)"},
 };
 
 static void do_cleanup(void)
@@ -32,7 +34,8 @@ static void do_test(void)
 	size_t i;
 
 	for (i = 0; i < ARRAY_SIZE(tcases); i++)
-		tst_res(tcases[i].flag, "%s message", tcases[i].str);
+		tst_res(tcases[i].flag, "%s message%s", tcases[i].str,
+			tcases[i].note ?: "");
 }
 
 static struct tst_test test = {
diff --git a/lib/tst_ansi_color.c b/lib/tst_ansi_color.c
index 1c29268f2..98041c0af 100644
--- a/lib/tst_ansi_color.c
+++ b/lib/tst_ansi_color.c
@@ -31,6 +31,9 @@ char* tst_ttype2color(int ttype)
 	case TINFO:
 		return ANSI_COLOR_BLUE;
 	break;
+	case TDEBUG:
+		return ANSI_COLOR_WHITE;
+	break;
 	default:
 		return "";
 	}
diff --git a/lib/tst_res.c b/lib/tst_res.c
index e0896eb05..e87918ed1 100644
--- a/lib/tst_res.c
+++ b/lib/tst_res.c
@@ -174,6 +174,11 @@ static void tst_res__(const char *file, const int lineno, int ttype,
 	int len = 0;
 	int ttype_result = TTYPE_RESULT(ttype);
 
+	if (ttype_result == TDEBUG) {
+		printf("%s: %i: TDEBUG is not supported\n", __func__, __LINE__);
+		abort();
+	}
+
 	if (file && (ttype_result != TPASS && ttype_result != TINFO))
 		len = sprintf(tmesg, "%s:%d: ", file, lineno);
 	EXPAND_VAR_ARGS(tmesg + len, arg_fmt, USERMESG - len);
diff --git a/lib/tst_test.c b/lib/tst_test.c
index c2f8f503f..edc17a00b 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -60,6 +60,7 @@ static pid_t main_pid, lib_pid;
 static int mntpoint_mounted;
 static int ovl_mounted;
 static struct timespec tst_start_time; /* valid only for test pid */
+static int tdebug;
 
 struct results {
 	int passed;
@@ -224,6 +225,9 @@ static void print_result(const char *file, const int lineno, int ttype,
 	case TINFO:
 		res = "TINFO";
 	break;
+	case TDEBUG:
+		res = "TDEBUG";
+	break;
 	default:
 		tst_brk(TBROK, "Invalid ttype value %i", ttype);
 		abort();
@@ -352,6 +356,9 @@ void tst_res_(const char *file, const int lineno, int ttype,
 {
 	va_list va;
 
+	if (ttype == TDEBUG && !tdebug)
+		return;
+
 	va_start(va, fmt);
 	tst_vres_(file, lineno, ttype, fmt, va);
 	va_end(va);
@@ -511,6 +518,7 @@ static struct option {
 	{"h",  "-h       Prints this help"},
 	{"i:", "-i n     Execute test n times"},
 	{"I:", "-I x     Execute test for n seconds"},
+	{"D",  "-D       Prints debug information"},
 	{"V",  "-V       Prints LTP version"},
 	{"C:", "-C ARG   Run child process with ARG arguments (used internally)"},
 };
@@ -679,6 +687,10 @@ static void parse_opts(int argc, char *argv[])
 			print_help();
 			tst_brk(TBROK, "Invalid option");
 		break;
+		case 'D':
+			tst_res(TINFO, "Enabling debug info");
+			tdebug = 1;
+		break;
 		case 'h':
 			print_help();
 			print_test_tags();
@@ -1137,6 +1149,8 @@ static void do_cgroup_requires(void)
 
 static void do_setup(int argc, char *argv[])
 {
+	char *tdebug_env = getenv("TST_ENABLE_DEBUG");
+
 	if (!tst_test)
 		tst_brk(TBROK, "No tests to run");
 
@@ -1157,6 +1171,11 @@ static void do_setup(int argc, char *argv[])
 
 	parse_opts(argc, argv);
 
+	if (tdebug_env && (!strcmp(tdebug_env, "y") || !strcmp(tdebug_env, "1"))) {
+		tst_res(TINFO, "Enabling debug info");
+		tdebug = 1;
+	}
+
 	if (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs))
 		tst_brk(TCONF, "Aborting due to unsuitable kernel config, see above!");
 
-- 
2.43.0


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

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

* [LTP] [PATCH v4 10/10] fsx-linux: Reduce log output with TDEBUG
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (8 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag Petr Vorel
@ 2023-12-14 15:19 ` Petr Vorel
  2023-12-19 10:58 ` [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Li Wang
  10 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-14 15:19 UTC (permalink / raw)
  To: ltp

Log output is very verbose thus silent with changing most verbose
TINFO messages to TDEBUG. Given how many times the test tries it's a
significant time spent for printing output. This change also helps to
run on slower SUT without need to set LTP_TIMEOUT_MUL environment
variable.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/fs/fsx-linux/fsx-linux.c | 33 ++++++++---------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/testcases/kernel/fs/fsx-linux/fsx-linux.c b/testcases/kernel/fs/fsx-linux/fsx-linux.c
index 23e608189..658fc99c3 100644
--- a/testcases/kernel/fs/fsx-linux/fsx-linux.c
+++ b/testcases/kernel/fs/fsx-linux/fsx-linux.c
@@ -98,8 +98,7 @@ static void update_file_size(struct file_pos_t const *pos)
 {
 	if (pos->offset + pos->size > file_size) {
 		file_size = pos->offset + pos->size;
-
-		tst_res(TINFO, "File size changed: %llu", file_size);
+		tst_res(TDEBUG, "File size changed: %llu", file_size);
 	}
 }
 
@@ -114,8 +113,7 @@ static int memory_compare(
 	for (long long i = 0; i < size; i++) {
 		diff = a[i] - b[i];
 		if (diff) {
-			tst_res(TINFO,
-				"File memory differs at offset=%llu ('%c' != '%c')",
+			tst_res(TDEBUG, "File memory differs at offset=%llu ('%c' != '%c')",
 				offset + i, a[i], b[i]);
 			break;
 		}
@@ -135,10 +133,8 @@ static int op_read(void)
 
 	op_file_position(file_size, op_read_align, &pos);
 
-	tst_res(TINFO,
-		"Reading at offset=%llu, size=%llu",
-		pos.offset,
-		pos.size);
+	tst_res(TDEBUG, "Reading at offset=%llu, size=%llu",
+		pos.offset, pos.size);
 
 	memset(temp_buff, 0, file_max_size);
 
@@ -176,10 +172,8 @@ static int op_write(void)
 		temp_buff[i] = data;
 	}
 
-	tst_res(TINFO,
-		"Writing at offset=%llu, size=%llu",
-		pos.offset,
-		pos.size);
+	tst_res(TDEBUG, "Writing at offset=%llu, size=%llu",
+		pos.offset, pos.size);
 
 	SAFE_LSEEK(file_desc, (off_t)pos.offset, SEEK_SET);
 	SAFE_WRITE(SAFE_WRITE_ALL, file_desc, temp_buff, pos.size);
@@ -194,10 +188,9 @@ static int op_truncate(void)
 	struct file_pos_t pos;
 
 	op_file_position(file_max_size, op_trunc_align, &pos);
-
 	file_size = pos.offset + pos.size;
 
-	tst_res(TINFO, "Truncating to %llu", file_size);
+	tst_res(TDEBUG, "Truncating to %llu", file_size);
 
 	SAFE_FTRUNCATE(file_desc, file_size);
 	memset(file_buff + file_size, 0, file_max_size - file_size);
@@ -218,10 +211,8 @@ static int op_map_read(void)
 	op_file_position(file_size, op_read_align, &pos);
 	op_align_pages(&pos);
 
-	tst_res(TINFO,
-		"Map reading at offset=%llu, size=%llu",
-		pos.offset,
-		pos.size);
+	tst_res(TDEBUG, "Map reading at offset=%llu, size=%llu",
+		pos.offset, pos.size);
 
 	addr = SAFE_MMAP(
 		0, pos.size,
@@ -261,10 +252,8 @@ static int op_map_write(void)
 	if (file_size < pos.offset + pos.size)
 		SAFE_FTRUNCATE(file_desc, pos.offset + pos.size);
 
-	tst_res(TINFO,
-		"Map writing at offset=%llu, size=%llu",
-		pos.offset,
-		pos.size);
+	tst_res(TDEBUG, "Map writing at offset=%llu, size=%llu",
+		pos.offset, pos.size);
 
 	for (long long i = 0; i < pos.size; i++)
 		file_buff[pos.offset + i] = random() % 10 + 'l';
-- 
2.43.0


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

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

* Re: [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag
  2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
                   ` (9 preceding siblings ...)
  2023-12-14 15:19 ` [LTP] [PATCH v4 10/10] fsx-linux: Reduce log output with TDEBUG Petr Vorel
@ 2023-12-19 10:58 ` Li Wang
  2023-12-19 12:04   ` Petr Vorel
  10 siblings, 1 reply; 17+ messages in thread
From: Li Wang @ 2023-12-19 10:58 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi Petr,

Nice work, thanks!!

Reviewed-by: Li Wang <liwang@redhat.com>


-- 
Regards,
Li Wang

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

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

* Re: [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d
  2023-12-14 15:19 ` [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d Petr Vorel
@ 2023-12-19 11:00   ` Li Wang
  2023-12-19 11:42     ` Petr Vorel
  0 siblings, 1 reply; 17+ messages in thread
From: Li Wang @ 2023-12-19 11:00 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

And, we need to correct the option info for -d.

--- a/testcases/kernel/syscalls/ioctl/ioctl02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
@@ -223,7 +223,7 @@ static void do_child(void)
 static void setup(void)
 {
        if (!device)
-               tst_brk(TBROK, "You must specify a tty device with -D
option");
+               tst_brk(TBROK, "You must specify a tty device with -d
option");

        int fd = SAFE_OPEN(device, O_RDWR, 0777);


-- 
Regards,
Li Wang

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

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

* Re: [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d
  2023-12-19 11:00   ` Li Wang
@ 2023-12-19 11:42     ` Petr Vorel
  0 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-19 11:42 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi Li, all,


> And, we need to correct the option info for -d.

Good catch. It looks this was the only test which mentioned -D.
I'll fix that before merge.

Kind regards,
Petr

> --- a/testcases/kernel/syscalls/ioctl/ioctl02.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
> @@ -223,7 +223,7 @@ static void do_child(void)
>  static void setup(void)
>  {
>         if (!device)
> -               tst_brk(TBROK, "You must specify a tty device with -D
> option");
> +               tst_brk(TBROK, "You must specify a tty device with -d
> option");

>         int fd = SAFE_OPEN(device, O_RDWR, 0777);

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

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

* Re: [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag
  2023-12-19 10:58 ` [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Li Wang
@ 2023-12-19 12:04   ` Petr Vorel
  0 siblings, 0 replies; 17+ messages in thread
From: Petr Vorel @ 2023-12-19 12:04 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi Li,

> Hi Petr,

> Nice work, thanks!!

> Reviewed-by: Li Wang <liwang@redhat.com>

Thanks a lot for your review, merged.

I also added Andrea's ack to the latest commit and Cyril's RBT to the first,
last but one and last commit. Thanks!

Kind regards,
Petr

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

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

* Re: [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag
  2023-12-14 15:19 ` [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag Petr Vorel
@ 2024-01-04 11:36   ` Petr Vorel
  2024-01-04 11:55     ` Li Wang
  0 siblings, 1 reply; 17+ messages in thread
From: Petr Vorel @ 2024-01-04 11:36 UTC (permalink / raw)
  To: ltp

Hi all,

> To print more verbose info. By default it's off, printing enabled with
> -D option or TST_ENABLE_DEBUG=1.

...
> diff --git a/doc/C-Test-API.asciidoc b/doc/C-Test-API.asciidoc
...
> +| 'TINFO'  | General message.
> +| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'TST_ENABLE_DEBUG=1' or 'y'
> +             environment variable), only for messages which would be too verbose for normal run.
...
> +++ b/doc/User-Guidelines.asciidoc
> @@ -41,6 +41,7 @@ For running LTP network tests see `testcases/network/README.md`.
>                            and others, which imply it, shell: 'TST_NEEDS_TMPDIR=1').
>                            Must be an absolute path (default: '/tmp').
>  | 'TST_NO_CLEANUP'      | Disable running test cleanup (defined in 'TST_CLEANUP').
> +| 'TST_ENABLE_DEBUG'    | Enable debug info (value 'y' or '1').

This has been merged. But I now wonder, if this would be better with LTP_
prefix, e.g. LTP_ENABLE_DEBUG, because it's a variable which is defined by LTP
user. WDYT?

This might be also case for TST_NO_CLEANUP, but it's rarely used, thus my
concern is more about LTP_ENABLE_DEBUG.

Kind regards,
Petr

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

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

* Re: [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag
  2024-01-04 11:36   ` Petr Vorel
@ 2024-01-04 11:55     ` Li Wang
  0 siblings, 0 replies; 17+ messages in thread
From: Li Wang @ 2024-01-04 11:55 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

On Thu, Jan 4, 2024 at 7:37 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi all,
>
> > To print more verbose info. By default it's off, printing enabled with
> > -D option or TST_ENABLE_DEBUG=1.
>
> ...
> > diff --git a/doc/C-Test-API.asciidoc b/doc/C-Test-API.asciidoc
> ...
> > +| 'TINFO'  | General message.
> > +| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via
> 'TST_ENABLE_DEBUG=1' or 'y'
> > +             environment variable), only for messages which would be
> too verbose for normal run.
> ...
> > +++ b/doc/User-Guidelines.asciidoc
> > @@ -41,6 +41,7 @@ For running LTP network tests see
> `testcases/network/README.md`.
> >                            and others, which imply it, shell:
> 'TST_NEEDS_TMPDIR=1').
> >                            Must be an absolute path (default: '/tmp').
> >  | 'TST_NO_CLEANUP'      | Disable running test cleanup (defined in
> 'TST_CLEANUP').
> > +| 'TST_ENABLE_DEBUG'    | Enable debug info (value 'y' or '1').
>
> This has been merged. But I now wonder, if this would be better with LTP_
> prefix, e.g. LTP_ENABLE_DEBUG, because it's a variable which is defined by
> LTP
> user. WDYT?
>

+1 for LTP_ENABLE_DEBUG

Good point, as it is designed for the whole LTP test, so the first
level should be more proper. Similary with LTP_RUNTIME_MUL.


> This might be also case for TST_NO_CLEANUP, but it's rarely used, thus my
> concern is more about LTP_ENABLE_DEBUG.
>
> Kind regards,
> Petr
>
>

-- 
Regards,
Li Wang

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

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

end of thread, other threads:[~2024-01-04 11:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14 15:19 [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 01/10] lib/tests: Add test for testing tst_res() flags Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 02/10] tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 03/10] tst_test.sh/tst_brk(): Allow only TBROK and TCONF Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 04/10] ioctl02: Rename option -D => -d Petr Vorel
2023-12-19 11:00   ` Li Wang
2023-12-19 11:42     ` Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 05/10] can_filter: " Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 06/10] can_rcv_own_msgs: " Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 07/10] tst_netload(): Rename option -d => -f Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 08/10] netstress: Rename option -D => -d Petr Vorel
2023-12-14 15:19 ` [LTP] [PATCH v4 09/10] lib: Add support for TDEBUG tst_res() flag Petr Vorel
2024-01-04 11:36   ` Petr Vorel
2024-01-04 11:55     ` Li Wang
2023-12-14 15:19 ` [LTP] [PATCH v4 10/10] fsx-linux: Reduce log output with TDEBUG Petr Vorel
2023-12-19 10:58 ` [LTP] [PATCH v4 00/10] Add TDEBUG tst_res() flag Li Wang
2023-12-19 12:04   ` Petr Vorel

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