Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Knop, Ryszard" <ryszard.knop@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Hajda, Andrzej" <andrzej.hajda@intel.com>
Cc: "Summers, Stuart" <stuart.summers@intel.com>,
	"Tahvanainen, Jari" <jari.tahvanainen@intel.com>,
	"Grabski, Mateusz" <mateusz.grabski@intel.com>,
	 "kamil.konieczny@linux.intel.com"
	<kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH v3 2/2] lib/igt_core: add timestamps to error logs
Date: Mon, 11 May 2026 14:35:50 +0000	[thread overview]
Message-ID: <5d37589104f5d972a7aa2b47461d6658261669e7.camel@intel.com> (raw)
In-Reply-To: <20260511-add_timestamps_to_logs-v3-2-041130e1f7ef@intel.com>

LGTM, so:

Reviewed-by: Ryszard Knop <ryszard.knop@intel.com>

On Mon, 2026-05-11 at 14:55 +0200, Andrzej Hajda wrote:
> IGT tests run often time consuming tasks. Timestamps should simplify
> time analysis and matching with kernel logs.
> Since IGT is closely connected with the kernel let's use the same format.
> 
> v2: adjusted string format and commit subject
> 
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> ---
>  lib/igt_core.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 5a0ab4361eaa..72b7d3449888 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -3226,10 +3226,15 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
>  		formatted_line = strdup(line);
>  		if (!formatted_line)
>  			goto out;
> -	} else if (asprintf(&formatted_line, "(%s:%d) %s%s%s%s: %s", program_name,
> -		     getpid(), thread_id, (domain) ? domain : "", (domain) ? "-" : "",
> -		     igt_log_level_str[level], line) == -1) {
> -		goto out;
> +	} else {
> +		struct timespec ts;
> +
> +		igt_gettime(&ts);
> +		if (asprintf(&formatted_line, "[%ld.%06ld] (%s:%d) %s%s%s%s: %s", (long)ts.tv_sec,
> +			     ts.tv_nsec / 1000, program_name, getpid(), thread_id,
> +			     (domain) ? domain : "", (domain) ? "-" : "", igt_log_level_str[level],
> +			     line) == -1)
> +			goto out;
>  	}
>  
>  	if (line[strlen(line) - 1] == '\n')

  reply	other threads:[~2026-05-11 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 12:55 [PATCH v3 0/2] lib/igt_core: add timestamps to error logs Andrzej Hajda
2026-05-11 12:55 ` [PATCH v3 1/2] lib/igt_core: do not reset errno in igt_gettime Andrzej Hajda
2026-05-11 15:05   ` Knop, Ryszard
2026-05-11 12:55 ` [PATCH v3 2/2] lib/igt_core: add timestamps to error logs Andrzej Hajda
2026-05-11 14:35   ` Knop, Ryszard [this message]
2026-05-12  3:59 ` ✓ i915.CI.BAT: success for lib/igt_core: add timestamps to error logs (rev2) Patchwork
2026-05-12  5:43 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12 11:20 ` ✓ Xe.CI.FULL: " Patchwork
2026-05-12 17:20 ` ✗ i915.CI.Full: failure " Patchwork
2026-05-12 18:58   ` Hajda, Andrzej

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=5d37589104f5d972a7aa2b47461d6658261669e7.camel@intel.com \
    --to=ryszard.knop@intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jari.tahvanainen@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=mateusz.grabski@intel.com \
    --cc=stuart.summers@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox