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

Update create_gcov to work with version 2 of AutoFDO file format. #117

Merged
merged 1 commit into from
Jul 10, 2021

Conversation

erozenfeld
Copy link
Contributor

The following set of GCC commits has recently changed the format of gcov files:

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8819c82ce814a6911e2c1bfebd60b1c2366a3805
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c0954059dba9b369439bcb77643655e42f9a181e
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6871b899b831b4cb36a24033557c835e53c0b07f

The first commit changed the way strings are stored in the file. Before the change,
the size of the string was stored in words followed by the string padded so that
the size is a multiple of 4. After the change, the size is stored in bytes and there is
no padding.

The second commit bumped the version of AutoFDO file format from 1 to 2.

The last two commits updated the documentation.

This change updates create_gcov to support both the old format (when the version is not 2)
and the new format (when the version is 2).

I also cleaned up gcov_var that had a couple of unused fields.

The following set of GCC commits has recently changed the format of gcov files:

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8819c82ce814a6911e2c1bfebd60b1c2366a3805
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c0954059dba9b369439bcb77643655e42f9a181e
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6871b899b831b4cb36a24033557c835e53c0b07f

The first commit changed the way strings are stored in the file. Before the change,
the size of the string was stored in words followed by the string padded so that
the size is a multiple of 4. After the change, the size is stored in bytes and there is
no padding.

The second commit bumped the version of AutoFDO file format from 1 to 2.

The last two commits updated the documentation.

This change updates create_gcov to support both the old format (when the version is not 2)
and the new format (when the version is 2).

I also cleaned up gcov_var that had a couple of unused fields.
@erozenfeld
Copy link
Contributor Author

@wmi0 PTAL

@erozenfeld
Copy link
Contributor Author

@wmi0 ping. Without this or a similar change the trunk version of GCC can't use AutoFDO.

@wmi0
Copy link
Collaborator

wmi0 commented Jul 8, 2021 via email

Copy link
Collaborator

@wmi0 wmi0 left a comment

Choose a reason for hiding this comment

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

Thanks for contributing the change.

@wmi0 wmi0 merged commit ec61950 into google:master Jul 10, 2021
@wmi0
Copy link
Collaborator

wmi0 commented Jul 10, 2021

Thanks Eugene. I merged the change.

nstester pushed a commit to nstester/gcc that referenced this pull request Aug 3, 2021
* create_gcov tool doesn't currently support dwarf 5 so I made a change in profopt.exp
  to pass -gdwarf-4 when compiling the binary to profile.

* I updated the invocation of create_gcov in profopt.exp to pass -gcov_version=2.
  I recently made a change to create_gcov to support version 2:
  google/autofdo#117 .

* I removed useless -o perf.data from the invocation of gcc-auto-profile in
  target-supports.exp.

These changes contribute to fixing PR gcov-profile/71672.

gcc/testsuite/ChangeLog:

	* lib/profopt.exp: Pass gdwarf-4 when compiling test to profile; pass -gcov_version=2.
	* lib/target-supports.exp: Remove unnecessary -o perf.data passed to gcc-auto-profile.
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.

None yet

2 participants