---
title: 功能介绍
description: 当用户需要定位应用程序或上层框架程序的性能瓶颈时，可在Profiling采集进程内（acl.prof.start接口、acl.prof.stop接口之间）调用Profiling pyACL API扩展接口（统称为msproftx功能），开启记录应用程序执行期间特定事件发生的时间跨度，并将数据写入Profiling数据文件，再使用Profiling工具解析该文件，并导出展示性能分析数据。
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0841.html"
---

# 功能介绍

#### 功能

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

Profiling工具解析导出操作请参见《性能分析工具使用指南(https://www.hiascend.com/document/detail/zh/canncommercial/700/devtools/auxiliarydevtool/atlasprofiling_16_0002.html)》下的“Profiling数据解析”和“Profiling数据导出”。

接口调用方式：在acl.prof.start和acl.prof.stop接口之间调用acl.prof.create_stamp、acl.prof.set_stamp_trace_message、acl.prof.mark、acl.prof.push、acl.prof.pop、acl.prof.range_start、acl.prof.range_stop、acl.prof.destroy_stamp接口。该方式可获取应用程序执行期间特定时间发生的事件并记录事件发生的时间跨度。

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


#### 接口约束说明

- 调用接口要求：msproftx功能相关接口须在  acl.prof.start
接口与  acl.prof.stop
接口之间调用。其中配对使用的接口有：  acl.prof.create_stamp
/  acl.prof.destroy_stamp
、  acl.prof.push
/  acl.prof.pop
、  acl.prof.range_start
/  acl.prof.range_stop
。
- 接口调用顺序：  acl.prof.start
接口(指定Device 0和Device 1)-->  acl.prof.create_stamp
接口-->  acl.prof.set_stamp_trace_message
接口-->  acl.prof.mark
接口-->(  acl.prof.push
接口-->  acl.prof.pop
接口)或(  acl.prof.range_start
接口-->  acl.prof.range_stop
接口)-->  acl.prof.destroy_stamp
接口-->  acl.prof.stop
接口(与  acl.prof.start
接口的aclprofConfig数据保持一致)。
