mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cpumf/lspai: Add command line flags for hexadecimal output
Add command line flags -x and -X to print counter values in hexadecimal format with leading 0x prefix (-X) and without (-x). Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
973059438f
commit
43067df78e
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user