To locate performance bottlenecks of an application or an upper-layer framework program, you can use specific APIs to track event durations during application execution and save them to the profile data file.
You can use the mstx or msproftx API for profiling. The mstx API is recommended.
Call the mstx or msproftx API in the user application code to record the time span of specific events during application execution.
Log in to the operating environment and run the following command:
msprof [options] <app> Or msprof [options] --application=<app>
To collect mstx data, the user application must be passed. For details about the app parameters, see app Parameters. For details about the options parameters, see Command-line Options.
Set the switch to the name of the mstxDomainCreateA API. You can specify multiple domains and separate them with commas (,). default indicates the default domain. --msproftx must be set to on.
This option is mutually exclusive with --mstx-domain-exclude. Do not configure both options. If neither this option nor --mstx-domain-exclude is configured, data of all domains is profiled. If a domain that does not exist in the program is configured, the profiling result does not contain data of this domain.
Set the switch to the name of the mstxDomainCreateA API. You can specify multiple domains and separate them with commas (,). default indicates the default domain. --msproftx must be set to on.
This option is mutually exclusive with --mstx-domain-include. Do not configure both options. If neither this option nor --mstx-domain-include is configured, data of all domains is profiled.
msprof --msproftx=on /home/projects/MyApp/out/main
Find the PROF_XXX directory generated in the directory specified by --output to store the automatically-parsed profile data. For details about the result files, see msproftx Data Description and MSTX_EVENTS table of the .db file.