@@ -2778,7 +2778,7 @@ usual build cycle when using sample profilers for optimization:
2778
2778
2779
2779
> clang-cl /O2 -gdwarf -gline-tables-only ^
2780
2780
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
2781
- code.cc /Fe:code / fuse-ld=lld /link /debug:dwarf
2781
+ code.cc /Fe:code - fuse-ld=lld /link /debug:dwarf
2782
2782
2783
2783
.. note ::
2784
2784
@@ -2861,23 +2861,25 @@ usual build cycle when using sample profilers for optimization:
2861
2861
that executes faster than the original one. Note that you are not
2862
2862
required to build the code with the exact same arguments that you
2863
2863
used in the first step. The only requirement is that you build the code
2864
- with the same debug info options and ``-fprofile-sample-use ``.
2864
+ with the same debug info options and ``-fprofile-sample-use ``. ``-gdwarf ``
2865
+ and ``-gline-tables-only `` can be omitted if you do not need debug info
2866
+ in the final binary.
2865
2867
2866
2868
On Linux:
2867
2869
2868
2870
.. code-block :: console
2869
2871
2870
- $ clang++ -O2 -gline-tables-only \
2872
+ $ clang++ -O2 \
2871
2873
-fdebug-info-for-profiling -funique-internal-linkage-names \
2872
2874
-fprofile-sample-use=code.prof code.cc -o code
2873
2875
2874
2876
On Windows:
2875
2877
2876
2878
.. code-block :: winbatch
2877
2879
2878
- > clang-cl /O2 -gdwarf -gline-tables-only ^
2880
+ > clang-cl /O2 ^
2879
2881
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
2880
- -fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
2882
+ -fprofile-sample-use=code.prof code.cc /Fe:code
2881
2883
2882
2884
[OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/
2883
2885
edge counters. The profile inference algorithm (profi) can be used to infer
@@ -2886,17 +2888,17 @@ usual build cycle when using sample profilers for optimization:
2886
2888
2887
2889
.. code-block :: console
2888
2890
2889
- $ clang++ -fsample-profile-use-profi -O2 -gline-tables-only \
2891
+ $ clang++ -fsample-profile-use-profi -O2 \
2890
2892
-fdebug-info-for-profiling -funique-internal-linkage-names \
2891
2893
-fprofile-sample-use=code.prof code.cc -o code
2892
2894
2893
2895
On Windows:
2894
2896
2895
2897
.. code-block :: winbatch
2896
2898
2897
- > clang-cl /clang:-fsample-profile-use-profi /O2 -gdwarf -gline-tables-only ^
2899
+ > clang-cl /clang:-fsample-profile-use-profi /O2 ^
2898
2900
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
2899
- -fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
2901
+ -fprofile-sample-use=code.prof code.cc /Fe:code
2900
2902
2901
2903
Sample Profile Formats
2902
2904
""""""""""""""""""""""
0 commit comments