Collecting msproftx Data
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.
Prerequisites
Call the mstx or msproftx API in the user application code to record the time span of specific events during application execution.
Command Format
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.
Command-line Options
- --msproftx: (required) controls the msproftx user application and upper-layer framework to output the profile data. The value is either on or off (default).
- --mstx-domain-include: (optional) outputs the data of required domains. When the user application calls the APIs prefixed by mstxDomain, you can configure this option to output only the data of the specified domains.
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.
- --mstx-domain-exclude: (optional) filters out the data of unnecessary domains. When the user application calls the APIs prefixed by mstxDomain, you can configure this option to filter out the data of the specified domains.
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.
Example
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.