njsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget'/translations/zh_CN/dev-tools/propellermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/zh_TW/dev-tools/propellermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/it_IT/dev-tools/propellermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/ja_JP/dev-tools/propellermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/ko_KR/dev-tools/propellermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/sp_SP/dev-tools/propellermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhA/var/lib/git/docbuild/linux/Documentation/dev-tools/propeller.rsthKubhsection)}(hhh](htitle)}(h%Using Propeller with the Linux kernelh]h%Using Propeller with the Linux kernel}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThis enables Propeller build support for the kernel when using Clang compiler. Propeller is a profile-guided optimization (PGO) method used to optimize binary executables. Like AutoFDO, it utilizes hardware sampling to gather information about the frequency of execution of different code paths within a binary. Unlike AutoFDO, this information is then used right before linking phase to optimize (among others) block layout within and across functions.h]hXThis enables Propeller build support for the kernel when using Clang compiler. Propeller is a profile-guided optimization (PGO) method used to optimize binary executables. Like AutoFDO, it utilizes hardware sampling to gather information about the frequency of execution of different code paths within a binary. Unlike AutoFDO, this information is then used right before linking phase to optimize (among others) block layout within and across functions.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h h](h)}(hAssuming an AutoFDO profile is already collected following instructions in the AutoFDO document, build the kernel on the host machine, with AutoFDO and Propeller build configs ::h]hAssuming an AutoFDO profile is already collected following instructions in the AutoFDO document, build the kernel on the host machine, with AutoFDO and Propeller build configs}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhj5ubj0)}(h/CONFIG_AUTOFDO_CLANG=y CONFIG_PROPELLER_CLANG=yh]h/CONFIG_AUTOFDO_CLANG=y CONFIG_PROPELLER_CLANG=y}hjGsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKjhj5ubh)}(hand ::h]hand}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhj5ubj0)}(h:$ make LLVM=1 CLANG_AUTOFDO_PROFILE=h]h:$ make LLVM=1 CLANG_AUTOFDO_PROFILE=}hjcsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKohj5ubeh}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubh)}(h(Install the kernel on the test machine. h]h)}(h'Install the kernel on the test machine.h]h'Install the kernel on the test machine.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjwubah}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubh)}(hXRun the load tests. The '-c' option in perf specifies the sample event period. We suggest using a suitable prime number, like 500009, for this purpose. - For Intel platforms:: $ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c -o -- - For AMD platforms:: $ perf record --pfm-event RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N -b -c -o -- Note you can repeat the above steps to collect multiple s. h](h)}(hRun the load tests. The '-c' option in perf specifies the sample event period. We suggest using a suitable prime number, like 500009, for this purpose.h]hRun the load tests. The ‘-c’ option in perf specifies the sample event period. We suggest using a suitable prime number, like 500009, for this purpose.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubjg)}(hhh](h)}(hwFor Intel platforms:: $ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c -o -- h](h)}(hFor Intel platforms::h]hFor Intel platforms:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubj0)}(h^$ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c -o -- h]h^$ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c -o -- }hjsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKyhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hFor AMD platforms:: $ perf record --pfm-event RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N -b -c -o -- h](h)}(hFor AMD platforms::h]hFor AMD platforms:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hjubj0)}(hn$ perf record --pfm-event RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N -b -c -o -- h]hn$ perf record --pfm-event RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N -b -c -o -- }hjsbah}(h]h ]h"]h$]h&]hhuh1j/hhhK}hjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j j uh1jfhhhKwhjubh)}(hENote you can repeat the above steps to collect multiple s.h]hENote you can repeat the above steps to collect multiple s.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubh)}(h>(Optional) Download the raw perf file(s) to the host machine. h]h)}(h=(Optional) Download the raw perf file(s) to the host machine.h]h=(Optional) Download the raw perf file(s) to the host machine.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubh)}(hXBUse the create_llvm_prof tool (https://github.com/google/autofdo) to generate Propeller profile. :: $ create_llvm_prof --binary= --profile= --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txt "" can be something like "/home/user/dir/any_string". This command generates a pair of Propeller profiles: "_cc_profile.txt" and "_ld_profile.txt". If there are more than 1 perf_file collected in the previous step, you can create a temp list file "" with each line containing one perf file name and run:: $ create_llvm_prof --binary= --profile=@ --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txt h](h)}(hcUse the create_llvm_prof tool (https://github.com/google/autofdo) to generate Propeller profile. ::h](hUse the create_llvm_prof tool (}(hj&hhhNhNubjC)}(h!https://github.com/google/autofdoh]h!https://github.com/google/autofdo}(hj.hhhNhNubah}(h]h ]h"]h$]h&]refurij0uh1jBhj&ubh ) to generate Propeller profile.}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj"ubj0)}(hX$ create_llvm_prof --binary= --profile= --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txth]hX$ create_llvm_prof --binary= --profile= --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txt}hjGsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKhj"ubh)}(hO"" can be something like "/home/user/dir/any_string".h]hW“” can be something like “/home/user/dir/any_string”.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubh)}(hThis command generates a pair of Propeller profiles: "_cc_profile.txt" and "_ld_profile.txt".h]hThis command generates a pair of Propeller profiles: “_cc_profile.txt” and “_ld_profile.txt”.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubh)}(hIf there are more than 1 perf_file collected in the previous step, you can create a temp list file "" with each line containing one perf file name and run::h]hIf there are more than 1 perf_file collected in the previous step, you can create a temp list file “” with each line containing one perf file name and run:}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubj0)}(hX$ create_llvm_prof --binary= --profile=@ --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txth]hX$ create_llvm_prof --binary= --profile=@ --format=propeller --propeller_output_module_name --out=_cc_profile.txt --propeller_symorder=_ld_profile.txt}hjsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKhj"ubeh}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubh)}(hRebuild the kernel using the AutoFDO and Propeller profiles. :: CONFIG_AUTOFDO_CLANG=y CONFIG_PROPELLER_CLANG=y and :: $ make LLVM=1 CLANG_AUTOFDO_PROFILE= CLANG_PROPELLER_PROFILE_PREFIX=h](h)}(h?Rebuild the kernel using the AutoFDO and Propeller profiles. ::h]h CLANG_PROPELLER_PROFILE_PREFIX=h]hl$ make LLVM=1 CLANG_AUTOFDO_PROFILE= CLANG_PROPELLER_PROFILE_PREFIX=}hjsbah}(h]h ]h"]h$]h&]hhuh1j/hhhKhjubeh}(h]h ]h"]h$]h&]uh1hhj2hhhhhNubeh}(h]h ]h"]h$]h&]j|j}j~hj)uh1hhjhhhhhKfubeh}(h]workflowah ]h"]workflowah$]h&]uh1hhhhhhhhKbubeh}(h]%using-propeller-with-the-linux-kernelah ]h"]%using propeller with the linux kernelah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjDjAjj jju nametypes}(jjDjjuh}(jhjAjj jGjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.