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

profile: add program memory segment usage analysis #261

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

xiaokamikami
Copy link
Contributor

@xiaokamikami xiaokamikami commented Jan 29, 2024

When MEMORY_REGION_ANALYSISis configured, the program's memory segment usage analysis is started and printed or exported to a file. The path is set using --mem_use_record_file, and the analysis is performed in 32MB block units by default

@xiaokamikami xiaokamikami force-pushed the mem-analysis branch 2 times, most recently from 182c77d to 2a074ae Compare January 29, 2024 07:33
@xiaokamikami xiaokamikami requested a review from shinezyy January 29, 2024 08:41
Kconfig Outdated
@@ -308,6 +308,16 @@ config TIMER_CLOCK_GETTIME
bool "clock_gettime"
endchoice

config PROGRAM_ANALYSIS
Copy link
Contributor

Choose a reason for hiding this comment

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

program analysis 这个词太宽泛了,建议改为 memory region analysis

if (display_file == true) {
FILE* fp = fopen(any_mem_file,"wr");
for (int i = 0; i < PROGRAM_ANALYSIS_PAGES; i++) {
if (mem_addr_ues[i]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

mem_addr_ues -> mem_addr_use

if (mem_addr_ues[i]) {
char result[32];
if (display_file) {
sprintf(result,"%d\n",i);
Copy link
Contributor

Choose a reason for hiding this comment

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

逗号后面应该有空格:
sprintf(result, "%d\n",i);

case 'A':
#ifdef CONFIG_PROGRAM_ANALYSIS
Log("Set mem analysis log path %s",optarg);
any_mem_file = optarg;
Copy link
Contributor

Choose a reason for hiding this comment

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

any_mem_file 这个名字太奇怪了,建议改为 memory_region_record_file

@@ -247,6 +256,7 @@ static inline int parse_args(int argc, char *argv[]) {

printf("\t--simpoint-profile simpoint profiling\n");
printf("\t--dont-skip-boot profiling/checkpoint immediately after boot\n");
printf("\t--analysis-mem-path result output file for analyzing the memory use segment\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

--analysis-mem-path 建议改为 memory_region_record_file 类似的词汇

@xiaokamikami
Copy link
Contributor Author

修改好了

@xiaokamikami xiaokamikami changed the title profile: Increase program memory segment usage analysis profile: add program memory segment usage analysis Jan 30, 2024
Copy link
Contributor

@shinezyy shinezyy left a comment

Choose a reason for hiding this comment

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

Ok

@shinezyy shinezyy merged commit 0825255 into master Jan 30, 2024
4 checks passed
@shinezyy shinezyy deleted the mem-analysis branch January 30, 2024 02:06
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.

2 participants