1#!/usr/bin/env python 2# coding:utf-8 3# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16import sys,string,re,os 17from ctypes import * 18from auto_class import * 19from config import * 20 21class _PhaseCtrl: 22 def __init__(self): 23 self.dfx_stat=None 24 25 def make_diag_info(self): 26 addr = parse_get_symbol_addr('g_zdiag_dfx_stat') 27 obj=parse_memory_2_class(addr,zdiag_dfx_stat,sizeof(zdiag_dfx_stat)) 28 self.dfx_stat=obj 29 def print_diag_info(self): 30 uapi_print_ctypes_obj('diag_dfx_stat',self.dfx_stat) 31 32_g_parse_ctrl=_PhaseCtrl() 33 34def parase_diag_info(): 35 _g_parse_ctrl.make_diag_info() 36 _g_parse_ctrl.print_diag_info()