Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Kushal Chand <kushalchand@zilogic.com>
Cc: ltp <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v1] tst_taint: Print readable error message instead of numerical code
Date: Fri, 14 Jan 2022 13:09:46 +0100	[thread overview]
Message-ID: <YeFoCtIgRTB0mZwl@pevik> (raw)
In-Reply-To: <17e51a0a10c.33eb200245902.4455067589425493654@zilogic.com>

Hi Kushal,

> Hi Petr,

> I am really sorry I forgot to mention the link to issue on LTP for which I have submitted the patch. 

> Can you please check https://github.com/linux-test-project/ltp/issues/776 if you have not already? 

Thanks, I was not aware of this. Thank you for working on this.
Please next time add flag to git commit message:

if it's an implementation:
Implements: #776

or if it's a fix:
Fixes: #776

Cyril wanted to transform numeric value to string name - there are various taint
flags, but we print flag as number. Could you please have look at const char
*tst_strerrno(int err) in lib/errnos.h and wrote similar function for this?
i.e.:

-		tst_brk(TBROK, "Kernel is already tainted: %u", taint);
+		tst_brk(TBROK, "Kernel is already tainted: %u", tst_strtaint(taint));

const char *tst_strtaint(int err)
{
    static const struct pair taint_pairs[] = {
		STRPAIR(TST_TAINT_A, "A (ACPI table has been overwritten)")
		STRPAIR(TST_TAINT_B, "B (page-release function found bad page)")
		...
	};

    PAIR_LOOKUP(errno_pairs, err);
}

Maybe Cyril has additional comments how the string should look like.

Kind regards,
Petr


> I just followed what the issue points out. 

> If not I will follow what you have mentioned if given more references to tst_strerrno()






> ---- On Wed, 12 Jan 2022 20:48:50 +0530 Petr Vorel <pvorel@suse.cz> wrote ----



> Hi Kushal, 

> >      if ((taint & taint_mask) != 0) 
> > -        tst_brk(TBROK, "Kernel is already tainted: %u", taint); 
> > +        tst_brk(TBROK, "Kernel is already tainted: TAINT_D (OOPS)"); 

> Kernel can be tainted before testing with different flags than D. 

> If you don't like the number, how about create function to map taint flag to 
> char? i.e. similarly to tst_strerrno()? 

> Kind regards, 
> Petr 






> Regards,
> Kushal

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

      reply	other threads:[~2022-01-14 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 15:00 [LTP] [PATCH v1] tst_taint: Print readable error message instead of numerical code Kushal Chand
2022-01-12 15:18 ` Petr Vorel
2022-01-13  4:09   ` Kushal Chand
2022-01-14 12:09     ` Petr Vorel [this message]

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=YeFoCtIgRTB0mZwl@pevik \
    --to=pvorel@suse.cz \
    --cc=kushalchand@zilogic.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