Commit Graph

5 Commits

Author SHA1 Message Date
Jakub Jelinek
83ffe9cde7 Update copyright years. 2023-01-16 11:52:17 +01:00
Xi Ruoyao
1528957695
contrib: modernize gen_autofdo_event.py
Python 2 has been EOL'ed for two years.  egrep has been deprecated
for many years and the next grep release will start to print warning if
it is used.

-E option may be unsupported by some non-POSIX grep implementations, but
gcc-auto-profile won't work on non-Linux systems anyway.

contrib/ChangeLog:

	* gen_autofdo_event.py: Port to Python 3, and use grep -E
	instead of egrep.

gcc/ChangeLog:

	* config/i386/gcc-auto-profile: Regenerate.
2022-08-27 11:44:13 +08:00
Eugene Rozenfeld
01d402c5e0 Update gen_autofdo_event.py and gcc-auto-profile.
gen_autofdo_event.py was stumbling on models with stepping so
I updated the script to handle this case similar to the code in
c6a5f63aed/event_download.py

The second change was to tolerate cases when the CPU supports PEBS but the
perf command with /p fails. This can happen in, e.g., a virtual machine.

I regenerated gcc-auto-profile using the updated script.

contrib/ChangeLog:

	* gen_autofdo_event.py: handle stepping, non-working PEBS

gcc/ChangeLog:

	* config/i386/gcc-auto-profile: regenerate
2021-07-01 23:30:14 -07:00
Tom de Vries
9f06c15a2e Fix comment in contrib/gen_autofdo_event.py
2017-04-26  Tom de Vries  <tom@codesourcery.com>

	* gen_autofdo_event.py: Fix comment.

From-SVN: r247274
2017-04-26 08:53:31 +00:00
Andi Kleen
7b72d14a9f Add gcc-auto-profile script
Using autofdo is currently something difficult. It requires using the
model specific branches taken event, which differs on different CPUs.
The example shown in the manual requires a special patched version of
perf that is non standard, and also will likely not work everywhere.

This patch adds a new gcc-auto-profile script that figures out the
correct event and runs perf.

This is needed to actually make use of autofdo in a generic way
in the build system and in the test suite.

Since maintaining the script would be somewhat tedious (needs changes
every time a new CPU comes out) I auto generated it from the online
Intel event database. The script to do that is in contrib and can be
rerun.

Right now there is no test if perf works in configure. This
would vary depending on the build and target system, and since
it currently doesn't work in virtualization and needs uptodate
kernel it may often fail in common distribution build setups.

So far the script is not installed.

gcc/:
2016-06-23  Andi Kleen  <ak@linux.intel.com>

	* config/i386/gcc-auto-profile: New file.

contrib/:

2016-06-23  Andi Kleen  <ak@linux.intel.com>

	* gen_autofdo_event.py: New file to regenerate
	gcc-auto-profile.

From-SVN: r237731
2016-06-23 14:33:53 +00:00