[libvirt] [PATCH v2 0/2] processor frequency information on S390

Since kernel version 4.7, processor frequency information is available on S390. This patch series extends the parser for system information. Let's also add a testcase to the test suite for a S390 CPU configuration running kernel version 4.14 on LPAR. This is basically patch 3 of this series: https://www.redhat.com/archives/libvir-list/2017-December/msg00633.html v1 -> v2: - add debug logging - don't discard the whole hostsysinfo when the parsing fails - don't try to parse a value for external_clock, that information is not available on S390 - add test case for to sysinfotest.c Bjoern Walk (2): util: virsysinfo: parse frequency information on S390 tests: sysinfotest: add new test case for S390 src/util/virsysinfo.c | 41 ++++++- tests/sysinfodata/s390-freqcpuinfo.data | 52 +++++++++ tests/sysinfodata/s390-freqsysinfo.data | 173 ++++++++++++++++++++++++++++++ tests/sysinfodata/s390-freqsysinfo.expect | 63 +++++++++++ tests/sysinfotest.c | 1 + 5 files changed, 325 insertions(+), 5 deletions(-) create mode 100644 tests/sysinfodata/s390-freqcpuinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.expect -- 2.13.4

Let's also parse the available processor frequency information on S390 so that it can be utilized by virsh sysinfo: # virsh sysinfo <sysinfo type='smbios'> ... <processor> <entry name='family'>2964</entry> <entry name='manufacturer'>IBM/S390</entry> <entry name='version'>00</entry> <entry name='max_speed'>5000</entry> <entry name='serial_number'>145F07</entry> </processor> ... </sysinfo> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virsysinfo.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..dc309a7c 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -34,6 +34,7 @@ #include "virsysinfo.h" #include "viralloc.h" #include "vircommand.h" +#include "virlog.h" #include "virfile.h" #include "virstring.h" @@ -42,6 +43,7 @@ #define VIR_FROM_THIS VIR_FROM_SYSINFO +VIR_LOG_INIT("util.sysinfo"); VIR_ENUM_IMPL(virSysinfo, VIR_SYSINFO_LAST, "smbios"); @@ -495,11 +497,12 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor; if (!(tmp_base = virSysinfoParseS390Line(base, "vendor_id", &manufacturer))) - goto cleanup; + goto error; /* Find processor N: line and gather the processor manufacturer, version, serial number, and family */ @@ -507,10 +510,10 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) && (tmp_base = virSysinfoParseS390Line(tmp_base, "processor ", &procline))) { if (VIR_EXPAND_N(ret->processor, ret->nprocessor, 1) < 0) - goto cleanup; + goto error; processor = &ret->processor[ret->nprocessor - 1]; if (VIR_STRDUP(processor->processor_manufacturer, manufacturer) < 0) - goto cleanup; + goto error; if (!virSysinfoParseS390Delimited(procline, "version", &processor->processor_version, '=', ',') || @@ -520,15 +523,43 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) !virSysinfoParseS390Delimited(procline, "machine", &processor->processor_family, '=', '\n')) - goto cleanup; + goto error; VIR_FREE(procline); } - result = 0; + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_uip(ncpu, NULL, 10, &n) < 0) + goto error; + + if (n >= ret->nprocessor) { + VIR_DEBUG("CPU number '%d' out of range", n); + goto cleanup; + } + + if (!(tmp_base = strstr(tmp_base, "cpu MHz static")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz static", &mhz)) + goto cleanup; + + ret->processor[n].processor_max_speed = mhz; + + VIR_FREE(ncpu); + } cleanup: + result = 0; + + error: VIR_FREE(manufacturer); VIR_FREE(procline); + VIR_FREE(ncpu); return result; } -- 2.13.4

On Friday, 12 January 2018 12:38:01 CET Bjoern Walk wrote:
+ while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; [...] + if (n >= ret->nprocessor) { + VIR_DEBUG("CPU number '%d' out of range", n);
Since 'n' is unsigned int, then the right printf format is %u. The rest of the patch seems good to me. Thanks, -- Pino Toscano

Pino Toscano <ptoscano@redhat.com> [2018-01-12, 01:37PM +0100]:
On Friday, 12 January 2018 12:38:01 CET Bjoern Walk wrote:
+ while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; [...] + if (n >= ret->nprocessor) { + VIR_DEBUG("CPU number '%d' out of range", n);
Since 'n' is unsigned int, then the right printf format is %u.
You are right, of course. Expected to get a compiler warning or syntax-check error, though.
The rest of the patch seems good to me.
Thanks.
Thanks, -- Pino Toscano

Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR. Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- tests/sysinfodata/s390-freqcpuinfo.data | 52 +++++++++ tests/sysinfodata/s390-freqsysinfo.data | 173 ++++++++++++++++++++++++++++++ tests/sysinfodata/s390-freqsysinfo.expect | 63 +++++++++++ tests/sysinfotest.c | 1 + 4 files changed, 289 insertions(+) create mode 100644 tests/sysinfodata/s390-freqcpuinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.expect diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data @@ -0,0 +1,52 @@ +vendor_id : IBM/S390 +# processors : 8 +bogomips per cpu: 20325.00 +max thread id : 1 +features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx sie +facilities : 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 64 65 66 67 68 69 70 71 72 73 75 76 77 78 80 128 129 131 132 142 143 +cache0 : level=1 type=Data scope=Private size=128K line_size=256 associativity=8 +cache1 : level=1 type=Instruction scope=Private size=96K line_size=256 associativity=6 +cache2 : level=2 type=Data scope=Private size=2048K line_size=256 associativity=8 +cache3 : level=2 type=Instruction scope=Private size=2048K line_size=256 associativity=8 +cache4 : level=3 type=Unified scope=Shared size=65536K line_size=256 associativity=16 +cache5 : level=4 type=Unified scope=Shared size=491520K line_size=256 associativity=30 +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964 + +cpu number : 0 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 1 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 2 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 3 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 4 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 5 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 6 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 7 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 diff --git a/tests/sysinfodata/s390-freqsysinfo.data b/tests/sysinfodata/s390-freqsysinfo.data new file mode 100644 index 00000000..1941ef0b --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.data @@ -0,0 +1,173 @@ +Manufacturer: IBM +Type: 2964 +Model: 704 NC9 +Sequence Code: 0000000000085F07 +Plant: 02 +Model Capacity: 704 00000740 +Model Perm. Capacity: 704 00000740 +Model Temp. Capacity: 704 00000740 +Nominal Cap. Rating: 00000740 +Nominal Perm. Rating: 00000740 +Nominal Temp. Rating: 00000740 +Capacity Adj. Ind.: 100 +Capacity Ch. Reason: 0 +Capacity Transient: 0 +Type 1 Percentage: 0 +Type 2 Percentage: 0 +Type 3 Percentage: 0 +Type 4 Percentage: 0 +Type 5 Percentage: 0 + +CPU Topology HW: 0 0 4 2 3 8 +CPU Topology SW: 0 0 4 2 3 8 +CPUs Total: 129 +CPUs Configured: 4 +CPUs Standby: 0 +CPUs Reserved: 125 +CPUs G-MTID: 0 +CPUs S-MTID: 1 +Capability: 492 +Nominal Capability: 492 +Secondary Capability: 492 +Adjustment 02-way: 61470 +Adjustment 03-way: 59694 +Adjustment 04-way: 58336 +Adjustment 05-way: 56860 +Adjustment 06-way: 55918 +Adjustment 07-way: 54956 +Adjustment 08-way: 53949 +Adjustment 09-way: 52689 +Adjustment 10-way: 51635 +Adjustment 11-way: 50577 +Adjustment 12-way: 49584 +Adjustment 13-way: 48821 +Adjustment 14-way: 47979 +Adjustment 15-way: 47170 +Adjustment 16-way: 46270 +Adjustment 17-way: 45730 +Adjustment 18-way: 45292 +Adjustment 19-way: 44737 +Adjustment 20-way: 44517 +Adjustment 21-way: 44019 +Adjustment 22-way: 43770 +Adjustment 23-way: 43478 +Adjustment 24-way: 43216 +Adjustment 25-way: 42964 +Adjustment 26-way: 42763 +Adjustment 27-way: 42529 +Adjustment 28-way: 42172 +Adjustment 29-way: 41916 +Adjustment 30-way: 41659 +Adjustment 31-way: 41382 +Adjustment 32-way: 41165 +Adjustment 33-way: 40903 +Adjustment 34-way: 40640 +Adjustment 35-way: 40477 +Adjustment 36-way: 40314 +Adjustment 37-way: 40149 +Adjustment 38-way: 39898 +Adjustment 39-way: 39707 +Adjustment 40-way: 39443 +Adjustment 41-way: 39248 +Adjustment 42-way: 39149 +Adjustment 43-way: 38934 +Adjustment 44-way: 38809 +Adjustment 45-way: 38633 +Adjustment 46-way: 38404 +Adjustment 47-way: 38206 +Adjustment 48-way: 38092 +Adjustment 49-way: 37997 +Adjustment 50-way: 37836 +Adjustment 51-way: 37660 +Adjustment 52-way: 37550 +Adjustment 53-way: 37440 +Adjustment 54-way: 37347 +Adjustment 55-way: 37260 +Adjustment 56-way: 37142 +Adjustment 57-way: 37047 +Adjustment 58-way: 36963 +Adjustment 59-way: 36879 +Adjustment 60-way: 36755 +Adjustment 61-way: 36673 +Adjustment 62-way: 36606 +Adjustment 63-way: 36505 +Adjustment 64-way: 36404 +Adjustment 65-way: 36305 +Adjustment 66-way: 36185 +Adjustment 67-way: 36079 +Adjustment 68-way: 36020 +Adjustment 69-way: 35905 +Adjustment 70-way: 35800 +Adjustment 71-way: 35705 +Adjustment 72-way: 35597 +Adjustment 73-way: 35532 +Adjustment 74-way: 35429 +Adjustment 75-way: 35333 +Adjustment 76-way: 35232 +Adjustment 77-way: 35170 +Adjustment 78-way: 35080 +Adjustment 79-way: 34984 +Adjustment 80-way: 34925 +Adjustment 81-way: 34831 +Adjustment 82-way: 34739 +Adjustment 83-way: 34647 +Adjustment 84-way: 34590 +Adjustment 85-way: 34500 +Adjustment 86-way: 34411 +Adjustment 87-way: 34356 +Adjustment 88-way: 34302 +Adjustment 89-way: 34282 +Adjustment 90-way: 34229 +Adjustment 91-way: 34176 +Adjustment 92-way: 34124 +Adjustment 93-way: 34073 +Adjustment 94-way: 34055 +Adjustment 95-way: 34004 +Adjustment 96-way: 33987 +Adjustment 97-way: 33937 +Adjustment 98-way: 33922 +Adjustment 99-way: 33873 +Adjustment 100-way: 33826 +Adjustment 101-way: 33812 +Adjustment 102-way: 33766 +Adjustment 103-way: 33753 +Adjustment 104-way: 33675 +Adjustment 105-way: 33599 +Adjustment 106-way: 33523 +Adjustment 107-way: 33448 +Adjustment 108-way: 33374 +Adjustment 109-way: 33300 +Adjustment 110-way: 33227 +Adjustment 111-way: 33155 +Adjustment 112-way: 33083 +Adjustment 113-way: 33012 +Adjustment 114-way: 32941 +Adjustment 115-way: 32871 +Adjustment 116-way: 32802 +Adjustment 117-way: 32733 +Adjustment 118-way: 32665 +Adjustment 119-way: 32597 +Adjustment 120-way: 32529 +Adjustment 121-way: 32462 +Adjustment 122-way: 32396 +Adjustment 123-way: 32330 +Adjustment 124-way: 32265 +Adjustment 125-way: 32200 +Adjustment 126-way: 32136 +Adjustment 127-way: 32072 +Adjustment 128-way: 32008 +Adjustment 129-way: 31945 + +LPAR Number: 20 +LPAR Characteristics: Shared +LPAR Name: VIRLP01 +LPAR Adjustment: 32 +LPAR CPUs Total: 4 +LPAR CPUs Configured: 4 +LPAR CPUs Standby: 0 +LPAR CPUs Reserved: 0 +LPAR CPUs Dedicated: 0 +LPAR CPUs Shared: 4 +LPAR CPUs G-MTID: 0 +LPAR CPUs S-MTID: 1 +LPAR CPUs PS-MTID: 1 diff --git a/tests/sysinfodata/s390-freqsysinfo.expect b/tests/sysinfodata/s390-freqsysinfo.expect new file mode 100644 index 00000000..577c7a28 --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.expect @@ -0,0 +1,63 @@ +<sysinfo type='smbios'> + <system> + <entry name='manufacturer'>IBM</entry> + <entry name='serial'>0000000000085F07</entry> + <entry name='family'>2964</entry> + </system> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> + <processor> + <entry name='family'>2964</entry> + <entry name='manufacturer'>IBM/S390</entry> + <entry name='version'>00</entry> + <entry name='max_speed'>5000</entry> + <entry name='serial_number'>145F07</entry> + </processor> +</sysinfo> diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 2b328281..a61da017 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -137,6 +137,7 @@ mymain(void) int ret = EXIT_SUCCESS; TEST("s390", virSysinfoReadS390); + TEST("s390-freq", virSysinfoReadS390); TEST("ppc", virSysinfoReadPPC); TEST_FULL("x86", virSysinfoReadX86, "/sysinfodata/dmidecode.sh"); TEST("arm", virSysinfoReadARM); -- 2.13.4

On Friday, 12 January 2018 12:38:02 CET Bjoern Walk wrote:
Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR.
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
LGTM, just a couple of notes that came into my mind when reading the existing sysinfodata for s390.
diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data [...] +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964
All the various "identification", and ...
diff --git a/tests/sysinfodata/s390-freqsysinfo.data b/tests/sysinfodata/s390-freqsysinfo.data new file mode 100644 index 00000000..1941ef0b --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.data @@ -0,0 +1,173 @@ +Manufacturer: IBM +Type: 2964 +Model: 704 NC9 +Sequence Code: 0000000000085F07
.. this value are replaced by what look like dummy values, so maybe the same should be done for this data too (in case they are sensitive information)? -- Pino Toscano

On 01/12/2018 07:44 AM, Pino Toscano wrote:
On Friday, 12 January 2018 12:38:02 CET Bjoern Walk wrote:
Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR.
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
LGTM, just a couple of notes that came into my mind when reading the existing sysinfodata for s390.
diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data [...] +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964
All the various "identification", and ...
diff --git a/tests/sysinfodata/s390-freqsysinfo.data b/tests/sysinfodata/s390-freqsysinfo.data new file mode 100644 index 00000000..1941ef0b --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.data @@ -0,0 +1,173 @@ +Manufacturer: IBM +Type: 2964 +Model: 704 NC9 +Sequence Code: 0000000000085F07
.. this value are replaced by what look like dummy values, so maybe the same should be done for this data too (in case they are sensitive information)?
I could adjust Sequence Code here too if desired. I see that tests/sysinfodata/s390sysinfo.data used 12345. Let me know... John
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

John Ferlan <jferlan@redhat.com> [2018-01-12, 08:04AM -0500]:
On 01/12/2018 07:44 AM, Pino Toscano wrote:
On Friday, 12 January 2018 12:38:02 CET Bjoern Walk wrote:
Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR.
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
LGTM, just a couple of notes that came into my mind when reading the existing sysinfodata for s390.
diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data [...] +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964
All the various "identification", and ...
diff --git a/tests/sysinfodata/s390-freqsysinfo.data b/tests/sysinfodata/s390-freqsysinfo.data new file mode 100644 index 00000000..1941ef0b --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.data @@ -0,0 +1,173 @@ +Manufacturer: IBM +Type: 2964 +Model: 704 NC9 +Sequence Code: 0000000000085F07
.. this value are replaced by what look like dummy values, so maybe the same should be done for this data too (in case they are sensitive information)?
I could adjust Sequence Code here too if desired. I see that tests/sysinfodata/s390sysinfo.data used 12345.
Let me know...
Sure, why not. Thanks for reviewing and cleaning up and pushing.
John
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Pino Toscano <ptoscano@redhat.com> [2018-01-12, 01:44PM +0100]:
On Friday, 12 January 2018 12:38:02 CET Bjoern Walk wrote:
Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR.
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
LGTM, just a couple of notes that came into my mind when reading the existing sysinfodata for s390.
Thanks.
diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data [...] +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964
All the various "identification", and ...
diff --git a/tests/sysinfodata/s390-freqsysinfo.data b/tests/sysinfodata/s390-freqsysinfo.data new file mode 100644 index 00000000..1941ef0b --- /dev/null +++ b/tests/sysinfodata/s390-freqsysinfo.data @@ -0,0 +1,173 @@ +Manufacturer: IBM +Type: 2964 +Model: 704 NC9 +Sequence Code: 0000000000085F07
.. this value are replaced by what look like dummy values, so maybe the same should be done for this data too (in case they are sensitive information)?
I let it check for any sensitive information, so hopefully, nothing is in here. You can anyways just reproduce those files, just buy a z13. Much appreciated :) Anyways, sure, we can mock those values, they are not relevant for the test.
-- Pino Toscano

On 01/12/2018 06:38 AM, Bjoern Walk wrote:
Let's add a test case for S390 with CPU frequency information available. Test data is sampled from an IBM z13 system running kernel 4.14 on LPAR.
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- tests/sysinfodata/s390-freqcpuinfo.data | 52 +++++++++ tests/sysinfodata/s390-freqsysinfo.data | 173 ++++++++++++++++++++++++++++++ tests/sysinfodata/s390-freqsysinfo.expect | 63 +++++++++++ tests/sysinfotest.c | 1 + 4 files changed, 289 insertions(+) create mode 100644 tests/sysinfodata/s390-freqcpuinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.data create mode 100644 tests/sysinfodata/s390-freqsysinfo.expect
diff --git a/tests/sysinfodata/s390-freqcpuinfo.data b/tests/sysinfodata/s390-freqcpuinfo.data new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/sysinfodata/s390-freqcpuinfo.data @@ -0,0 +1,52 @@ +vendor_id : IBM/S390 +# processors : 8 +bogomips per cpu: 20325.00 +max thread id : 1 +features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx sie +facilities : 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 64 65 66 67 68 69 70 71 72 73 75 76 77 78 80 128 129 131 132 142 143
The end of the "features" line has an additional space which git am complains about and of course I know from my previous push, that the git master would stop - I've cleaned it up as well as the %u instead of %n in patch 1 that Pino pointed out. Will push shortly - Reviewed-by: John Ferlan <jferlan@redhat.com> John
participants (3)
-
Bjoern Walk
-
John Ferlan
-
Pino Toscano