1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: zdiag dfx 15 * This file should be changed only infrequently and with great care. 16 */ 17 18 #ifndef __ZDIAG_DFX_ST_H__ 19 #define __ZDIAG_DFX_ST_H__ 20 #include <stdint.h> 21 #define DIAG_DFX_SUPPORT_MAX_CHANNEL 4 22 #define DIAG_DFX_SUPPORT_MAX_PKT_MEM_TYPE 2 23 24 typedef struct { 25 uint32_t case_id; 26 uint32_t data[3]; 27 } diag_dfx_cmd_req_st_t; 28 29 typedef struct { 30 uint32_t case_id; 31 uint32_t data[3]; 32 } diag_dfx_cmd_ind_st_t; 33 34 typedef struct { 35 uint32_t put_msg_2_cache_fail_times; 36 uint16_t dfx_msg_q_num; 37 uint16_t dfx_msg_q_peak_num; 38 uint16_t transmit_msg_q_num; 39 uint16_t transmit_msg_q_peak_num; 40 uint32_t dfx_msg_process_max_time; 41 uint32_t transmit_msg_process_max_time; 42 uint32_t send_local_q_fail; 43 uint32_t send_local_q_success; 44 uint32_t transmit_msg_rev_cnt; /* transmit 消息接收总次数 */ 45 uint32_t msg_rev_cnt; /* dfx 消息接收总次数 */ 46 uint32_t diag_pkt_msg_rev_cnt; /* diag pkt 消息接收次数 */ 47 uint32_t beat_heart_msg_rev_cnt; /* 心跳消息接收次数 */ 48 uint32_t channel_receive_data_cnt[DIAG_DFX_SUPPORT_MAX_CHANNEL]; /* 通道接收数据字节数 */ 49 uint32_t channel_receive_frame_cnt[DIAG_DFX_SUPPORT_MAX_CHANNEL]; /* 通道接收数据帧数 */ 50 uint32_t mem_pkt_alloc_size[DIAG_DFX_SUPPORT_MAX_PKT_MEM_TYPE]; /* 总计分配内存字节数 */ 51 uint32_t mem_pkt_free_size[DIAG_DFX_SUPPORT_MAX_PKT_MEM_TYPE]; /* 总计释放内存字节数 */ 52 uint32_t alloc_mem_size; /* 当前使用内存字节数 */ 53 uint32_t alloc_mem_peak_size; /* 使用内存峰值字节数 */ 54 uint32_t conn_excep_cnt; 55 uint32_t conn_bu_cnt; 56 } zdiag_dfx_stat_t; 57 #endif 58