lib: LTP_DEBUG cleanup
v5 cover lib: LTP_DEBUG cleanup
Changes v4->v5:
* New commit "lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1" (it can be squashed, but I wanted to point this out and get Martin's ack)
* Fix missing new lines in help (AI)
* Remove wrongly stated TWARN (error on code on master)
* Use single fprintf (Li)
Link to v5:
https://lore.kernel.org/ltp/[email protected]/T/#t
https://patchwork.ozlabs.org/project/ltp/list/?series=501017&state=*
Petr Vorel (6):
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
lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
doc/developers/debugging.rst | 6 ++-- doc/old/C-Test-API.asciidoc | 4 +-- doc/users/setup_tests.rst | 9 +++--- lib/newlib_tests/tst_res_flags.c | 2 +- lib/tst_test.c | 49 +++++++++++++------------------- 5 files changed, 31 insertions(+), 39 deletions(-)
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 1/6 lib: Ignore empty LTP_ENABLE_DEBUG
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:
--- lib/tst_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/tst_test.c +2 -2
@@ -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);
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] lib: Ignore empty LTP_ENABLE_DEBUG
Hi Petr,
--- [PATCH 5/6] ---
Quoted 3 lines · Petr Vorel
lib: Merge functionality of
LTP_QUIETintoLTP_REPRODUCIBLE_OUTPUT+ - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG
s/uppress/suppress/
(The typo is carried into patch 6/6 as well.)
---
Note:
Our agent completed the review of the patch. 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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 2/6 lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG
In reply to Petr Vorel1) LTP_DEBUG is shorter to write.
2) Enable is usually meant as boolean (on/off), that hides possible 2 value even more.
--- 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(-)
doc/developers/debugging.rst +1 -1
@@ -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:
doc/old/C-Test-API.asciidoc +1 -1
@@ -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. |==============================
doc/users/setup_tests.rst +1 -1
@@ -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.
lib/newlib_tests/tst_res_flags.c +1 -1
@@ -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)
lib/tst_test.c +3 -3
@@ -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);
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 3/6 lib: Prefer LTP_DEBUG over -D
In reply to Petr VorelEnvironment 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.
--- doc/developers/debugging.rst | 2 ++ lib/tst_test.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-)
doc/developers/debugging.rst +2 -0
@@ -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 ------------------------------
lib/tst_test.c +11 -14
@@ -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!" );
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 4/6 doc: newlib_tests: Update debugging parameters
In reply to Petr Vorel* 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")
--- 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(-)
doc/developers/debugging.rst +2 -2
@@ -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.
doc/old/C-Test-API.asciidoc +2 -2
@@ -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. |==============================
doc/users/setup_tests.rst +1 -1
@@ -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 -----------------------------------
lib/newlib_tests/tst_res_flags.c +1 -1
@@ -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)
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 5/6 lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
In reply to Petr VorelLTP_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, 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.
Also fix help description, because TWARN was not skipped, although doc claimed to do.
Implements: https://github.com/linux-test-project/ltp/issues/1306
---
Changes v4->v5:
* Remove wrongly stated TWARN (error on code on master)
* Fix missing new lines in help (AI)
* Use single fprintf (Li)
doc/users/setup_tests.rst | 5 +++-- lib/tst_test.c | 16 +++++----------- 2 files changed, 8 insertions(+), 13 deletions(-)
doc/users/setup_tests.rst +3 -2
@@ -43,8 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` discards the actual content of the messages - printed by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG + messages and discards the actual content of the other messages printed + by the test (suitable for a reproducible output). * - LTP_SINGLE_FS_TYPE - Specifies single filesystem to run the test on instead all supported
lib/tst_test.c +5 -11
@@ -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, TINFO and TDEBUG messages and\n" +" discards the actual content of all other 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" );
@@ -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);
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 5/6] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
Hi,
[ Cc valgrind-developers ML, which I should have done when sending the patchset ].
Kind regards,
Petr
Quoted 111 lines
LTP_REPRODUCIBLE_OUTPUT=1 environment variable was added in
5894abc5fto 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, TINFO, and TDEBUG messages.
Valgrind project uses both variables but no need to handle them separately. Therefore merge functionality of
LTP_QUIETintoLTP_REPRODUCIBLE_OUTPUT.
LTP_QUIETwas not even documented in HTML doc.Also fix help description, because TWARN was not skipped, although doc claimed to do.
Implements: https://github.com/linux-test-project/ltp/issues/1306
Signed-off-by Petr Vorel <[email protected]>---
Changesv4->v5:
* Remove wrongly stated TWARN (error on code on master)
* Fix missing new lines in help (AI)
* Use single fprintf (Li)doc/users/setup_tests.rst | 5 +++-- lib/tst_test.c | 16 +++++----------- 2 files changed, 8 insertions(+), 13 deletions(-)doc/users/setup_tests.rst +3
-2@@ -43,8 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` discards the actual content of the messages - printed by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG + messages and discards the actual content of the other messages printed + by the test (suitable for a reproducible output). * - LTP_SINGLE_FS_TYPE - Specifies single filesystem to run the test on instead all supportedlib/tst_test.c +5
-11@@ -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, TINFO and TDEBUG messages and\n" +" discards the actual content of all other 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" );@@ -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);
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Li Wang
Reviewed-byRe: [LTP] [PATCH v5 5/6] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
Hi Petr,
Tiny note: it would be appreciated if your replace all the reviewed-by with my new account in this patchset.
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [Valgrind-developers] [PATCH v5 5/6] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
Hi Li,
Quoted 6 lines
Hi Petr,
Reviewed-by Li Wang <[email protected]>Tiny note: it would be appreciated if your replace all the reviewed-by with my new account in this patchset.
Sure, I can do it. I thought they were added as part of your work for Red Hat (added in March 27, 2026), so that it's kind of RH credit :).
BTW the patch needs fix below (find by AI review), but posted to the 1st commit.
Kind regards,
Petr
users/setup_tests.rst +1 -1
@@ -43,7 +43,7 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG + - When set to ``1`` or ``y`` suppress printing TCONF, TINFO and TDEBUG messages and discards the actual content of the other messages printed by the test (suitable for a reproducible output).
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 5/6] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT
In reply to Petr VorelHi Martin,
any change I'd get your explicit ack to this change
(your Acked-by: or Reviewed-by: ?). It should be safe for Valgrind, but better you to double check.
https://lore.kernel.org/ltp/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
Quoted 34 lines
LTP_REPRODUCIBLE_OUTPUT=1 environment variable was added in
5894abc5fto 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, TINFO, and TDEBUG messages.
Valgrind project uses both variables but no need to handle them separately. Therefore merge functionality of
LTP_QUIETintoLTP_REPRODUCIBLE_OUTPUT.
LTP_QUIETwas not even documented in HTML doc.Also fix help description, because TWARN was not skipped, although doc claimed to do.
Implements: https://github.com/linux-test-project/ltp/issues/1306
Signed-off-by Petr Vorel <[email protected]>---
Changesv4->v5:
* Remove wrongly stated TWARN (error on code on master)
* Fix missing new lines in help (AI)
* Use single fprintf (Li)doc/users/setup_tests.rst | 5 +++-- lib/tst_test.c | 16 +++++----------- 2 files changed, 8 insertions(+), 13 deletions(-)doc/users/setup_tests.rst +0
-0
doc/users/setup_tests.rst users. · line 46
Quoted 6 lines
doc/users/setup_tests.rst +1
-2@@ -43,8 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` discards the actual content of the messages - printed by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG
Also AI found missing 's': s/uppress/suppress/
I'll fix that before merging.
Kind regards,
Petr
Quoted 2 lines
doc/users/setup_tests.rst +2
-0+ messages and discards the actual content of the other messages printed + by the test (suitable for a reproducible output).
...
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v5 6/6 lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
In reply to Petr VorelIt'll be better for Valgrind developers to know, that test is skipped. TCONF is not printed that often and because output of the message is trimmed, it will not be that disruptive.
---
New in v5 (it can be squashed, but I wanted to point this out and get Martin's ack).
doc/users/setup_tests.rst | 6 +++--- lib/tst_test.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-)
doc/users/setup_tests.rst +3 -3
@@ -43,9 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG - messages and discards the actual content of the other messages printed - by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` uppress printing TINFO and TDEBUG messages + and discards the actual content of the other messages printed by the + test (suitable for a reproducible output). * - LTP_SINGLE_FS_TYPE - Specifies single filesystem to run the test on instead all supported
lib/tst_test.c +1 -3
@@ -306,8 +306,6 @@ static void print_result(const char *file, const int lineno, int ttype, res ="TBROK" ;break ;case TCONF : -if (reproducible_output) -return ; res ="TCONF" ;break ;case TWARN :
@@ -675,7 +673,7 @@ 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 suppress printing TCONF, TINFO and TDEBUG messages and\n" +fprintf (stderr,"LTP_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TINFO and TDEBUG messages and\n" " discards the actual content of all other 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" );
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 6/6] lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
Hi,
[ Cc valgrind-developers ML, which I should have done when sending the patchset ].
Kind regards,
Petr
Quoted 51 lines
It'll be better for Valgrind developers to know, that test is skipped. TCONF is not printed that often and because output of the message is trimmed, it will not be that disruptive.
Signed-off-by Petr Vorel <[email protected]>---
New in v5 (it can be squashed, but I wanted to point this out and get Martin's ack).doc/users/setup_tests.rst | 6 +++--- lib/tst_test.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-)doc/users/setup_tests.rst +3
-3@@ -43,9 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` uppress printing TCONF, TINFO and TDEBUG - messages and discards the actual content of the other messages printed - by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` uppress printing TINFO and TDEBUG messages + and discards the actual content of the other messages printed by the + test (suitable for a reproducible output). * - LTP_SINGLE_FS_TYPE - Specifies single filesystem to run the test on instead all supportedlib/tst_test.c +1
-3@@ -306,8 +306,6 @@ static void print_result(const char *file, const int lineno, int ttype, res ="TBROK" ;break ;case TCONF : -if (reproducible_output) -return ; res ="TCONF" ;break ;case TWARN :@@ -675,7 +673,7 @@ 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 suppress printing TCONF, TINFO and TDEBUG messages and\n" +fprintf (stderr,"LTP_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TINFO and TDEBUG messages and\n" " discards the actual content of all other 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" );
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 6/6] lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
In reply to Petr VorelQuoted 3 lines · Petr Vorel
It'll be better for Valgrind developers to know, that test is skipped. TCONF is not printed that often and because output of the message is trimmed, it will not be that disruptive.
Fine with that:
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 6/6] lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
Hi all,
FYI also this one needs update before merge (missing 's').
Kind regards,
Petr
+++ doc/users/setup_tests.rst
@@ -43,7 +43,7 @@ users.
Shell language: ``TST_NEEDS_DEVICE=1``.
* - LTP_REPRODUCIBLE_OUTPUT
- - When set to ``1`` or ``y`` uppress printing TINFO and TDEBUG messages
+ - When set to ``1`` or ``y`` suppress printing TINFO and TDEBUG messages
and discards the actual content of the other messages printed by the test (suitable for a reproducible output).
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v5 6/6] lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1
In reply to Li WangHi all,
FYI whole patchset merged with 'uppress' => 'suppress' fix.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
To all patch-set, feel free to merge:
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp