[PATCH i-g-t] intel_reg: Stop warning if register spec is not there

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Apr 11 10:10:39 UTC 2024


On Thu, Apr 11, 2024 at 12:07:03PM +0200, Zbigniew Kempczyński wrote:
> On Wed, Apr 10, 2024 at 04:17:10PM -0700, Lucas De Marchi 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.
> > 
> > Signed-off-by: Lucas De Marchi <lucas.demarchi at 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));
> 
> Maybe this warning should stay when verbosity >= 0?

Eh, > 0.

--
Zbigniew

> 
> --
> Zbigniew
> 
> > +	if (r)
> >  		goto builtin;
> > -	}
> >  
> >  	if (S_ISDIR(st.st_mode)) {
> >  		r = get_reg_spec_file(buf, sizeof(buf), path, config->devid);
> > -- 
> > 2.43.0
> > 


More information about the igt-dev mailing list