All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v5 2/4] lib/igt_core: Added message to runner about ignoring kernel warns
Date: Mon, 26 Aug 2024 13:04:06 -0400	[thread overview]
Message-ID: <Zsy1ht0_jEgj64PD@intel.com> (raw)
In-Reply-To: <20240819103242.26527-3-kamil.konieczny@linux.intel.com>

On Mon, Aug 19, 2024 at 12:32:40PM +0200, Kamil Konieczny wrote:
> Allow a test to emit regex into dmesg to be read by runner when
> it will be generating results based on kernel dmesg. When it
> will encounter such message, runner will save it and then
> temporarily ignore kernel warnings or errors which matches given
> regex.
> 
> v2: check creation of regex in subtest run and bail out quickly
> on error, fix description (Zbigniew)
> v3: print error when compiling regex fails (Zbigniew)
> 
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  lib/igt_core.c | 24 ++++++++++++++++++++++++
>  lib/igt_core.h |  2 ++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 3ff3e0392..6eef25dd5 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -3432,3 +3432,27 @@ int igt_pci_system_init(void)
>  
>  	return pthread_once(&once_control, __pci_system_init);
>  }
> +
> +/**
> + * igt_emit_ignore_dmesg_regex:
> + * @ignore_dmesg: string regex
> + *
> + * Emits a string for igt_runner to ignore next dmesg warns or errors which
> + * matches it.
> + */
> +void igt_emit_ignore_dmesg_regex(const char *ignore_dmesg_regex)
> +{
> +	static const char mark_ignore_dmesg[] = "add ignored dmesg regex: ";
> +	GError *err = NULL;
> +	GRegex *re;
> +
> +	re = g_regex_new(ignore_dmesg_regex, G_REGEX_OPTIMIZE, 0, &err);
> +	if (err) {
> +		igt_debug("regexp: '%s'\n", err->message);
> +		g_error_free(err);
> +		igt_assert_f(re, "Error in regexp\n");
> +	}
> +
> +	g_regex_unref(re);
> +	igt_kmsg(KMSG_INFO "%s%s\n", mark_ignore_dmesg, ignore_dmesg_regex);
> +}
> diff --git a/lib/igt_core.h b/lib/igt_core.h
> index 06c5314bf..a437ff8ed 100644
> --- a/lib/igt_core.h
> +++ b/lib/igt_core.h
> @@ -1542,4 +1542,6 @@ static inline void igt_pci_system_cleanup(void)
>  {
>  }
>  
> +void igt_emit_ignore_dmesg_regex(const char *ignore_dmesg_regex);
> +
>  #endif /* IGT_CORE_H */
> -- 
> 2.43.0
> 

  reply	other threads:[~2024-08-26 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 10:32 [PATCH i-g-t v5 0/4] runner: Allow dynamically ignore dmesg errors or warnings Kamil Konieczny
2024-08-19 10:32 ` [PATCH i-g-t v5 1/4] runner/resultgen: Added dynamically ignored dmesg messages Kamil Konieczny
2024-08-26 17:03   ` Rodrigo Vivi
2024-08-19 10:32 ` [PATCH i-g-t v5 2/4] lib/igt_core: Added message to runner about ignoring kernel warns Kamil Konieczny
2024-08-26 17:04   ` Rodrigo Vivi [this message]
2024-08-19 10:32 ` [PATCH i-g-t v5 3/4] tests/intel/xe_wedged: Inform runner about expected error Kamil Konieczny
2024-08-19 10:32 ` [PATCH i-g-t v5 4/4] HAX/DO_NOT_MERGE: xe-fast-feedback: test xe_wedged Kamil Konieczny
2024-08-19 11:34 ` ✗ CI.xeBAT: failure for runner: Allow dynamically ignore dmesg errors or warnings (rev6) Patchwork
2024-08-19 11:41 ` ✗ Fi.CI.BAT: " Patchwork
2024-08-23 10:24   ` Kamil Konieczny
2024-08-19 14:29 ` ✗ CI.xeFULL: " Patchwork
2024-08-23 11:59   ` Kamil Konieczny

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=Zsy1ht0_jEgj64PD@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.