Skip to main content

函数:init

函数:set_config

C函数原型aclError aclprofSetConfig(aclprofConfigType configType, const char *config, size_t configLength)
Python函数ret = acl.prof.set_config(config_type, config)
函数功能acl.prof.create_config接口的扩展接口,用于设置性能数据采集参数。同步接口。 该接口支持多次调用,用户需要保证数据的一致性和准确性。
输入说明config_type:int,用户选择如下多个常量进行逻辑或(例如:ACL_PROF_SYS_HARDWARE_MEM_FREQ | ACL_PROF_SYS_IO_FREQ),作为config_type参数值。每个常量表示某一类性能数据,详细说明如下:
- ACL_PROF_STORAGE_LIMIT = 1:指定落盘目录允许存放的最大文件容量,有效取值范围为[200MB, 4294967296MB]。
- ACL_PROF_SYS_HARDWARE_MEM_FREQ = 3:片上内存、LLC的读写带宽数据采集频率以及acc_pmu数据和SOC传输带宽信息采集频率,范围[1,100]。 不同产品支持情况不同,请以实际实现为准。
- ACL_PROF_LLC_MODE = 4:LLC Profiling采集事件。
- read:读事件,三级缓存读速率。
- write:写事件,三级缓存写速率。默认为read。
- ACL_PROF_SYS_IO_FREQ = 5:NIC采集频率,范围[1,100]。 容器场景下本参数不生效。
- ACL_PROF_DVPP_FREQ = 7:DVPP采集频率,范围[1,100]。
config:str,配置项的参数值。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明先调用acl.prof.set_config接口再调用acl.prof.start接口,可根据需求选择调用该接口。

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

函数:destroy_config

C函数原型aclError aclprofDestroyConfig(const aclprofConfig *profilerConfig)
Python函数ret = acl.prof.destroy_config(profiler_config)
函数功能销毁aclprofConfig类型的数据,只能销毁通过acl.prof.create_config接口创建的aclprofConfig类型。
输入说明profiler_config:待销毁的aclprofConfig类型的指针地址。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明- 与acl.prof.create_config接口配对使用,先调用acl.prof.create_config接口再调用aclprofDestroyConfig接口。
- 同一aclprofConfig数据重复调用acl.prof.destroy_config接口,会出现重复释放内存的报错。

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

函数:init

C函数原型aclError aclprofInit(const char *profilerResultPath, size_t length)
Python函数ret = acl.prof.init(profiler_result_path)
函数功能初始化Profiling,目前用于设置保存性能数据的文件的路径。同步接口。
输入说明profiler_result_path:str,指定保存性能数据的文件的路径,此路径为绝对路径。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
参考资源接口调用示例,参见Profiling性能数据采集

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

函数:start

C函数原型aclError aclprofStart(aclprofConfig *profilerConfig)
Python函数ret = acl.prof.start(profiler_config)
函数功能下发Profiling请求,使能对应数据的采集。同步接口。 用户可根据需要,在模型执行过程中按需调用acl.prof.start接口,Profling采集到的数据为调用该接口之后的数据。
输入说明profiler_config:int,指定Profiling配置数据。 需提前调用acl.prof.create_config接口创建aclprofConfig类型的数据。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明acl.prof.stop接口配对使用,先调用acl.prof.start接口再调用acl.prof.stop接口。
参考资源接口调用示例,参见Profiling性能数据采集

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

函数:stop

C函数原型aclError **aclprofStop(**aclprofConfig *profilerConfig)
Python函数ret = acl.prof.stop(profiler_config)
函数功能停止Profiling数据采集。同步接口。
输入说明profiler_config:int,指定停止Profiling数据采集的配置的指针地址。 与acl.prof.start接口中的aclprofConfig类型数据保持一致。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明acl.prof.start接口配对使用,先调用acl.prof.start接口再调用acl.prof.stop接口。
参考资源接口调用示例,参见Profiling性能数据采集

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

函数:finalize

C函数原型aclError aclprofFinalize()
Python函数ret = acl.prof.finalize()
函数功能结束Profiling。同步接口。
输入说明无。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明acl.prof.init接口配对使用,先调用acl.prof.init接口再调用acl.prof.finalize接口。
参考资源接口调用示例,参见Profiling性能数据采集

父主题: Profiling pyACL API(通过Profiling pyACL API采集并落盘性能数据)

在线提单