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 "atrace_api.h"
12 : #include "trace_attr.h"
13 : #include "atrace_client_core.h"
14 : #include "adiag_print.h"
15 :
16 : /**
17 : * @brief create thread to receive trace of device
18 : * @param [in] devId: device id
19 : * @return TraStatus
20 : */
21 40 : TraStatus AtraceReportStart(int32_t devId)
22 : {
23 40 : if (!AtraceCheckSupported()) {
24 20 : ADIAG_WAR("AtraceReportStart is not supported on device side");
25 20 : return TRACE_UNSUPPORTED;
26 : }
27 20 : return AtraceClientStart(devId);
28 : }
29 :
30 : /**
31 : * @brief stop thread to receive trace of device
32 : * @param [in] devId: device id
33 : */
34 40 : void AtraceReportStop(int32_t devId)
35 : {
36 40 : if (!AtraceCheckSupported()) {
37 20 : ADIAG_WAR("AtraceReportStop is not supported on device side");
38 20 : return;
39 : }
40 20 : AtraceClientStop(devId);
41 : }
|