diff --git a/cpumf/lspai.c b/cpumf/lspai.c index c287ca1c..9dfebe99 100644 --- a/cpumf/lspai.c +++ b/cpumf/lspai.c @@ -69,6 +69,14 @@ static struct util_opt opt_vec[] = { .argument = "TYPE", .desc = "Type of PAI counters to show: crypto, nnpa" }, + { + .option = { "hex0x", no_argument, NULL, 'X' }, + .desc = "Counter values in hexadecimal format with leading 0x" + }, + { + .option = { "hex", no_argument, NULL, 'x' }, + .desc = "Counter values in hexadecimal format" + }, UTIL_OPT_HELP, UTIL_OPT_VERSION, UTIL_OPT_END @@ -659,6 +667,14 @@ int main(int argc, char **argv) case 't': check_type_name(optarg); break; + case 'x': + list_only = false; + ctrformat = "%lx"; + break; + case 'X': + list_only = false; + ctrformat = "%#lx"; + break; case OPT_FORMAT: if (!util_fmt_name_to_type(optarg, &fmt)) errx(EXIT_FAILURE, "Supported formats:" FMT_TYPE_NAMES); diff --git a/cpumf/man/lspai.8 b/cpumf/man/lspai.8 index 01cafcef..62f8aabc 100644 --- a/cpumf/man/lspai.8 +++ b/cpumf/man/lspai.8 @@ -30,6 +30,7 @@ .IR SECONDS ] .RB [ \-l .IR COUNT ] +.RB [ \-x ][ \-X ] .RI [ CPULIST ] .br \*c @@ -48,6 +49,8 @@ and numbers in various formats. If .I CPULIST is specified or any of the options +.BR \-x , +.BR \-X , .B \-l or .BR \-i, @@ -106,6 +109,14 @@ The default is 60 seconds. Performs the specified number of read operations. The default is one. . +.TP +.BR \-x ", " \-\-hex +Displays counter values as hexadecimal values. +. +.TP +.BR \-X ", " \-\-hex0x +Displays counter values as hexadecimal values with a leading 0x prefix. +. .SH "EXAMPLE" The \*c invocation lists all PAI Neural Network Processing Assist Facility (NNPA) counters in numeric order: