Skip to content

Conversation

@lyakh
Copy link
Collaborator

@lyakh lyakh commented Feb 17, 2025

Calculate and print percentage of cold text and data when building loadable modules.

Calculate and print percentage of cold text and data when building
loadable modules.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh
Copy link
Collaborator Author

lyakh commented Feb 17, 2025

hm, I want a build log with xt-clang, so have to enable jenkins testing

@lyakh lyakh changed the title [SKIP SOF-TEST] rimage: print cold data and text percentage rimage: print cold data and text percentage Feb 17, 2025
@lyakh
Copy link
Collaborator Author

lyakh commented Feb 17, 2025

SOFCI TEST

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

A few questions inline.

size = module->text.size + cold_text_size;
rounded = ALIGN_UP(end, MAN_PAGE_SIZE) - start;
fprintf(stdout,
" module: text %zu (0x%zx) bytes, including %zu (0x%zx) %zu%% efficiency bytes\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

"efficiency bytes" ?

Copy link
Member

Choose a reason for hiding this comment

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

efficient memory i.e. not higher power SRAM

fprintf(stdout,
"\tdata %zu (0x%zx) bytes, including %zu (0x%zx) %zu%% efficiency bytes\n",
size, size, cold_data_size, cold_data_size,
rounded ? (cold_data_size * 100 + rounded / 2) / rounded : 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not very obvious math here. with cold_data_size*100+bytes in nominator, seems like you are adding percentages to bytes here...?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kv2019i rounding to the nearest integer :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

right, right, the example builds for this PR have it as all zeros, but indeed this is good.

fprintf(stdout,
"\tdata %zu (0x%zx) bytes, including %zu (0x%zx) %zu%% efficiency bytes\n",
size, size, cold_data_size, cold_data_size,
rounded ? (cold_data_size * 100 + rounded / 2) / rounded : 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

right, right, the example builds for this PR have it as all zeros, but indeed this is good.

@kv2019i kv2019i merged commit 54608f0 into thesofproject:main Feb 18, 2025
48 of 51 checks passed
@lyakh lyakh deleted the per100 branch February 18, 2025 12:46
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.

3 participants