[PATCH i-g-t 1/2] intel_reg: Reorder commands and annotate ones needing reg spec

Jani Nikula jani.nikula at linux.intel.com
Mon Apr 29 09:06:40 UTC 2024


On Fri, 26 Apr 2024, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
> Group together the commands that operate with a reg spec and annotate
> those that will implicitly enable a future --decode option.

The series LGTM,

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

Please follow-up with an update to man/intel_reg.rst.

Thanks,
Jani.

>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  tools/intel_reg.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/tools/intel_reg.c b/tools/intel_reg.c
> index aae5a2395..8f585e4bd 100644
> --- a/tools/intel_reg.c
> +++ b/tools/intel_reg.c
> @@ -967,10 +967,16 @@ struct command {
>  	const char *name;
>  	const char *description;
>  	const char *synopsis;
> +	bool decode;
>  	int (*function)(struct config *config, int argc, char *argv[]);
>  };
>  
>  static const struct command commands[] = {
> +	{
> +		.name = "help",
> +		.function = intel_reg_help,
> +		.description = "show this help",
> +	},
>  	{
>  		.name = "read",
>  		.function = intel_reg_read,
> @@ -983,31 +989,29 @@ static const struct command commands[] = {
>  		.synopsis = "[--post] REGISTER VALUE [REGISTER VALUE ...]",
>  		.description = "write value(s) to specified register(s)",
>  	},
> +	{
> +		.name = "snapshot",
> +		.function = intel_reg_snapshot,
> +		.description = "create a snapshot of the MMIO bar to stdout",
> +	},
>  	{
>  		.name = "dump",
>  		.function = intel_reg_dump,
>  		.description = "dump all known registers",
> +		.decode = true,
>  	},
>  	{
>  		.name = "decode",
>  		.function = intel_reg_decode,
>  		.synopsis = "REGISTER VALUE [REGISTER VALUE ...]",
>  		.description = "decode value(s) for specified register(s)",
> -	},
> -	{
> -		.name = "snapshot",
> -		.function = intel_reg_snapshot,
> -		.description = "create a snapshot of the MMIO bar to stdout",
> +		.decode = true,
>  	},
>  	{
>  		.name = "list",
>  		.function = intel_reg_list,
>  		.description = "list all known register names",
> -	},
> -	{
> -		.name = "help",
> -		.function = intel_reg_help,
> -		.description = "show this help",
> +		.decode = true,
>  	},
>  };

-- 
Jani Nikula, Intel


More information about the igt-dev mailing list