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