BOLT Method
- Use BOLT to build an instrumented MySQL and generate the instrumented binary mysqld.inst.
1llvm-bolt $SHELL_PATH/install/bin/mysqld -instrument -o mysqld.inst -instrumentation-file=mysqld.fdata --instrumentation-wait-forks -instrumentation-sleep-time=2 -instrumentation-no-counters-clear --instrumentation-binpath=$SHELL_PATH/install/bin/mysqld.inst # mysqld.fdata is the specified directory of the profile.
- Use the instrumented binary mysqld.inst to run typical benchmarks, such as sysbench and TPC-C. After the running is complete and MySQL exits, a profile named mysqld.fdata is generated.
- Generate the high-performance MySQL binary file mysqld.opt based on the collected profile.
1llvm-bolt $SHELL_PATH/install/bin/mysqld -o mysqld.opt -data=mysqld.fdata --infer-fall-throughs --reorder-blocks=ext-tsp --reorder-functions=hfsort --peepholes=useless-branches --simplify-conditional-tail-calls --simplify-rodata-loads --indirect-call-promotion-use-mispredicts --elim-link-veneers --eliminate-unreachable --fix-block-counts --fix-func-counts --split-all-cold --sctc-mode=preserve --align-blocks --cg-use-split-hot-size --tail-duplication=aggressive --iterative-guess --assume-abi
Parent topic: CFGO Cases