LCOV - code coverage report
Current view: top level - atrace/utrace/tracer - tracer_schedule.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 96.2 % 26 25
Test Date: 2026-08-12 11:04:46 Functions: 100.0 % 2 2

            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              : #include "tracer_schedule.h"
      12              : #include "adiag_print.h"
      13              : #include "adiag_utils.h"
      14              : #include "trace_system_api.h"
      15              : #include "tracer_mgr_operate.h"
      16              : 
      17          890 : TraStatus TracerScheduleRegister(Tracer *tracer)
      18              : {
      19          890 :     tracer->mgr = (TracerMgr *)AdiagMalloc(sizeof(struct TracerMgr));
      20          890 :     if (tracer->mgr == NULL) {
      21            0 :         return TRACE_FAILURE;
      22              :     }
      23              : 
      24          890 :     tracer->mgr->op.tracerInitFunc = TracerScheduleInit;
      25          890 :     tracer->mgr->op.tracerExitFunc = TracerScheduleExit;
      26          890 :     tracer->mgr->op.tracerCreateFunc = TracerScheduleObjCreate;
      27          890 :     tracer->mgr->op.tracerGetFunc = TracerScheduleObjGet;
      28          890 :     tracer->mgr->op.tracerSubmitFunc = TracerScheduleObjSubmit;
      29          890 :     tracer->mgr->op.tracerDestroyFunc = TracerScheduleObjDestroy;
      30          890 :     tracer->mgr->op.tracerSaveFunc = TracerScheduleSave;
      31          890 :     tracer->mgr->op.tracerReportFunc = TracerScheduleReport;
      32          890 :     return TRACE_SUCCESS;
      33              : }
      34              : 
      35          960 : TraStatus TracerScheduleUnregister(Tracer *tracer)
      36              : {
      37          960 :     if (tracer->mgr == NULL) {
      38           76 :         return TRACE_SUCCESS;
      39              :     }
      40          884 :     tracer->mgr->op.tracerInitFunc = NULL;
      41          884 :     tracer->mgr->op.tracerExitFunc = NULL;
      42          884 :     tracer->mgr->op.tracerCreateFunc = NULL;
      43          884 :     tracer->mgr->op.tracerGetFunc = NULL;
      44          884 :     tracer->mgr->op.tracerSubmitFunc = NULL;
      45          884 :     tracer->mgr->op.tracerDestroyFunc = NULL;
      46          884 :     tracer->mgr->op.tracerSaveFunc = NULL;
      47          884 :     tracer->mgr->op.tracerReportFunc = NULL;
      48          884 :     ADIAG_SAFE_FREE(tracer->mgr);
      49          884 :     return TRACE_SUCCESS;
      50              : }
        

Generated by: LCOV version 2.0-1