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 : #include "trace_server.h"
11 : #include "trace_server_core.h"
12 :
13 : /**
14 : * @brief initialize trace server.
15 : * @param [in] devId: device id
16 : * @return NA
17 : */
18 18 : void TraceServerInit(int32_t devId)
19 : {
20 18 : TraceServerSetDevId(devId);
21 18 : return;
22 : }
23 :
24 : /**
25 : * @brief trace server process.
26 : * @return TraStatus
27 : */
28 18 : TraStatus TraceServerProcess(void)
29 : {
30 18 : TraStatus ret = TraceServerMgrProcess();
31 18 : if (ret != TRACE_SUCCESS) {
32 1 : TraceServerExit();
33 1 : return TRACE_FAILURE;
34 : }
35 17 : ret = TraceServerSendProcess();
36 17 : if (ret != TRACE_SUCCESS) {
37 2 : TraceServerExit();
38 2 : return TRACE_FAILURE;
39 : }
40 15 : ret = TraceServerRecvProcess();
41 15 : if (ret != TRACE_SUCCESS) {
42 7 : TraceServerExit();
43 7 : return TRACE_FAILURE;
44 : }
45 8 : return TRACE_SUCCESS;
46 : }
47 :
48 : /**
49 : * @brief deinitialize trace server.
50 : * @return NA
51 : */
52 28 : void TraceServerExit(void)
53 : {
54 28 : TraceServerRecvExit();
55 28 : TraceServerSendExit();
56 28 : TraceServerMgrExit();
57 28 : }
|