From: Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
gustavo.sousa@intel.com, igt-dev@lists.freedesktop.org,
priyanka.dandamudi@intel.com
Subject: Re: [PATCH i-g-t v1] lib/igt_debugfs: Add "errno" to debug print
Date: Wed, 15 Jul 2026 13:19:41 -0700 [thread overview]
Message-ID: <faed1493-089b-4ecc-8ec8-69eee268dd8f@linux.intel.com> (raw)
In-Reply-To: <20260713144531.ajtlp2n5nckzc7nc@kamilkon-DESK.igk.intel.com>
Hi Kamil,
On 2026-07-13 07:45, Kamil Konieczny wrote:
> Hi Ngai-Mint,
> On 2026-07-08 at 15:52:12 -0700, Ngai-Mint Kwan wrote:
>> When igt_debugfs_path() fails under igt_debugfs_dir(), add "errno" to the
>> debug print for additional context of the failure.
>>
>> Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>
>> ---
>> lib/igt_debugfs.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
>> index ed0a20773..a8c45945c 100644
>> --- a/lib/igt_debugfs.c
>> +++ b/lib/igt_debugfs.c
>> @@ -187,8 +187,12 @@ int igt_debugfs_dir(int device)
>> int debugfs_dir_fd;
>> char path[200];
>>
>> - if (igt_debug_on(!igt_debugfs_path(device, path, sizeof(path))))
>> + errno = 0;
>> + if (igt_debug_on(!igt_debugfs_path(device, path, sizeof(path)))) {
>> + igt_debug("Last errno: %i, %s\n", errno, strerror(errno));
> Problem with this is that errno should be used in place where
> the error occured, as any system function call after it occur
> can change it. imho you should add more debug prints to
> igt_debugfs_path() with errno printing there.
Agreed, but the goal of this patch is narrowly focused to improve
debugging for
igt_debugfs_dir(). The idea is to provide a hint of the debugfs failure
so that the
person debugging would have additional context. This also includes the
possibility
that errno is zero and that the failure is potentially unrelated to
system function
calls.
Regards,
Ngai-Mint Kwan
> Regards,
> Kamil
>
>> +
>> return -1;
>> + }
>>
>> debugfs_dir_fd = open(path, O_RDONLY);
>> igt_debug_on_f(debugfs_dir_fd < 0, "path: %s\n", path);
>> --
>> 2.43.0
>>
prev parent reply other threads:[~2026-07-15 20:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 22:52 [PATCH i-g-t v1] lib/igt_debugfs: Add "errno" to debug print Ngai-Mint Kwan
2026-07-08 23:29 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-07-08 23:52 ` ✓ i915.CI.BAT: " Patchwork
2026-07-09 3:56 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-09 16:55 ` Ngai-Mint Kwan
2026-07-09 5:35 ` [PATCH i-g-t v1] " Dandamudi, Priyanka
2026-07-09 22:56 ` ✗ i915.CI.Full: failure for " Patchwork
2026-07-13 14:45 ` [PATCH i-g-t v1] " Kamil Konieczny
2026-07-15 20:19 ` Ngai-Mint Kwan [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=faed1493-089b-4ecc-8ec8-69eee268dd8f@linux.intel.com \
--to=ngai-mint.kwan@linux.intel.com \
--cc=gustavo.sousa@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=priyanka.dandamudi@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