diff options
author | Xi Ruoyao <xry111@xry111.site> | 2022-06-27 14:15:22 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2022-08-27 11:44:13 +0800 |
commit | 152895769581468e98807bbb8835ef63cc07727d (patch) | |
tree | c0e4664ea956694cd77cc854c5b8f67f94230321 /gcc/config | |
parent | 16f542d6b866828e23e699e294e617ca428b04ee (diff) | |
download | gcc-152895769581468e98807bbb8835ef63cc07727d.zip gcc-152895769581468e98807bbb8835ef63cc07727d.tar.gz gcc-152895769581468e98807bbb8835ef63cc07727d.tar.bz2 |
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.
Diffstat (limited to 'gcc/config')
-rwxr-xr-x | gcc/config/i386/gcc-auto-profile | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/config/i386/gcc-auto-profile b/gcc/config/i386/gcc-auto-profile index 56f64cb..5ab224b 100755 --- a/gcc/config/i386/gcc-auto-profile +++ b/gcc/config/i386/gcc-auto-profile @@ -33,8 +33,15 @@ if grep -q hypervisor /proc/cpuinfo ; then echo >&2 "Warning: branch profiling may not be functional in VMs" fi -case `egrep -q "^cpu family\s*: 6" /proc/cpuinfo && - egrep "^model\s*:" /proc/cpuinfo | head -n1` in +case `grep -E -q "^cpu family\s*: 6" /proc/cpuinfo && + grep -E "^model\s*:" /proc/cpuinfo | head -n1` in +model*:\ 46|\ +model*:\ 30|\ +model*:\ 31|\ +model*:\ 26|\ +model*:\ 47|\ +model*:\ 37|\ +model*:\ 44) E="cpu/event=0x88,umask=0x40/$FLAGS" ;; model*:\ 55|\ model*:\ 77|\ model*:\ 76|\ @@ -43,6 +50,11 @@ model*:\ 95|\ model*:\ 87|\ model*:\ 133|\ model*:\ 122) E="cpu/event=0xC4,umask=0xFE/p$FLAGS" ;; +model*:\ 28|\ +model*:\ 38|\ +model*:\ 39|\ +model*:\ 54|\ +model*:\ 53) E="cpu/event=0x88,umask=0x41/$FLAGS" ;; model*:\ 42|\ model*:\ 45|\ model*:\ 58|\ @@ -63,23 +75,14 @@ model*:\ 165|\ model*:\ 166|\ model*:\ 85|\ model*:\ 85) E="cpu/event=0xC4,umask=0x20/p$FLAGS" ;; -model*:\ 46|\ -model*:\ 30|\ -model*:\ 31|\ -model*:\ 26|\ -model*:\ 47|\ -model*:\ 37|\ -model*:\ 44) E="cpu/event=0x88,umask=0x40/p$FLAGS" ;; -model*:\ 28|\ -model*:\ 38|\ -model*:\ 39|\ -model*:\ 54|\ -model*:\ 53) E="cpu/event=0x88,umask=0x41/p$FLAGS" ;; model*:\ 126|\ model*:\ 140|\ model*:\ 141|\ +model*:\ 143|\ model*:\ 106|\ model*:\ 108) E="cpu/event=0xc4,umask=0x20/p$FLAGS" ;; +model*:\ 134|\ +model*:\ 150) E="cpu/event=0xc4,umask=0xfe/p$FLAGS" ;; *) echo >&2 "Unknown CPU. Run contrib/gen_autofdo_event.py --all --script to update script." exit 1 ;; |