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
1diff --git a/bin/cpuinfo_resource b/bin/cpuinfo_resource
2index d385305..83ce78d 100755
3--- a/bin/cpuinfo_resource
4+++ b/bin/cpuinfo_resource
5@@ -28,6 +28,8 @@ CPUINFO_FILENAME = "/proc/cpuinfo"
6 # Filename where maximum frequency is stored.
7 FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
8
9+# Filename where available frequency governors are stored.
10+GOVERNORS_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
11
12 class CpuinfoResult:
13
14@@ -40,6 +42,7 @@ class CpuinfoResult:
15 value = int(value) // 1000
16 if value:
17 print("%s: %s" % (key, value))
18+ print("governors: %s" % open(GOVERNORS_FILENAME).read().strip())
19
20
21 def main():

Subscribers

People subscribed via source and target branches