跳到主要内容

函数:start

函数: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采集并落盘性能数据)

功能介绍

功能

当用户需要定位应用程序或上层框架程序的性能瓶颈时,可在Profiling采集进程内(acl.prof.start接口、acl.prof.stop接口之间)调用Profiling pyACL API扩展接口(统称为msproftx功能),开启记录应用程序执行期间特定事件发生的时间跨度,并将数据写入Profiling数据文件,再使用Profiling工具解析该文件,并导出展示性能分析数据。

Profiling工具解析导出操作请参见《性能分析工具使用指南》下的“Profiling数据解析”和“Profiling数据导出”。

接口调用方式:在acl.prof.startacl.prof.stop接口之间调用acl.prof.create_stampacl.prof.set_stamp_trace_messageacl.prof.markacl.prof.pushacl.prof.popacl.prof.range_startacl.prof.range_stopacl.prof.destroy_stamp接口。该方式可获取应用程序执行期间特定时间发生的事件并记录事件发生的时间跨度。

一个进程内,可以根据需求多次调用这些接口。

接口约束说明

父主题: Profiling pyACL API for Extension(Profiling pyACL API扩展接口)

在线提单