From: "Hajda, Andrzej" <andrzej.hajda@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
<igt-dev@lists.freedesktop.org>,
Ryszard Knop <ryszard.knop@intel.com>,
Stuart Summers <stuart.summers@intel.com>
Subject: Re: [PATCH] core: add timestamps to logs
Date: Wed, 6 May 2026 17:09:30 +0200 [thread overview]
Message-ID: <a57ef25f-9ed9-405b-a0ef-f7b7f356fb70@intel.com> (raw)
In-Reply-To: <20260506142559.c6dc7hcz2bo364qx@kamilkon-DESK.igk.intel.com>
W dniu 6.05.2026 o 16:25, Kamil Konieczny pisze:
> Hi Andrzej,
> On 2026-05-05 at 16:46:27 +0200, Andrzej Hajda wrote:
>
> please use longer prefix, also these changes only debug logs,
> so imho better subject:
>
> [PATCH] lib/igt_core: add timestamps to error logs
OK
>
> See for example results here:
> https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15100/shard-lnl-2/igt@core_auth@many-magics.html
>
>> 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.
>>
>> 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 4f79c02948ab..e11b181e7a82 100644
>> --- a/lib/igt_core.c
>> +++ b/lib/igt_core.c
>> @@ -3227,10 +3227,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, "[%5ld.%06ld] (%s:%d) %s%s%s%s: %s", (long)ts.tv_sec,
>
> Can you align it to igt_runner format? It is %ld.%06ld
> see grep 6ld runner/*.c
OK. Looks better.
Regards
Andrzej
>
> Regards,
> Kamil
>
>> + 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')
>>
>> ---
>> base-commit: 8eb6e58f00d39b3bb79ffc501eb020b36c8f8c31
>> change-id: 20260430-add_timestamps_to_logs-d84fdfd7ef4c
>>
>> Best regards,
>> --
>> Andrzej Hajda <andrzej.hajda@intel.com>
>>
prev parent reply other threads:[~2026-05-06 15:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 14:46 [PATCH] core: add timestamps to logs Andrzej Hajda
2026-05-05 18:23 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-05-05 18:48 ` ✗ i915.CI.BAT: " Patchwork
2026-05-06 2:37 ` ✗ Xe.CI.FULL: " Patchwork
2026-05-06 14:25 ` [PATCH] " Kamil Konieczny
2026-05-06 15:09 ` Hajda, Andrzej [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=a57ef25f-9ed9-405b-a0ef-f7b7f356fb70@intel.com \
--to=andrzej.hajda@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=ryszard.knop@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