* [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup
@ 2026-04-22 14:12 Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
Changes v3->v4:
* New commit "lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT"
(I wanted to add it before Valgrind release, but too late.)
* Fix typo: "overwriten" -> "overwritten". Also missing closing ')' (Andrea)
* Remove double space before "support" (Andrea)
@Cyril: I know this has very little priority but could it get into
upcoming release?
Link to v4:
https://lore.kernel.org/ltp/20260327173252.1112192-1-pvorel@suse.cz/#r
https://patchwork.ozlabs.org/project/ltp/list/?series=497808&state=*
Petr Vorel (5):
lib: Ignore empty LTP_ENABLE_DEBUG
lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG
lib: Prefer LTP_DEBUG over -D
doc: newlib_tests: Update debugging parameters
lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
doc/developers/debugging.rst | 6 ++--
doc/old/C-Test-API.asciidoc | 4 +--
doc/users/setup_tests.rst | 4 +--
lib/newlib_tests/tst_res_flags.c | 2 +-
lib/tst_test.c | 49 +++++++++++++-------------------
5 files changed, 29 insertions(+), 36 deletions(-)
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
@ 2026-04-22 14:12 ` Petr Vorel
2026-04-22 15:18 ` [LTP] " linuxtestproject.agent
2026-04-22 14:12 ` [LTP] [PATCH v4 2/5] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG Petr Vorel
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
Empty LTP_ENABLE_DEBUG environment variable should be just ignored.
This fixes warning:
LTP_ENABLE_DEBUG= ./test05
tst_test.c:1454: TWARN: Invalid LTP_ENABLE_DEBUG value:
Fixes: e434de62b4 ("lib: Extend LTP_ENABLE_DEBUG to support verbosity levels")
Reviewed-by: Li Wang <liwang@redhat.com>
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
lib/tst_test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 26f6510a0a..229da669fa 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1445,13 +1445,13 @@ static void do_setup(int argc, char *argv[])
parse_opts(argc, argv);
- if (tdebug_env && !context->tdebug) {
+ if (tdebug_env && *tdebug_env && !context->tdebug) {
if (!strcmp(tdebug_env, "2"))
context->tdebug = 2;
else if (!strcmp(tdebug_env, "1") || !strcmp(tdebug_env, "y"))
context->tdebug = 1;
else
- tst_res(TWARN, "Invalid LTP_ENABLE_DEBUG value: %s", tdebug_env);
+ tst_res(TWARN, "Invalid LTP_ENABLE_DEBUG value: '%s'", tdebug_env);
if (context->tdebug)
tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [LTP] [PATCH v4 2/5] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
@ 2026-04-22 14:12 ` Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D Petr Vorel
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
1) LTP_DEBUG is shorter to write.
2) Enable is usually meant as boolean (on/off), that hides possible 2
value even more.
Reviewed-by: Li Wang <liwang@redhat.com>
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
doc/developers/debugging.rst | 2 +-
doc/old/C-Test-API.asciidoc | 2 +-
doc/users/setup_tests.rst | 2 +-
lib/newlib_tests/tst_res_flags.c | 2 +-
lib/tst_test.c | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst
index 52f881c5c8..36dda0d90f 100644
--- a/doc/developers/debugging.rst
+++ b/doc/developers/debugging.rst
@@ -9,7 +9,7 @@ Debug messages
--------------
The LTP framework supports ``TDEBUG`` flag test debug messages. These
-messages can be enabled using the ``-D[1,2]`` parameter or setting ``LTP_ENABLE_DEBUG=1,2``
+messages can be enabled using the ``-D[1,2]`` parameter or setting ``LTP_DEBUG=1,2``
environment variable (see :doc:`../users/setup_tests`).
The ``-D`` parameter also supports the following verbosity levels:
diff --git a/doc/old/C-Test-API.asciidoc b/doc/old/C-Test-API.asciidoc
index 44cc4e863b..7c5ad923dd 100644
--- a/doc/old/C-Test-API.asciidoc
+++ b/doc/old/C-Test-API.asciidoc
@@ -232,7 +232,7 @@ Printf-like function to report test result, it's mostly used with ttype:
| 'TPASS' | Test has passed.
| 'TFAIL' | Test has failed.
| 'TINFO' | General message.
-| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_ENABLE_DEBUG=1' or 'y'
+| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_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.
|==============================
diff --git a/doc/users/setup_tests.rst b/doc/users/setup_tests.rst
index 95d4d9e380..a42c397feb 100644
--- a/doc/users/setup_tests.rst
+++ b/doc/users/setup_tests.rst
@@ -90,7 +90,7 @@ users.
- Disable running test cleanup (defined in ``TST_CLEANUP``).
Shell API only.
- * - LTP_ENABLE_DEBUG
+ * - LTP_DEBUG
- Enable debug info (value ``1`` (``y``) or ``2`` for more verbose level).
Equivalent of ``-D`` parameter.
diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
index 21637a472b..9993d0f87d 100644
--- a/lib/newlib_tests/tst_res_flags.c
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -21,7 +21,7 @@ static struct tcase {
{FLAG(TCONF)},
{FLAG(TWARN)},
{FLAG(TINFO)},
- {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_ENABLE_DEBUG=1,2)"},
+ {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1,2)"},
};
static void do_cleanup(void)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 229da669fa..c79cabcd7a 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -675,7 +675,7 @@ static void print_help(void)
fprintf(stderr, "LTP_COLORIZE_OUTPUT Force colorized output behaviour (y/1 always, n/0: never)\n");
fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n");
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(y) or 2)\n");
+ fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\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");
@@ -1400,7 +1400,7 @@ bool tst_cmd_present(const char *cmd)
static void do_setup(int argc, char *argv[])
{
- char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
+ char *tdebug_env = getenv("LTP_DEBUG");
char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
char *quiet_env = getenv("LTP_QUIET");
@@ -1451,7 +1451,7 @@ static void do_setup(int argc, char *argv[])
else if (!strcmp(tdebug_env, "1") || !strcmp(tdebug_env, "y"))
context->tdebug = 1;
else
- tst_res(TWARN, "Invalid LTP_ENABLE_DEBUG value: '%s'", tdebug_env);
+ tst_res(TWARN, "Invalid LTP_DEBUG value: '%s'", tdebug_env);
if (context->tdebug)
tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 2/5] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG Petr Vorel
@ 2026-04-22 14:12 ` Petr Vorel
2026-04-23 6:43 ` Li Wang
2026-04-22 14:12 ` [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT Petr Vorel
4 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
Environment variable has usually higher preference than getopt.
This includes disabling debugging even on -D:
LTP_DEBUG= ./test05 -D2 means debugging disabled.
Also reduce duplicity of "Enabling debug info (level %d)" message and
document that on -h and developers/debugging.rst.
Fixes: e434de62b4 ("lib: Extend LTP_ENABLE_DEBUG to support verbosity levels")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v3->v4:
* Fix typo: "overwriten" -> "overwritten". Also missing closing ')' (Andrea)
doc/developers/debugging.rst | 2 ++
lib/tst_test.c | 25 +++++++++++--------------
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst
index 36dda0d90f..4e162068b4 100644
--- a/doc/developers/debugging.rst
+++ b/doc/developers/debugging.rst
@@ -19,6 +19,8 @@ The ``-D`` parameter also supports the following verbosity levels:
Suppress all debug logs if no '-D' flag passed (default behavior).
+``LTP_DEBUG`` has higher preference than ``-D``.
+
Tracing and debugging syscalls
------------------------------
diff --git a/lib/tst_test.c b/lib/tst_test.c
index c79cabcd7a..12f7489d4e 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -654,11 +654,11 @@ static struct option {
char *optstr;
char *help;
} options[] = {
- {"h", "-h Prints this help"},
- {"i:", "-i n Execute test n times"},
- {"I:", "-I x Execute test for n seconds"},
- {"D::", "-D[1,2] Prints debug information"},
- {"V", "-V Prints LTP version"},
+ {"h", "-h Prints this help"},
+ {"i:", "-i n Execute test n times"},
+ {"I:", "-I x Execute test for n seconds"},
+ {"D::", "-D[1,2] Prints debug information (can be overwritten by LTP_DEBUG)"},
+ {"V", "-V Prints LTP version"},
};
static void print_help(void)
@@ -825,13 +825,9 @@ static void parse_opts(int argc, char *argv[])
tst_brk(TBROK, "Invalid option");
break;
case 'D':
- if (optarg)
- context->tdebug = SAFE_STRTOL(optarg, 1, 2);
- else
- context->tdebug = 1;
-
- if (context->tdebug)
- tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
+ if (getenv("LTP_DEBUG"))
+ break;
+ context->tdebug = optarg ? SAFE_STRTOL(optarg, 1, 2) : 1;
break;
case 'h':
print_help();
@@ -1453,10 +1449,11 @@ static void do_setup(int argc, char *argv[])
else
tst_res(TWARN, "Invalid LTP_DEBUG value: '%s'", tdebug_env);
- if (context->tdebug)
- tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
}
+ if (context->tdebug)
+ tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
+
if (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs))
tst_brk(TCONF, "Aborting due to unsuitable kernel config, see above!");
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
` (2 preceding siblings ...)
2026-04-22 14:12 ` [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D Petr Vorel
@ 2026-04-22 14:12 ` Petr Vorel
2026-04-23 6:45 ` Li Wang
2026-04-22 14:12 ` [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT Petr Vorel
4 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
* Improve wording in doc/developers/debugging.rst. Not mention 'y'
(enough for user is to know 1 and 2 + 'y' is mentioned at -h).
* Mention all -D and LTP_DEBUG parameters in library test.
* Keep info about the levels in developers/debugging.rst, link page in
user/setup_tests.
* Remove values from old doc (we have enough places to sync on changes,
let's drop the old doc).
Follow-up: b415265cb3 ("doc/setup_tests: Document LTP_ENABLE_DEBUG=2")
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v3->v4:
* Remove double space before "support" (Andrea)
doc/developers/debugging.rst | 4 ++--
doc/old/C-Test-API.asciidoc | 4 ++--
doc/users/setup_tests.rst | 2 +-
lib/newlib_tests/tst_res_flags.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst
index 4e162068b4..6062fdece0 100644
--- a/doc/developers/debugging.rst
+++ b/doc/developers/debugging.rst
@@ -9,10 +9,10 @@ Debug messages
--------------
The LTP framework supports ``TDEBUG`` flag test debug messages. These
-messages can be enabled using the ``-D[1,2]`` parameter or setting ``LTP_DEBUG=1,2``
+messages can be enabled using the ``-D`` parameter or setting ``LTP_DEBUG``
environment variable (see :doc:`../users/setup_tests`).
-The ``-D`` parameter also supports the following verbosity levels:
+Both ``-D`` parameter and ``LTP_DEBUG`` support the following verbosity levels:
``-D1`` (or ``-D``): Enable debug logs for the test process only.
``-D2``: Enable verbose debug logs for both the test and library processes.
diff --git a/doc/old/C-Test-API.asciidoc b/doc/old/C-Test-API.asciidoc
index 7c5ad923dd..38dae98663 100644
--- a/doc/old/C-Test-API.asciidoc
+++ b/doc/old/C-Test-API.asciidoc
@@ -232,8 +232,8 @@ Printf-like function to report test result, it's mostly used with ttype:
| 'TPASS' | Test has passed.
| 'TFAIL' | Test has failed.
| 'TINFO' | General message.
-| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_DEBUG=1' or 'y'
- environment variable), only for messages which would be too verbose for normal run.
+| 'TDEBUG' | Debug message (new C API only, enabled via '-D' or 'LTP_DEBUG' 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.
|==============================
diff --git a/doc/users/setup_tests.rst b/doc/users/setup_tests.rst
index a42c397feb..6f1d996e18 100644
--- a/doc/users/setup_tests.rst
+++ b/doc/users/setup_tests.rst
@@ -92,7 +92,7 @@ users.
* - LTP_DEBUG
- Enable debug info (value ``1`` (``y``) or ``2`` for more verbose level).
- Equivalent of ``-D`` parameter.
+ Equivalent of the ``-D`` parameter (see :doc:`../developers/debugging`).
Test specific environment variables
-----------------------------------
diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
index 9993d0f87d..cda0970702 100644
--- a/lib/newlib_tests/tst_res_flags.c
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -21,7 +21,7 @@ static struct tcase {
{FLAG(TCONF)},
{FLAG(TWARN)},
{FLAG(TINFO)},
- {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1,2)"},
+ {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"},
};
static void do_cleanup(void)
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
` (3 preceding siblings ...)
2026-04-22 14:12 ` [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters Petr Vorel
@ 2026-04-22 14:12 ` Petr Vorel
2026-04-23 7:09 ` Li Wang
4 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2026-04-22 14:12 UTC (permalink / raw)
To: ltp; +Cc: Martin Cermak
LTP_REPRODUCIBLE_OUTPUT=1 environment variable was added in 5894abc5f to
help valgrind to use LTP for testing. It discards the actual content of
the messages printed by the test (removes everything after printing
TINFO/TPASS/TFAIL/... flag).
Later LTP_QUIET=1 was added which suppresses printing TCONF, TWARN,
TINFO, and TDEBUG messages.
Valgrind project uses both variables but no need to handle them
separately. Therefore merge functionality of LTP_QUIET into
LTP_REPRODUCIBLE_OUTPUT.
LTP_QUIET was not even documented in HTML doc (no need to update docs).
Implements: https://github.com/linux-test-project/ltp/issues/1306
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v4.
lib/tst_test.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 12f7489d4e..51d64e8414 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -68,7 +68,6 @@ 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,7 +306,7 @@ static void print_result(const char *file, const int lineno, int ttype,
res = "TBROK";
break;
case TCONF:
- if (quiet_output)
+ if (reproducible_output)
return;
res = "TCONF";
break;
@@ -315,12 +314,12 @@ static void print_result(const char *file, const int lineno, int ttype,
res = "TWARN";
break;
case TINFO:
- if (quiet_output)
+ if (reproducible_output)
return;
res = "TINFO";
break;
case TDEBUG:
- if (quiet_output)
+ if (reproducible_output)
return;
res = "TDEBUG";
break;
@@ -676,8 +675,8 @@ static void print_help(void)
fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n");
fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\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_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TCONF, TWARN, TINFO, and TDEBUG messages and");
+ fprintf(stderr, " discards the actual content of all other messages");
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");
@@ -1398,7 +1397,6 @@ static void do_setup(int argc, char *argv[])
{
char *tdebug_env = getenv("LTP_DEBUG");
char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
- char *quiet_env = getenv("LTP_QUIET");
if (!tst_test)
tst_brk(TBROK, "No tests to run");
@@ -1429,10 +1427,6 @@ 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.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [LTP] lib: Ignore empty LTP_ENABLE_DEBUG
2026-04-22 14:12 ` [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
@ 2026-04-22 15:18 ` linuxtestproject.agent
0 siblings, 0 replies; 11+ messages in thread
From: linuxtestproject.agent @ 2026-04-22 15:18 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi Petr,
--- [PATCH 5/5] ---
On Wed, 22 Apr 2026 16:12:34 +0200, Petr Vorel wrote:
> lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
> + fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TCONF, TWARN, TINFO, and TDEBUG messages and");
> + fprintf(stderr, " discards the actual content of all other messages");
Both lines are missing a trailing '\n'; the next help entry will run
onto the same line in the output.
> + if (reproducible_output)
> + return;
> + res = "TCONF";
[...]
> + if (reproducible_output)
> + return;
> + res = "TINFO";
[...]
> + if (reproducible_output)
> + return;
> + res = "TDEBUG";
The help text claims TWARN is also suppressed, but there is no
corresponding guard for case TWARN in print_result(). Either add
the guard or remove TWARN from the help string.
---
Note:
Our agent completed the review of the patch. The full review can be
found at: https://patchwork.ozlabs.org/project/ltp/list/?series=501017
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] 11+ messages in thread
* Re: [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D
2026-04-22 14:12 ` [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D Petr Vorel
@ 2026-04-23 6:43 ` Li Wang
0 siblings, 0 replies; 11+ messages in thread
From: Li Wang @ 2026-04-23 6:43 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, Martin Cermak
Petr Vorel <pvorel@suse.cz> wrote:
> Environment variable has usually higher preference than getopt.
> This includes disabling debugging even on -D:
> LTP_DEBUG= ./test05 -D2 means debugging disabled.
>
> Also reduce duplicity of "Enabling debug info (level %d)" message and
> document that on -h and developers/debugging.rst.
>
> Fixes: e434de62b4 ("lib: Extend LTP_ENABLE_DEBUG to support verbosity levels")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <wangli.ahau@gmail.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters
2026-04-22 14:12 ` [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters Petr Vorel
@ 2026-04-23 6:45 ` Li Wang
0 siblings, 0 replies; 11+ messages in thread
From: Li Wang @ 2026-04-23 6:45 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, Martin Cermak
Petr Vorel <pvorel@suse.cz> wrote:
> * Improve wording in doc/developers/debugging.rst. Not mention 'y'
> (enough for user is to know 1 and 2 + 'y' is mentioned at -h).
> * Mention all -D and LTP_DEBUG parameters in library test.
> * Keep info about the levels in developers/debugging.rst, link page in
> user/setup_tests.
> * Remove values from old doc (we have enough places to sync on changes,
> let's drop the old doc).
>
> Follow-up: b415265cb3 ("doc/setup_tests: Document LTP_ENABLE_DEBUG=2")
> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <wangli.ahau@gmail.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
2026-04-22 14:12 ` [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT Petr Vorel
@ 2026-04-23 7:09 ` Li Wang
2026-04-23 8:15 ` Petr Vorel
0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2026-04-23 7:09 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, Martin Cermak
Hi Petr,
Petr Vorel <pvorel@suse.cz> wrote:
> LTP_REPRODUCIBLE_OUTPUT=1 environment variable was added in 5894abc5f to
> help valgrind to use LTP for testing. It discards the actual content of
> the messages printed by the test (removes everything after printing
> TINFO/TPASS/TFAIL/... flag).
>
> Later LTP_QUIET=1 was added which suppresses printing TCONF, TWARN,
> TINFO, and TDEBUG messages.
In this patch, I didn't find that it suppresses TWARN messages.
Should we add it as well?
> Valgrind project uses both variables but no need to handle them
> separately. Therefore merge functionality of LTP_QUIET into
> LTP_REPRODUCIBLE_OUTPUT.
>
> LTP_QUIET was not even documented in HTML doc (no need to update docs).
>
> Implements: https://github.com/linux-test-project/ltp/issues/1306
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> New in v4.
>
> lib/tst_test.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 12f7489d4e..51d64e8414 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -68,7 +68,6 @@ 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,7 +306,7 @@ static void print_result(const char *file, const int lineno, int ttype,
> res = "TBROK";
> break;
> case TCONF:
> - if (quiet_output)
> + if (reproducible_output)
> return;
> res = "TCONF";
> break;
> @@ -315,12 +314,12 @@ static void print_result(const char *file, const int lineno, int ttype,
> res = "TWARN";
> break;
> case TINFO:
> - if (quiet_output)
> + if (reproducible_output)
> return;
> res = "TINFO";
> break;
> case TDEBUG:
> - if (quiet_output)
> + if (reproducible_output)
> return;
> res = "TDEBUG";
> break;
> @@ -676,8 +675,8 @@ static void print_help(void)
> fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n");
> fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
> fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\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_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TCONF, TWARN, TINFO, and TDEBUG messages and");
> + fprintf(stderr, " discards the actual content of all other messages");
I guess this two-line format is a bit strange when printing.
Maybe we need to combine into a single fprintf()?
> 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");
> @@ -1398,7 +1397,6 @@ static void do_setup(int argc, char *argv[])
> {
> char *tdebug_env = getenv("LTP_DEBUG");
> char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
> - char *quiet_env = getenv("LTP_QUIET");
>
> if (!tst_test)
> tst_brk(TBROK, "No tests to run");
> @@ -1429,10 +1427,6 @@ 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.53.0
>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
2026-04-23 7:09 ` Li Wang
@ 2026-04-23 8:15 ` Petr Vorel
0 siblings, 0 replies; 11+ messages in thread
From: Petr Vorel @ 2026-04-23 8:15 UTC (permalink / raw)
To: Li Wang; +Cc: ltp, Martin Cermak
Hi Li,
> Hi Petr,
> Petr Vorel <pvorel@suse.cz> wrote:
> > LTP_REPRODUCIBLE_OUTPUT=1 environment variable was added in 5894abc5f to
> > help valgrind to use LTP for testing. It discards the actual content of
> > the messages printed by the test (removes everything after printing
> > TINFO/TPASS/TFAIL/... flag).
> > Later LTP_QUIET=1 was added which suppresses printing TCONF, TWARN,
> > TINFO, and TDEBUG messages.
> In this patch, I didn't find that it suppresses TWARN messages.
> Should we add it as well?
Thanks to catch this! I'd keep it, it can have valuable info.
> > Valgrind project uses both variables but no need to handle them
> > separately. Therefore merge functionality of LTP_QUIET into
> > LTP_REPRODUCIBLE_OUTPUT.
...
> > +++ b/lib/tst_test.c
> > break;
...
> > @@ -676,8 +675,8 @@ static void print_help(void)
> > fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n");
> > fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
> > fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\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_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TCONF, TWARN, TINFO, and TDEBUG messages and");
> > + fprintf(stderr, " discards the actual content of all other messages");
> I guess this two-line format is a bit strange when printing.
> Maybe we need to combine into a single fprintf()?
OK, but I'd split new line. + Add \n as AI found :).
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-04-23 8:16 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 14:12 [LTP] [PATCH v4 0/5] lib: LTP_DEBUG cleanup Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 1/5] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
2026-04-22 15:18 ` [LTP] " linuxtestproject.agent
2026-04-22 14:12 ` [LTP] [PATCH v4 2/5] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG Petr Vorel
2026-04-22 14:12 ` [LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D Petr Vorel
2026-04-23 6:43 ` Li Wang
2026-04-22 14:12 ` [LTP] [PATCH v4 4/5] doc: newlib_tests: Update debugging parameters Petr Vorel
2026-04-23 6:45 ` Li Wang
2026-04-22 14:12 ` [LTP] [PATCH v4 5/5] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT Petr Vorel
2026-04-23 7:09 ` Li Wang
2026-04-23 8:15 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox