Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twister: Fix ram/rom reporting #34287

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

PerMac
Copy link
Member

@PerMac PerMac commented Apr 14, 2021

The info of rom/ram usage by an application was lost along the
way of data processing in twister. The PR add a line which
pass further these metrices as well.
In addition a logic for memory footprint reporting is fixed.
With the previous logic memory footprint can only be saved in a report
if a given test/sample was fully executed and passed (built and run),
hence build-only tests were not providing these metrics. This PR
modifies the logic so that it is enough to have the build successful
to be able to get the memory footprint.

Fixes #34272

Signed-off-by: Maciej Perkowski Maciej.Perkowski@nordicsemi.no

The info of rom/ram usage by an application was lost along the
way of data processing in twister. The commit add a line which
pass further these metrices as well.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
@PerMac PerMac requested a review from nashif as a code owner April 14, 2021 15:03
@github-actions github-actions bot added the area: Twister Twister label Apr 14, 2021
@PerMac
Copy link
Member Author

PerMac commented Apr 14, 2021

The difference can be seen in the generated json report while calling

./scripts/twister -T /home/maciej/zephyrproject2/zephyr/samples/hello_world -p qemu_x86 --show-footprint --json-report

with and without the above commit

@PerMac
Copy link
Member Author

PerMac commented Apr 14, 2021

I still see that the data is missing in the report when using --build-only. Will debug further

With the previous logic memory footprint can only be saved in a report
if a given test/sample was fully executed and passed (built and run),
hence build-only tests were not providing these metrics. This commit
modifies the logic so that it is enough to have the build successful
to be able to get the memory footprint.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
@PerMac
Copy link
Member Author

PerMac commented Apr 15, 2021

The second commit fixes memory footprint reporting for build-only tests.

@nashif nashif merged commit 484ef67 into zephyrproject-rtos:master Apr 19, 2021
Copy link
Collaborator

@hakehuang hakehuang left a comment

Choose a reason for hiding this comment

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

some enhancement, sorry for later submit

@@ -1215,6 +1215,7 @@ def main():
except queue.Empty:
break
else:
inst.metrics.update(suite.instances[inst.name].metrics)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe below code would be more safe.

ram_size = suite.instance.metrics.get("ram_size", 0)
rom_size = suite.instance.metrics.get("rom_size", 0)
inst.metrics["ram_size"] = ram_size
inst.metrics["rom_size"] = rom_size

@PerMac PerMac deleted the pr/fix_mem_foot_report branch July 17, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twister: Add memory footprint info to json report
4 participants