Skip to content

[FRAME] Custom log level for the runtime benchmarks#8857

Merged
bkontur merged 16 commits intomasterfrom
oty-omni-bencher-custom-level
Jul 30, 2025
Merged

[FRAME] Custom log level for the runtime benchmarks#8857
bkontur merged 16 commits intomasterfrom
oty-omni-bencher-custom-level

Conversation

@ggwpez
Copy link
Copy Markdown
Member

@ggwpez ggwpez commented Jun 15, 2025

Changes:

  • Add --runtime-log option to omni-bencher CLI
  • Read env var RUNTIME_LOG as fallback to the --runtime-log option
  • Set custom log level for runtime benchmarks that can be different form CLI level
  • Fix issue where old runtimes have a space in the pallet or instance name from breaking change in quote macro

Note: I saw that the genesis builder is not using the provided host functions, hence it still logs things during genesis config building.

ggwpez added 4 commits June 15, 2025 15:52
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez
Copy link
Copy Markdown
Member Author

ggwpez commented Jun 15, 2025

/cmd prdoc --audience runtime_dev --bump minor

@ggwpez ggwpez added the T12-benchmarks This PR/Issue is related to benchmarking and weights. label Jun 15, 2025
github-actions bot and others added 5 commits June 15, 2025 14:17
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez marked this pull request as ready for review June 15, 2025 14:28
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
/// - Default logger settings
pub fn init(arg: Option<LevelFilter>) {
let level = arg.unwrap_or_else(|| {
if let Ok(env) = std::env::var("RUNTIME_LOG") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you tried this? From the code, it seems that FromStr for LevelFilter is only for parsing Debug etc and not something=debug?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I changed it now to be a filter in the last commit a859efb
Not sure if its worth the additional complexity though, since I only added this feature to turn the annoying logs off 😆
Also the runtime filter can never have a level greater than the node filter, since it is still limited by that.

ggwpez and others added 3 commits June 16, 2025 14:47
Co-authored-by: Bastian Köcher <git@kchr.de>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/15682254926
Failed job name: test-linux-stable-no-try-runtime

@bkchr bkchr enabled auto-merge July 30, 2025 12:25
@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 30, 2025

/cmd fmt

@bkchr bkchr added this pull request to the merge queue Jul 30, 2025
@bkontur bkontur added A4-backport-stable2503 A4-backport-stable2506 Pull request must be backported to the stable2506 release branch A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch labels Jul 30, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 30, 2025
@bkontur bkontur enabled auto-merge July 30, 2025 13:50
@bkontur bkontur added this pull request to the merge queue Jul 30, 2025
Merged via the queue into master with commit e1d67cf Jul 30, 2025
239 of 243 checks passed
@bkontur bkontur deleted the oty-omni-bencher-custom-level branch July 30, 2025 15:03
@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for stable2503:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-8857-to-stable2503
git worktree add --checkout .worktree/backport-8857-to-stable2503 backport-8857-to-stable2503
cd .worktree/backport-8857-to-stable2503
git reset --hard HEAD^
git cherry-pick -x e1d67cfe40801a893cdc27f7da0eb4e3e4fba1ce
git push --force-with-lease

@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for stable2506:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-8857-to-stable2506
git worktree add --checkout .worktree/backport-8857-to-stable2506 backport-8857-to-stable2506
cd .worktree/backport-8857-to-stable2506
git reset --hard HEAD^
git cherry-pick -x e1d67cfe40801a893cdc27f7da0eb4e3e4fba1ce
git push --force-with-lease

@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for unstable2507:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-8857-to-unstable2507
git worktree add --checkout .worktree/backport-8857-to-unstable2507 backport-8857-to-unstable2507
cd .worktree/backport-8857-to-unstable2507
git reset --hard HEAD^
git cherry-pick -x e1d67cfe40801a893cdc27f7da0eb4e3e4fba1ce
git push --force-with-lease

bkontur added a commit that referenced this pull request Jul 31, 2025
Backport #8857 into `unstable2507` from ggwpez.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
bkontur added a commit that referenced this pull request Aug 13, 2025
Backport #8857 into `stable2506` from ggwpez.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
Changes:
- Add `--runtime-log` option to omni-bencher CLI
- Read env var `RUNTIME_LOG` as fallback to the `--runtime-log` option
- Set custom log level for runtime benchmarks that can be different form
CLI level
- Fix issue where old runtimes have a space in the pallet or instance
name from breaking change in `quote` macro

Note: I saw that the genesis builder is not using the provided host
functions, hence it still logs things during genesis config building.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2506 Pull request must be backported to the stable2506 release branch A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch T12-benchmarks This PR/Issue is related to benchmarking and weights.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants