Re: [PATCH v2] PM / EM: Expose the Energy Model in debugfs

From: Rafael J. Wysocki
Date: Thu Jan 24 2019 - 05:46:59 EST


On Wednesday, January 23, 2019 10:28:36 AM CET Quentin Perret wrote:
> On Tuesday 22 Jan 2019 at 19:41:36 (+0100), Greg KH wrote:
> > On Tue, Jan 22, 2019 at 04:42:47PM +0000, Quentin Perret wrote:
> > > The recently introduced Energy Model (EM) framework manages power cost
> > > tables of CPUs. These tables are currently only visible from kernel
> > > space. However, in order to debug the behaviour of subsystems that use
> > > the EM (EAS for example), it is often required to know what the power
> > > costs are from userspace.
> > >
> > > For this reason, introduce under /sys/kernel/debug/energy_model a set of
> > > directories representing the performance domains of the system. Each
> > > performance domain contains a set of sub-directories representing the
> > > different capacity states (cs) and their attributes, as well as a file
> > > exposing the related CPUs.
> > >
> > > The resulting hierarchy is as follows on Arm juno r0 for example:
> > >
> > > /sys/kernel/debug/energy_model
> > > âââ pd0
> > > â âââ cpus
> > > â âââ cs:450000
> > > â â âââ cost
> > > â â âââ frequency
> > > â â âââ power
> > > â âââ cs:575000
> > > â â âââ cost
> > > â â âââ frequency
> > > â â âââ power
> > > â âââ cs:700000
> > > â â âââ cost
> > > â â âââ frequency
> > > â â âââ power
> > > â âââ cs:775000
> > > â â âââ cost
> > > â â âââ frequency
> > > â â âââ power
> > > â âââ cs:850000
> > > â âââ cost
> > > â âââ frequency
> > > â âââ power
> > > âââ pd1
> > > âââ cpus
> > > âââ cs:1100000
> > > â âââ cost
> > > â âââ frequency
> > > â âââ power
> > > âââ cs:450000
> > > â âââ cost
> > > â âââ frequency
> > > â âââ power
> > > âââ cs:625000
> > > â âââ cost
> > > â âââ frequency
> > > â âââ power
> > > âââ cs:800000
> > > â âââ cost
> > > â âââ frequency
> > > â âââ power
> > > âââ cs:950000
> > > âââ cost
> > > âââ frequency
> > > âââ power
> > >
> > > Signed-off-by: Quentin Perret <quentin.perret@xxxxxxx>
> > >
> > > ---
> > >
> > > V2: removed check on return value of debugfs_create_* (Greg KH)
> > > ---
> > > kernel/power/energy_model.c | 57 +++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 57 insertions(+)
> >
> > Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Applied, thanks!