1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00
Go to file
Josh Choo a9b9938b0f module/sched: Return the correct maximum capacity
The existing behaviour assumes that the cap_states file contains a list
of capacity|cost pairs, and attempts to return the maximum capacity by
selecting the value at the second last index of the list.

This assumption fails on some newer Qualcomm kernels where the
cap_states file contains a list of capacity|frequency|cost triplets.
Consequently, the maximum frequency would be erroneously returned
instead of the maximum capacity.

Fix the problem by dynamically calculating the index of the maximum
capacity by dividing the number of entries in cap_states by the value in
nr_cap_states.

---

For example, on a certain Snapdragon 845 device:

/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/cap_states
        54 entries:

        CAP     FREQ    COST
        --------------------
        65	300000	12
        87	403200	17
        104	480000	21
        125	576000	27
        141	652800	31
        162	748800	37
        179     825600	42
        195	902400	47
        212	979200	52
        228	1056000	57
        245	1132800	62
        266	1228800	70
        286	1324800 78
        307	1420800	89
        328	1516800	103
        348	1612800	122
        365	1689600	141
        381	1766400	160

/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/nr_cap_states
        18

Max capacity = 381 (third-last index)
2019-07-09 09:04:34 +01:00
devlib module/sched: Return the correct maximum capacity 2019-07-09 09:04:34 +01:00
doc doc: Explain the 'tar' flag of target.read_tree_values 2019-02-01 11:21:09 +00:00
src readenergy: update table headers 2017-12-12 09:24:03 +00:00
tests target: read_tree_values: handle multiline values 2018-08-29 16:17:19 +01:00
.gitignore Add build/ and dist/ to .gitingore 2017-04-26 17:19:55 +01:00
README.rst README: Add link to documentation on readthedocs 2018-04-10 17:36:04 +01:00
setup.py setup.py: Set maximum package version for python2.7 support 2019-07-08 13:46:19 +01:00

devlib
======

``devlib`` exposes an interface for interacting with and collecting
measurements from a variety of devices (such as mobile phones, tablets and
development boards) running a Linux-based operating system.


Installation
------------

::

        sudo -H pip install devlib


Usage
-----

Please refer  to the "Overview" section of the `documentation <http://devlib.readthedocs.io/en/latest/>`_.


License
-------

This package is distributed under `Apache v2.0 License <http://www.apache.org/licenses/LICENSE-2.0>`_. 


Feedback, Contrubutions and Support
-----------------------------------

- Please use the GitHub Issue Tracker associated with this repository for
  feedback.
- ARM licensees may contact ARM directly via their partner managers.
- We welcome code contributions via GitHub Pull requests. Please try to
  stick to the style in the rest of the code for your contributions.