Merge ~bladernr/plainbox-provider-resource:1853877-fix-scaling-test-bug into plainbox-provider-resource:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Sylvain Pineau
Approved revision: a636faa62955315591eef811834a541086408c9d
Merged at revision: 96115aaabadb6a852006cf4eb27640b1e73b9e86
Proposed branch: ~bladernr/plainbox-provider-resource:1853877-fix-scaling-test-bug
Merge into: plainbox-provider-resource:master
Diff against target: 21 lines (+3/-0)
1 file modified
bin/cpuinfo_resource (+3/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+375982@code.launchpad.net

Commit message

Add a cpuinfo.governors resource to store available governors

Description of the change

Add a cpuinfo.governors resource to store available governors

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/cpuinfo_resource b/bin/cpuinfo_resource
index d385305..83ce78d 100755
--- a/bin/cpuinfo_resource
+++ b/bin/cpuinfo_resource
@@ -28,6 +28,8 @@ CPUINFO_FILENAME = "/proc/cpuinfo"
28# Filename where maximum frequency is stored.28# Filename where maximum frequency is stored.
29FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"29FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
3030
31# Filename where available frequency governors are stored.
32GOVERNORS_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
3133
32class CpuinfoResult:34class CpuinfoResult:
3335
@@ -40,6 +42,7 @@ class CpuinfoResult:
40 value = int(value) // 100042 value = int(value) // 1000
41 if value:43 if value:
42 print("%s: %s" % (key, value))44 print("%s: %s" % (key, value))
45 print("governors: %s" % open(GOVERNORS_FILENAME).read().strip())
4346
4447
45def main():48def main():

Subscribers

People subscribed via source and target branches