public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: tst_kconfig: Add runtime checks
Date: Fri, 6 Feb 2026 09:23:03 +0100	[thread overview]
Message-ID: <20260206082303.GA364017@pevik> (raw)
In-Reply-To: <aYWfNaJeXqut0Isb@redhat.com>

> > > +static void runtime_check(struct tst_kconfig_var *var)
> > > +{
> > > +	size_t i;
> > > +
> > > +	for (i = 0; runtime_checks[i].config; i++) {
> > > +		if (strcmp(runtime_checks[i].config, var->id))
> > > +			continue;
> > > +
> > > +		tst_res(TDEBUG, "Running runtime check for '%s'", var->id);
> > This will not work since Li's change:
> > aa5a6fcdcd ("lib: suppress early TDEBUG output before context initialization")

> > @Li I'm not sure what "unless explicitly enabled" means, but I guess we cannot
> > simple enable it for the test library (following patch). I vote to either revert
> > aa5a6fcdcd or change it (effectively revert it, but keep doc and the rest of the
> > code).

> > I understand having the output in each test is not ideal:

> > utsname01.c:39: TDEBUG: mmap((nil), 64, PROT_READ | PROT_WRITE(3), 33, -1, 0)
> > utsname01.c:40: TDEBUG: mmap((nil), 64, PROT_READ | PROT_WRITE(3), 33, -1, 0)

> > but better more output code than no code.

> Well, I don't like that noisy logging style, that's why I did aa5a6fcdcd.

> Maybe can we add more levels of TDEBUG log to LTP:

>   -D0: no debug logs print
>   -D1: only generic logs print
>   -D2: more veroes logs include library debuginfo

> What do you think?

For the level we would need to track the level state.

Also, we now support
-D
LTP_ENABLE_DEBUG=y (or n to disable)

Now, user would have to always use '-D1' or '-D2' to get logging or not use
getopts. IMHO getopts does not support both '-D' (without value) and '-D1' (with
value).

IMHO that's why ssh supports multiple '-v', e.g. '-v -v -v' or '-vvv' instead of
-v2 or -v3).

Anyway I'd prefer solving this somehow in the code so that users don't have to
bother about log levels, but I have no idea how. Maybe yet another enum
tst_res_flags member? Because aa5a6fcdcd skipped messages, which are likely
useful when run by child process (the test), but not by library process. And I
want to print message which is always run by library process. Maybe to have some
#define in source code, which would force logging even for library process? (not
sure what will be needed more often).

But sure, this would work if there no other way to detect these 2 cases.

OT we have:

in tst_test.c:

	if (context->tdebug)
		tst_res(TINFO, "Restored metadata for PID %d", getpid());

=> shouldn't it use TDEBUG instead of TINFO?

Kind regards,
Petr

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

  reply	other threads:[~2026-02-06  8:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 13:57 [LTP] [PATCH] lib: tst_kconfig: Add runtime checks Cyril Hrubis
2026-02-05 17:47 ` Petr Vorel
2026-02-06  7:58   ` Li Wang via ltp
2026-02-06  8:23     ` Petr Vorel [this message]
2026-02-06 12:23       ` Li Wang via ltp
2026-03-26 14:09         ` Cyril Hrubis
2026-03-26 14:16           ` Cyril Hrubis
2026-03-26 16:39           ` Petr Vorel
2026-02-06  8:23     ` Petr Vorel
2026-02-06  8:33     ` Cyril Hrubis
2026-02-06  9:31       ` Petr Vorel
2026-02-06  9:37       ` Petr Vorel
2026-02-06  9:45         ` Cyril Hrubis
2026-02-06 10:31           ` Petr Vorel
2026-03-26 14:38   ` Cyril Hrubis
2026-03-26 15:44     ` Petr Vorel
2026-03-11  8:59 ` Petr Vorel
2026-03-24  8:33 ` Andrea Cervesato via ltp
2026-03-26 14:17   ` Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2026-03-26 14:40 Cyril Hrubis
2026-03-26 15:15 ` Petr Vorel
2026-03-27  7:02 ` Li Wang via ltp
2026-03-27 11:06   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206082303.GA364017@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox