Generating a Profile Summary
A profile summary provides comprehensive binary information, such as the total number of function executions and the proportion of individual function executions to the total number. The information is useful for function optimization but cannot be saved to the source code layer. Currently, the information is saved in a JSON file.
The clang-prob-annotate tool can read profile data to generate a file that contains profile summary information. You can run the following command:
clang-prob-annotate -emit-summary-json=true -input-profile="/path/to/***.profdata" -output-json="***.json"
The -emit-summary-json option specifies whether to generate the profile summary. This function is mutually exclusive with the source code annotation function and must be used independently. The -input-profile option specifies the profdata path. This option takes effect only when -emit-summary-json is enabled. The -output-json option is used to specify the output path of the JSON file that contains the profile summary information. This option is optional. The default output path is the current path, and the default file name is default.profilesummary.json.