mirror of
https://github.com/ARM-software/devlib.git
synced 2025-11-10 02:41:21 +00:00
a9b9938b0fc5f2c9a3fc10ce99aea3056ac2a465
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)
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.
Description
Languages
Python
96%
Shell
1.8%
C
1.4%
Java
0.5%
Dockerfile
0.3%