Overview
General Restrictions
The APIs in this section cannot be called with Subscribing to Operator Information together. acl.prof.model_subscribe, aclprofGet*, and acl.prof.model_unsubscribe cannot be called between acl.prof.init and acl.prof.finalize.
API Constraints
- API requirements
- The acl.prof.init API must be called after the acl.init API and before the model is loaded.
If Profiling information has been configured using the acl.init API, an error is returned when the acl.prof.init, acl.prof.start, acl.prof.stop, or acl.prof.finalize API is called.
If acl.prof.init has not been called, an error is returned when acl.prof.start, acl.prof.stop, or acl.prof.finalize is called.
- The acl.prof.start API is called before model execution. If the acl.prof.start API is called during model execution, the data collected by Profiling is the data after the acl.prof.start API is called, which may cause data incompleteness.
When calling acl.prof.start, you can specify one or more devices to profile.
In a user app process, an error is returned if acl.prof.start is called repeatedly and the specified profiling configuration or device is duplicate.
- In the lifetime of a user app process, do not call the acl.prof.init and acl.prof.finalize pair more than once. Otherwise, the path for storing profile data files may be changed.
- acl.prof.start must be used in pair with acl.prof.stop.
- The APIs related to the profiling msproftx function must be called between acl.prof.start and acl.prof.stop. The following APIs are used in pairs: acl.prof.create_stamp/acl.prof.destroy_stamp, acl.prof.push/acl.prof.pop, and acl.prof.range_start/acl.prof.range_stop.
- If acl.finalize is called and a normal exit code is received, the execution is complete. Otherwise, the execution is abnormal. Due to the lack of support for multi-process concurrent execution in profile data collection, to ensure that the driver can be properly stopped, it is necessary to wait until the previous profile data collection test case is fully executed before starting the next round of collection. You are advised to add exception handling operations to the return value of acl.finalize to facilitate execution status display and exception localization.
- The acl.prof.init API must be called after the acl.init API and before the model is loaded.
- API call sequence
- The recommended API call sequence is as follows. In this example, two models are executed in a single user app process:
acl.init --> acl.prof.init --> acl.prof.start (specify Device 0 and Device 1) --> Load model 1 --> Execute model 1 --> acl.prof.stop (consistent with the aclprofConfig data of acl.prof.start) --> acl.prof.start (specify Device 1 and Device 2) --> Load model 2 --> Execute model 2 --> acl.prof.stop (consistent with the aclprofConfig data of acl.prof.start) --> acl.prof.finalize --> Execute other tasks --> Unload the model --> acl.finalize
- The following is an example of an incorrect call sequence. In this example, acl.prof.start is called repeatedly and duplicated devices are specified in a single app process:
acl.init --> acl.prof.init --> acl.prof.start (specify Device 0 and Device 1) --> acl.prof.start (specify Device 1 and Device 2) --> Load model 1 --> Execute model 1 --> Load model 2 --> Execute model 2 --> acl.prof.stop --> acl.prof.stop --> acl.prof.finalize --> Execute other tasks --> Unload the model --> acl.finalize
- The recommended API call sequence is as follows. In this example, two models are executed in a single user app process: