Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Marvin1973:pcs
rubygem-ohai-6
Support-IBM-System-z-s390-cpu.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Support-IBM-System-z-s390-cpu.patch of Package rubygem-ohai-6
From cc9c390fc07032fc0f9bc689b46f23bd9f85395c Mon Sep 17 00:00:00 2001 From: shuo zhang <shuozhang@cn.ibm.com> Date: Tue, 2 Dec 2014 15:21:36 +0800 Subject: [PATCH] Support IBM System z s390 cpu --- lib/ohai/plugins/linux/cpu.rb | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/ohai/plugins/linux/cpu.rb b/lib/ohai/plugins/linux/cpu.rb index 48468a5..02ec097 100644 --- a/lib/ohai/plugins/linux/cpu.rb +++ b/lib/ohai/plugins/linux/cpu.rb @@ -30,7 +30,12 @@ File.open("/proc/cpuinfo").each do |line| current_cpu = $1 cpu_number += 1 when /vendor_id\s+:\s(.+)/ - cpuinfo[current_cpu]["vendor_id"] = $1 + vendor_id = $1 + if vendor_id =~ (/IBM\/S390/) + cpuinfo["vendor_id"] = vendor_id + else + cpuinfo[current_cpu]["vendor_id"] = vendor_id + end when /cpu family\s+:\s(.+)/ cpuinfo[current_cpu]["family"] = $1 when /model\s+:\s(.+)/ @@ -52,9 +57,24 @@ File.open("/proc/cpuinfo").each do |line| cpuinfo[current_cpu]["cache_size"] = $1 when /flags\s+:\s(.+)/ cpuinfo[current_cpu]["flags"] = $1.split(' ') + when /bogomips per cpu:\s(.+)/ + cpuinfo["bogomips_per_cpu"] = $1 + when /features\s+:\s(.+)/ + cpuinfo["features"] = $1.split(' ') + when /processor\s(\d):\s(.+)/ + current_cpu = $1 + cpu_number += 1 + cpuinfo[current_cpu] = Mash.new + current_cpu_info = $2.split(',') + for i in current_cpu_info + name_value = i.split('=') + name = name_value[0].strip + value = name_value[1].strip + cpuinfo[current_cpu][name] = value + end end end cpu cpuinfo cpu[:total] = cpu_number -cpu[:real] = real_cpu.keys.length \ No newline at end of file +cpu[:real] = real_cpu.keys.length -- 2.3.7
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor