From c9f7e0e066af59d20f223a917233426146c410ed Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Tue, 6 Dec 2016 11:49:46 +0000 Subject: [PATCH] cpuidle: Add docstrings for properties requiring units Unit info from comments on `struct cpuidle_state` definition in include/linux/cpuidle.h in Linux 4.9 source (see drivers/cpuidle/sysfs.c for the code that exposes that data to userspace) --- devlib/module/cpuidle.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/devlib/module/cpuidle.py b/devlib/module/cpuidle.py index 53e3d94..fd986c0 100644 --- a/devlib/module/cpuidle.py +++ b/devlib/module/cpuidle.py @@ -61,16 +61,29 @@ class CpuidleState(object): @property @memoized def latency(self): + """Exit latency in uS""" return self.get('latency') @property @memoized def power(self): + """Power usage in mW + + ..note:: + + This value is not always populated by the kernel and may be garbage. + """ return self.get('power') @property @memoized def target_residency(self): + """Target residency in uS + + This is the amount of time in the state required to 'break even' on + power - the system should avoid entering the state for less time than + this. + """ return self.get('residency') def enable(self):