1 2 3 4 5 6 7 | #创建profile存储目录 mkdir gcc_build cd gcc_build cmake .. -DCMAKE_INSTALL_PREFIX=/home/mysql-8.0.24/gcc_build/ -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_CXX_FLAGS="-fcfgo-profile-generate=/home/mysql-8.0.24/gcc_build/mysql_profile/pgo_profile" -DCMAKE_C_FLAGS="-fcfgo-profile-generate=/home/mysql-8.0.24/gcc_build/mysql_profile/pgo_profile" make -j && make install -j |
1 | /home/mysql-8.0.24/gcc_build/bin/mysqld --defaults-file=/etc/my.cnf & |
1 | sysbench ./oltp_write_only.lua --threads=256 --mysql-user=root --mysql-password=123456 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-db=sysbench --forced-shutdown=off --time=120 --report-interval=1 --events=0 --table-size=10000000 --tables=1 run |
编译优化后
1 2 3 | cmake .. -DCMAKE_INSTALL_PREFIX=/home/mysql-8.0.24/gcc_build_pgoed -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_CXX_FLAGS="-fcfgo-profile-use=/home/mysql-8.0.24/gcc_build/mysql_profile/pgo_profile -fprofile-correction -Wno-error=coverage-mismatch -Wno-error=missing-profile" -DCMAKE_C_FLAGS="-fcfgo-profile-use=/home/mysql-8.0.24/gcc_build/mysql_profile/pgo_profile -fprofile-correction -Wno-error=coverage-mismatch -Wno-error=missing-profile" make -j && make install -j |
如在安装遇到error: 'SYS_gettid' was not declared in this scope,可以通过以下方式解决:
在 /home/mysql-8.0.24/storage/innobase/buf/buf0buff.cc 开头添加 #include "sys/syscall.h"