---
title: 函数：create_subscribe_config
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0870.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0870.html
indexId: 07f3f7dd6d029671c91317e309290808d12f4bf6c74d049b0672190c47ebe7b571
---
# 函数：create_subscribe_config

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

创建aclprofSubscribeConfig类型的数据，表示创建订阅配置信息。

如需销毁aclprofSubscribeConfig类型的数据，请参见acl.prof.destroy_subscribe_config。


#### 函数原型

- C函数原型
  1 aclprofSubscribeConfig *aclprofCreateSubscribeConfig(int8_t timeInfoSwitch, aclprofAicoreMetrics aicoreMetrics, void *fd)

- python函数
  1 subscribe_config = acl.prof.create_subscribe_config(time_info_switch, aicore_metrics, fd)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| time\_info\_switch | int，是否采集网络模型中算子的性能数据： 1：采集 0：不采集 |
| aicore\_metrics | int，表示AI Core性能指标采集项，参考aclprofAicoreMetrics。 说明： 订阅接口目前仅提供算子耗时统计的功能，暂时不支持AicoreMetrics采集功能。 |
| fd | int，用户创建管道的写文件描述符。 用户在调用acl.prof.model\_unsubscribe接口后，系统内部会在数据发送结束后，关闭该模型的管道写文件描述符。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| subscribe\_config | int。 返回非0值表示成功，返回aclprofSubscribeConfig的地址对象。 返回0表示失败。 |


#### 约束说明

- 使用  acl.prof.destroy_subscribe_config
接口销毁aclprofSubscribeConfig类型的数据，如不销毁会导致内存未被释放。

- 与  acl.prof.destroy_subscribe_config
接口配对使用，先调用acl.prof.create_subscribe_config接口再调用  acl.prof.destroy_subscribe_config
接口。
