From: Jani Nikula <jani.nikula@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
igt-dev@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>,
Lucas De Marchi <lucas.demarchi@intel.com>,
Ville Syrjala <ville.syrjala@linux.intel.com>
Subject: Re: [PATCH i-g-t] intel_reg: Stop warning if register spec is not there
Date: Thu, 11 Apr 2024 11:53:03 +0300 [thread overview]
Message-ID: <87le5k7028.fsf@intel.com> (raw)
In-Reply-To: <20240410231710.3113867-1-lucas.demarchi@intel.com>
On Wed, 10 Apr 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> Stop suffering when using igt from the git checkout, which is the case
> for all/most developers.
>
> $ sudo ./build/tools/intel_reg write 0x2358 0xdeadbeef
> Warning: stat '/usr/local/share/igt-gpu-tools/registers' failed: No such file or directory. Using builtin register spec.
>
> Pretty annoying when you have a bunch of commands to run and don't want
> to simply ignore stderr. Keep the other warnings as if the file is
> there and can't be read for some reason, it's good to give a warning.
> However if the file simply isn't there, let it pass.
The TL;DR is,
Acked-by: Jani Nikula <jani.nikula@intel.com>
---
We have the "register specs" in plain text files so that anyone could
update them at runtime without building the source. And conceivably they
could be generated from a more authoritative source. It would be nice if
we could incorporate the info to the binary at build time as the builtin
register specs (so no data dir lookups at all), but also be able to
override them e.g. using a command-line parameter if the user wishes.
I don't think that would even be so hard. But it would arguably be a bit
wasted effort as long as the register files under tools/registers/
aren't updated for newer platforms. (The current builtin register specs
are completely out of date.)
The tool could use some love again. It's been almost 10 years since
commit dfda0b6aecce ("intel_reg: introduce one intel_reg tool to rule
them all").
BR,
Jani.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> tools/intel_reg.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/tools/intel_reg.c b/tools/intel_reg.c
> index 6c37e14d1..ec311a05a 100644
> --- a/tools/intel_reg.c
> +++ b/tools/intel_reg.c
> @@ -1114,12 +1114,8 @@ static int read_reg_spec(struct config *config)
> path = IGT_DATADIR"/registers";
>
> r = stat(path, &st);
> - if (r) {
> - fprintf(stderr, "Warning: stat '%s' failed: %s. "
> - "Using builtin register spec.\n",
> - path, strerror(errno));
> + if (r)
> goto builtin;
> - }
>
> if (S_ISDIR(st.st_mode)) {
> r = get_reg_spec_file(buf, sizeof(buf), path, config->devid);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-04-11 8:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 23:17 [PATCH i-g-t] intel_reg: Stop warning if register spec is not there Lucas De Marchi
2024-04-11 2:12 ` ✓ CI.xeBAT: success for " Patchwork
2024-04-11 2:27 ` ✓ Fi.CI.BAT: " Patchwork
2024-04-11 8:53 ` Jani Nikula [this message]
2024-04-11 12:48 ` [PATCH i-g-t] " Lucas De Marchi
2024-04-11 13:24 ` Jani Nikula
2024-04-11 14:29 ` Lucas De Marchi
2024-04-11 14:55 ` Jani Nikula
2024-04-11 15:32 ` Lucas De Marchi
2024-04-11 10:07 ` Zbigniew Kempczyński
2024-04-11 10:10 ` Zbigniew Kempczyński
2024-04-11 13:49 ` ✗ CI.xeFULL: failure for " Patchwork
2024-04-11 14:45 ` ✗ Fi.CI.IGT: " Patchwork
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=87le5k7028.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox