LCOV - code coverage report
Current view: top level - legacy/ascend950/framework/communicator/aicpu - ns_recovery_handler_func.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 1 1
Test Date: 2026-08-04 10:52:23 Functions: 50.0 % 2 1

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       3              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       4              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       5              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       6              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       7              :  * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
       8              :  * See LICENSE in the root of the software repository for the full text of the License.
       9              :  */
      10              : 
      11              : #ifndef HCCLV2_NS_RECOVERY_FUNC_H
      12              : #define HCCLV2_NS_RECOVERY_FUNC_H
      13              : 
      14              : #include "daemon_func.h"
      15              : #include "communicator_impl_lite.h"
      16              : #include "communicator_impl_lite_manager.h"
      17              : #include "enum_factory.h"
      18              : 
      19              : namespace Hccl {
      20              : 
      21              : using ts_kill_task_info_t = struct {
      22              :     volatile uint8_t resv[40];
      23              : };
      24              : 
      25              : using ts_query_task_info_t = struct {
      26              :     volatile uint32_t choice; // APP_ABORT_STS_QUERY_CHOICE
      27              :     volatile uint32_t sqId;
      28              :     volatile uint8_t resv[32];
      29              : };
      30              : 
      31              : using ts_query_task_ack_info_t = struct {
      32              :     volatile uint32_t status; // APP_ABORT_STAUTS
      33              :     volatile uint8_t resv[36];
      34              : };
      35              : 
      36              : using ts_ctrl_msg_body_t = struct {
      37              :     volatile uint32_t type;
      38              :     union {
      39              :         ts_kill_task_info_t killTaskInfo;
      40              :         ts_query_task_info_t query_task_info;
      41              :         ts_query_task_ack_info_t query_task_ack_info;
      42              :     } u; // 40 bytes
      43              : }; // 44 bytes
      44              : 
      45              : MAKE_ENUM(OPERATION_TYPE,
      46              :           OP_ABORT_APP,
      47              :           OP_QUERY_ABORT_STATUS,
      48              :           OP_INVALID)
      49              : 
      50              : MAKE_ENUM(APP_ABORT_STS_QUERY_CHOICE,
      51              :           APP_ABORT_STS_QUERY_BY_SQ,
      52              :           APP_ABORT_STS_QUERY_BY_PID,
      53              :           APP_ABORT_STS_QUERY_INVALID)
      54              : 
      55              : MAKE_ENUM(APP_ABORT_STAUTS,
      56              :           APP_ABORT_TERMINATE_FAIL,
      57              :           APP_ABORT_INIT,
      58              :           APP_ABORT_KILL_FINISH,
      59              :           APP_ABORT_TERMINATE_FINISH,
      60              :           APP_ABORT_STATUS_INVALID)
      61              : 
      62              : class NsRecoveryHandlerFunc : public DaemonFunc {
      63              : public:
      64              :     static NsRecoveryHandlerFunc &GetInstance();
      65            1 :     ~NsRecoveryHandlerFunc() override = default;
      66              :     void Call() override;
      67              : private:
      68              :     void HandleStopLaunch(CommunicatorImplLite *comm) const;
      69              :     void HandleClean(CommunicatorImplLite *comm);
      70              :     void StreamClean(CommunicatorImplLite *comm);
      71              :     HcclResult DeviceQuery(const uint32_t devId, const uint32_t step, const uint64_t timeout);
      72              : 
      73              :     NsRecoveryHandlerFunc() = default;
      74              :     NsRecoveryHandlerFunc(const NsRecoveryHandlerFunc&) = delete;
      75              :     NsRecoveryHandlerFunc& operator=(const NsRecoveryHandlerFunc&) = delete;
      76              : };
      77              : 
      78              : }
      79              : 
      80              : #endif
        

Generated by: LCOV version 2.0-1