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 "profiling_adp.h"
11 : #include "aicpusd_status.h"
12 :
13 : namespace aicpu {
14 : #ifdef __cplusplus
15 : extern "C" {
16 : #endif
17 1 : bool IsProfOpen() { return false; }
18 :
19 1 : bool IsModelProfOpen() //
20 : {
21 1 : return false;
22 : }
23 :
24 1 : void UpdateMode(const bool mode) { UNUSED(mode); }
25 :
26 1 : void UpdateModelMode(const bool mode) //
27 : {
28 : UNUSED(mode);
29 1 : return;
30 : }
31 :
32 1 : uint64_t GetSystemTick()
33 : {
34 1 : uint64_t cnt = 0UL;
35 : #ifndef RUN_TEST
36 : asm volatile("mrs %0, CNTVCT_EL0" : "=r"(cnt) :);
37 : #endif
38 1 : return cnt;
39 : }
40 :
41 1 : uint64_t GetSystemTickFreq()
42 : {
43 1 : uint64_t freq = 1UL;
44 : #ifndef RUN_TEST
45 : asm volatile("mrs %0, CNTFRQ_EL0" : "=r"(freq) :);
46 : #endif
47 1 : return freq;
48 : }
49 :
50 1 : void SendToProfiling(const std::string& sendData, const std::string& mark)
51 : {
52 : UNUSED(sendData);
53 : UNUSED(mark);
54 1 : }
55 :
56 1 : int32_t SetProfHandle(const std::shared_ptr<ProfMessage> profMsg)
57 : {
58 : UNUSED(profMsg);
59 1 : return 0;
60 : }
61 :
62 1 : uint64_t NowMicros() //
63 : {
64 1 : return 1UL;
65 : }
66 :
67 1 : void ReleaseProfiling() {}
68 :
69 1 : void InitProfiling(const uint32_t deviceId, const pid_t hostPid, const uint32_t channelId)
70 : {
71 : UNUSED(deviceId);
72 : UNUSED(hostPid);
73 : UNUSED(channelId);
74 1 : }
75 :
76 1 : void InitProfilingDataInfo(const uint32_t deviceId, const pid_t hostPid, const uint32_t channelId)
77 : {
78 : UNUSED(deviceId);
79 : UNUSED(hostPid);
80 : UNUSED(channelId);
81 1 : }
82 :
83 1 : void SetProfilingFlagForKFC(const uint32_t flag) { UNUSED(flag); }
84 1 : void LoadProfilingLib() {}
85 :
86 1 : int32_t SetMsprofReporterCallback(MsprofReporterCallback reportCallback)
87 : {
88 : UNUSED(reportCallback);
89 1 : return static_cast<int32_t>(ProfStatusCode::PROFILINE_SUCCESS);
90 : }
91 :
92 1 : bool IsSupportedProfData() { return false; }
93 :
94 : #ifdef __cplusplus
95 : }
96 : #endif
97 :
98 1 : ProfMessage::ProfMessage(const char_t* tag) : std::basic_ostringstream<char_t>(), tag_(tag), sendData_() {}
99 :
100 1 : ProfMessage::~ProfMessage() {}
101 : } // namespace aicpu
|