Skip Menu |

This queue is for tickets about the Sys-CPU CPAN distribution.

Report information
The Basics
Id: 95400
Status: new
Priority: 0/
Queue: Sys-CPU

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.61
Fixed in: (no value)



Subject: Tests fail on ARM and AArch64 Linux
The cpu_type test fails on ARM and AArch64 platforms because the CPU type is declared under different /proc/cpuinfo entry. This can be fixed with attached 0001-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch patch. The cpu_clock test fails on AArch64 platform for me because there is not clock info in the /proc/cpuinfo. I have also seen similar issue on 32-bit ARM <https://bugzilla.redhat.com/show_bug.cgi?id=928059>. Thus the 0002-cpu_clock-can-be-undefined-on-an-ARM.patch patch allows undefined value cpu_clock value on this platforms in the test. I tested the patches on an ARMv6 and AArch64 machine successfully. I did not found any regressions on s390, s390x, PPC, PPC64, x86_64, and i686.
Subject: 0001-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch
From f77b2b0c795f5d2ad7a85ae3bfffcf74232836ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 6 May 2014 08:47:16 +0200 Subject: [PATCH 1/2] Add support for cpu_type on ARM and AArch64 Linux platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CPU type is listed as Processor (upper-cased P) entry. SMP systems enumerate cores by processor (lower-cased P) entries in addition. The Processor is always first, so case-insesitive look-up is not a problem. Signed-off-by: Petr Písař <ppisar@redhat.com> --- CPU.xs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CPU.xs b/CPU.xs index 236b14d..067c9cb 100644 --- a/CPU.xs +++ b/CPU.xs @@ -395,6 +395,9 @@ CODE: sysctlbyname("hw.model", value, &len, NULL, 0); #endif #ifdef __linux__ +#if defined __arm__ || defined __aarch64__ + value = proc_cpuinfo_field ("Processor"); +#endif #if defined __s390__ || defined __s390x__ value = processor_machine_field (proc_cpuinfo_field ("processor") ); #endif -- 1.9.0
Subject: 0002-cpu_clock-can-be-undefined-on-an-ARM.patch
From 32c01db384d8ee22ed1a365378f431a3b7241ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 6 May 2014 09:12:16 +0200 Subject: [PATCH 2/2] cpu_clock can be undefined on an ARM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some ARM boards do not publish CPU clock. Signed-off-by: Petr Písař <ppisar@redhat.com> --- Makefile.PL | 1 + t/Sys-CPU.t | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile.PL b/Makefile.PL index 910c77a..4e72025 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,4 +13,5 @@ WriteMakefile( 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' 'INC' => '', # e.g., '-I/usr/include/other' 'dynamic_lib' => {OTHERLDFLAGS => $extra_arg}, + 'BUILD_REQUIRES' => {'Config' => 0 }, ); diff --git a/t/Sys-CPU.t b/t/Sys-CPU.t index 9edaaa3..e6dce80 100755 --- a/t/Sys-CPU.t +++ b/t/Sys-CPU.t @@ -8,6 +8,7 @@ BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} +use Config; use Sys::CPU; $loaded = 1; print "ok 1\n"; @@ -24,6 +25,8 @@ if (defined($speed)) { print "ok 3 (CPU Speed : $speed)\n"; } elsif ( $^O eq 'MSWin32'){ print "ok 3 (CPU Speed: test skipped on MSWin32)\n"; +} elsif ($Config{archname} =~ /^(armv|aarch64)/ ) { + print "ok 3 (CPU Speed: test skipped on ARM and AArch64)\n"; } else { print "not ok 3 (cpu_clock undefined (ok if Win9x))\n"; } -- 1.9.0
From: ppisar [...] redhat.com
Dne Út 06.Květen.2014 03:45:08, ppisar napsal(a): Show quoted text
> The cpu_clock test fails on AArch64 platform for me because there is > not clock info in the /proc/cpuinfo. I have also seen similar issue on > 32-bit ARM <https://bugzilla.redhat.com/show_bug.cgi?id=928059>. Thus > the 0002-cpu_clock-can-be-undefined-on-an-ARM.patch patch allows > undefined value cpu_clock value on this platforms in the test. > > I tested the patches on an ARMv6 and AArch64 machine successfully. I > did not found any regressions on s390, s390x, PPC, PPC64, x86_64, and > i686.
Attached patch replaces the former 0002-cpu_clock...patch as some ARMv7 machines does not have the 'v' in the arch name. -- Petr
Subject: 0002-cpu_clock-can-be-undefined-on-an-ARM.patch
From ceaef15d1391e37623aaf18d6614a4bbf35a3607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 6 May 2014 09:12:16 +0200 Subject: [PATCH 2/2] cpu_clock can be undefined on an ARM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some ARM boards do not publish CPU clock. Signed-off-by: Petr Písař <ppisar@redhat.com> --- Makefile.PL | 1 + t/Sys-CPU.t | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile.PL b/Makefile.PL index 910c77a..4e72025 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,4 +13,5 @@ WriteMakefile( 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' 'INC' => '', # e.g., '-I/usr/include/other' 'dynamic_lib' => {OTHERLDFLAGS => $extra_arg}, + 'BUILD_REQUIRES' => {'Config' => 0 }, ); diff --git a/t/Sys-CPU.t b/t/Sys-CPU.t index 9edaaa3..4246b22 100755 --- a/t/Sys-CPU.t +++ b/t/Sys-CPU.t @@ -8,6 +8,7 @@ BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} +use Config; use Sys::CPU; $loaded = 1; print "ok 1\n"; @@ -24,6 +25,8 @@ if (defined($speed)) { print "ok 3 (CPU Speed : $speed)\n"; } elsif ( $^O eq 'MSWin32'){ print "ok 3 (CPU Speed: test skipped on MSWin32)\n"; +} elsif ($Config{archname} =~ /^(arm|aarch64)/ ) { + print "ok 3 (CPU Speed: test skipped on ARM and AArch64)\n"; } else { print "not ok 3 (cpu_clock undefined (ok if Win9x))\n"; } -- 1.9.3