Skip to content

feature: Add more power APIs to L0 Sysman python binding - #520

Open
aviralni wants to merge 6 commits into
oneapi-src:masterfrom
aviralni:pyzes_power_apis
Open

aviralni wants to merge 6 commits into
oneapi-src:masterfrom
aviralni:pyzes_power_apis

Conversation

@aviralni

@aviralni aviralni commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

feature: Add more power APIs to L0 Sysman python binding
Added following power APIs to python binding:

  1. zesPowerGetUsage
  2. zesPowerGetLimitsExt2
  3. zesPowerSetLimitsExt2
  4. zesPowerGetEnergyThreshold
  5. zesPowerSetEnergyThreshold

Related-To: SYSM-430

Signed-off-by: Aviral Nigam aviral.nigam@intel.com

@aviralni
aviralni force-pushed the pyzes_power_apis branch 2 times, most recently from 6b09af3 to 143c652 Compare September 23, 2026 10:48
@joshuaranjan
joshuaranjan requested a balanced review from Copilot September 24, 2026 05:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Moderate issues can cause unintended hardware changes, invalid inputs, or silently skipped operations.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds five power-management APIs to the Python Sysman binding, including tests, examples, CLI controls, and documentation.

Changes:

  • Adds usage, extended-limit, and energy-threshold wrappers.
  • Adds unit and black-box coverage.
  • Documents the new APIs.
File Description
bindings/​sysman/​python/​test/​unit_tests/​test_power.py Tests the new power API wrappers.
bindings/​sysman/​python/​source/​pyzes.py Adds ctypes structures and API wrappers.
bindings/​sysman/​python/​source/​examples/​pyzes_black_box_test.py Adds runtime checks and setter CLI options.
bindings/​sysman/​python/​README.md Documents the newly supported APIs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bindings/sysman/python/source/examples/pyzes_black_box_test.py Outdated
Comment thread bindings/sysman/python/source/examples/pyzes_black_box_test.py Outdated
Comment thread bindings/sysman/python/README.md Outdated
Added following power APIs to python binding:

1. zesPowerGetUsage
2. zesPowerGetLimitsExt2
3. zesPowerSetLimitsExt2
4. zesPowerGetEnergyThreshold
5. zesPowerSetEnergyThreshold

Along with the zes_energy_threshold_t structure, unit tests, power
black box test coverage and README updates.

Related-To: SYSM-430

Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>
… black box test

canControl only reports whether the power limits can be changed, and
energy threshold support is reported independently. Check each setter
against its own capability, so --set-energy-threshold is not skipped on
a domain that supports thresholds but not power limit control.

Related-To: SYSM-430
Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>
zello_sysman sets a power limit with -o --setlimit --global-limit
<deviceNo limit>. Replace --set-global-limit DEVICE LIMIT_MW with the same
two options so both tools take the same command line; they must be given
together.

Related-To: SYSM-430
Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>
Added following power APIs to python binding:

1. zesPowerGetUsage
2. zesPowerGetLimitsExt2
3. zesPowerSetLimitsExt2
4. zesPowerGetEnergyThreshold
5. zesPowerSetEnergyThreshold

Along with the zes_energy_threshold_t structure, unit tests, power
black box test coverage and README updates.

Related-To: SYSM-430

Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>
joshuaranjan
joshuaranjan previously approved these changes Oct 9, 2026
Comment thread bindings/sysman/python/README.md Outdated
| `zesPowerGetProperties` | Power | 0.1.2 | None |
| `zesPowerGetLimitsExt` | Power | 0.1.2 | Extended power limits API |
| `zesPowerSetLimitsExt` | Power | 0.1.2 | Linux: Requires superuser or write permissions for telem nodes |
| `zesPowerGetUsage` | Power | 0.1.3 | None |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs super user too no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Thanks or pointing out.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aviralni
Please check all the new APIs..
Create a script to verify this by running blackbox test (on the actual machine)

@shubskmr shubskmr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add the jira in the commit message?
are the output attached there?

@aviralni

aviralni commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

can you please add the jira in the commit message? are the output attached there?

Done. Yes outputs are attached

Added following power APIs to python binding:

1. zesPowerGetUsage
2. zesPowerGetLimitsExt2
3. zesPowerSetLimitsExt2
4. zesPowerGetEnergyThreshold
5. zesPowerSetEnergyThreshold

Along with the zes_energy_threshold_t structure, unit tests, power
black box test coverage and README updates.

Related-To: SYSM-430

Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants