* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
#include <cstdint>
#ifndef DATA_STRUCT_STUB_H
#define DATA_STRUCT_STUB_H
constexpr uint8_t HWTS_TASK_START_TYPE = 0;
constexpr uint8_t HWTS_TASK_END_TYPE = 1;
constexpr uint8_t HWTS_INVALID_TYPE = 0xff;
constexpr uint32_t HWTS_DATA_SIZE = 64;
struct HwtsProfileType01 {
uint8_t cntRes0Type;
uint8_t reserved;
uint16_t hex6bd3;
uint8_t reserved1[2];
uint16_t taskId;
uint64_t syscnt;
uint32_t streamId;
uint8_t reserved2[44];
};
struct HwtsProfileType2 {
uint8_t cntRes0Type;
uint8_t coreId;
uint16_t hex6bd3;
uint16_t blockId;
uint16_t taskId;
uint64_t syscnt;
uint32_t streamId;
uint8_t reserved[44];
};
struct HwtsProfileType3 {
uint8_t cntWarnType;
uint8_t coreId;
uint16_t hex6bd3;
uint16_t blockId;
uint16_t taskId;
uint64_t syscnt;
uint32_t streamId;
uint8_t reserved[4];
uint64_t warnStatus;
uint8_t reserved2[32];
};
struct TsProfileDataHead {
uint8_t mode;
uint8_t rptType;
uint16_t bufSize;
uint8_t reserved[4];
};
struct TsProfileTimeline {
TsProfileDataHead head;
uint16_t taskType;
uint16_t taskState;
uint16_t streamId;
uint16_t taskId;
uint64_t timestamp;
uint32_t thread;
uint32_t deviceId;
};
struct TsProfileKeypoint {
TsProfileDataHead head;
uint64_t timestamp;
uint64_t indexId;
uint64_t modelId;
uint16_t streamId;
uint16_t taskId;
uint16_t tagId;
uint16_t resv;
};
constexpr uint8_t TS_TIMELINE_RPT_TYPE = 3;
constexpr uint8_t TS_KEYPOINT_RPT_TYPE = 10;
constexpr uint8_t TS_INVALID_TYPE = 0xff;
constexpr uint16_t TS_TIMELINE_START_TASK_STATE = 2;
constexpr uint16_t TS_TIMELINE_END_TASK_STATE = 3;
constexpr uint16_t TS_TIMELINE_AICORE_START_TASK_STATE = 7;
constexpr uint16_t TS_TIMELINE_AICORE_END_TASK_STATE = 8;
constexpr uint16_t TS_KEYPOINT_START_TASK_STATE = 0;
constexpr uint16_t TS_KEYPOINT_END_TASK_STATE = 1;
constexpr int32_t STARS_DATA_SIZE = 64;
constexpr int32_t ACSQ_TASK_START_FUNC_TYPE = 0;
constexpr int32_t ACSQ_TASK_END_FUNC_TYPE = 1;
constexpr int32_t FFTS_SUBTASK_THREAD_START_FUNC_TYPE = 34;
constexpr int32_t FFTS_SUBTASK_THREAD_END_FUNC_TYPE = 35;
struct StarsLogHead {
uint16_t logType : 6;
uint16_t cnt : 4;
uint16_t sqeType : 6;
uint16_t hex6bd3;
};
struct StarsAcsqLog {
StarsLogHead head;
uint16_t streamId;
uint16_t taskId;
uint32_t sysCountLow;
uint32_t sysCountHigh;
uint32_t reserved[12];
};
struct StarsCxtLog {
StarsLogHead head;
uint16_t streamId;
uint16_t taskId;
uint32_t sysCountLow;
uint32_t sysCountHigh;
uint8_t cxtType;
uint8_t res0;
uint16_t cxtId;
uint16_t rsv1 : 13;
uint16_t fftsType : 3;
uint16_t threadId;
uint32_t rsv[10];
};
#endif