Skip to content

Makefile: Clean up .gcda files in prof-gen. #8284

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

Closed
wants to merge 1 commit into from

Conversation

LeiW000
Copy link
Contributor

@LeiW000 LeiW000 commented Mar 31, 2022

The .gcda files generated by "$(MAKE) PROF_FLAGS=-fprofile-generate all"
should be removed. Otherwise, the profile data in them would be combined
with the profile data of user's workload.Then, they would be used by
"make prof-use" later.

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 1, 2022

Can any maintainer help to trigger the workflows? This is my first PR in PHP. :).

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 5, 2022

Can anyone help to take look at the PR?

@Girgias
Copy link
Member

Girgias commented Apr 5, 2022

I'm far from a build expert, and talking to someone else we had a quick look but don't know how to proceed with this.
Is the instructions to build such a build just a normal configure with make PROF_FLAGS="-fprofile-generate all"? and check the profiling with make prof-use?
If so I can try to make such a build myself and see if this works as intended, however, shouldn't this maybe be more part of a make clean procedure than just a make?

@cmb69
Copy link
Member

cmb69 commented Apr 5, 2022

If I understand correctly, the workflow is usually:

make prof-gen
# run workload
make prof-clean
make prof-use

If there are .gcda files right after make prof-gen (but before running the workload), these files should indeed be removed.

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 6, 2022

@cmb69 is right. User usually follows that workflow for PGO enabling. Currently, some .gcda files are generated after make prof-gen, because "php" is invoked during "make prof-gen".

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 6, 2022

I'm far from a build expert, and talking to someone else we had a quick look but don't know how to proceed with this. Is the instructions to build such a build just a normal configure with make PROF_FLAGS="-fprofile-generate all"? and check the profiling with make prof-use? If so I can try to make such a build myself and see if this works as intended, however, shouldn't this maybe be more part of a make clean procedure than just a make?

The "$(MAKE) PROF_FLAGS=-fprofile-generate all" is what is performed when "make prof-gen" is run. Please see line 136 in Makefile.global. If you want to test it yourself, you can run "make prof-gen". If you want to verify PGO, you can follow the steps, which @cmb69 provided in the comment.

The .gcda files generated by "$(MAKE) PROF_FLAGS=-fprofile-generate all"
should be removed. Otherwise, the profile data in them would be combined
with the profile data of user's workload.Then, they would be used by
"make prof-use" later.
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

This looks good to me. Maybe someone who actually does PGO on a POSIX system can confirm.

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 8, 2022

Is there any other comment? If not, can the PR be merged now?

@LeiW000
Copy link
Contributor Author

LeiW000 commented Apr 11, 2022

@cmb69, could you help to merge the PR? Or, do I have to contact another maintainer for merging?

@cmb69 cmb69 closed this in c4a9d1e Apr 11, 2022
@cmb69
Copy link
Member

cmb69 commented Apr 11, 2022

Thank you!

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