* 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.
*/
* This header file is not part of the public API. Compatibility is not guaranteed,
* and it will be deprecated in future versions.
*/
#ifndef MSPROFILER_PROF_COMMON_H
#define MSPROFILER_PROF_COMMON_H
#include <stdint.h>
#include <stddef.h>
#include "aprof_pub.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MSPROF_DATA_HEAD_MAGIC_NUM 0x5A5AU
#define MSPROF_TASK_TIME_L0 0x00000800ULL
typedef const void* ConstVoidPtr;
typedef int32_t (*MsprofSetDeviceHandle)(VOID_PTR data, uint32_t len);
typedef int32_t (*MsprofCtrlCallback)(uint32_t type, void *data, uint32_t len);
typedef int32_t (*MsprofReporterCallback)(uint32_t moduleId, uint32_t type, void *data, uint32_t len);
enum ProfileCallbackType {
PROFILE_CTRL_CALLBACK = 0,
PROFILE_DEVICE_STATE_CALLBACK,
PROFILE_REPORT_API_CALLBACK,
PROFILE_REPORT_EVENT_CALLBACK,
PROFILE_REPORT_COMPACT_CALLBACK,
PROFILE_REPORT_ADDITIONAL_CALLBACK,
PROFILE_REPORT_REG_TYPE_INFO_CALLBACK,
PROFILE_REPORT_GET_HASH_ID_CALLBACK,
PROFILE_HOST_FREQ_IS_ENABLE_CALLBACK,
PROFILE_REPORT_API_C_CALLBACK,
PROFILE_REPORT_EVENT_C_CALLBACK,
PROFILE_REPORT_REG_TYPE_INFO_C_CALLBACK,
PROFILE_REPORT_GET_HASH_ID_C_CALLBACK,
PROFILE_HOST_FREQ_IS_ENABLE_C_CALLBACK,
PROFILE_REPORT_REG_DATA_FORMAT_CALLBACK,
PROFILE_REPORT_REG_DATA_FORMAT_C_CALLBACK,
PROFILE_DEVICE_STATE_C_CALLBACK,
};
enum MsprofDataTag {
MSPROF_ACL_DATA_TAG = 0,
MSPROF_GE_DATA_TAG_MODEL_LOAD = 20,
MSPROF_GE_DATA_TAG_FUSION = 21,
MSPROF_GE_DATA_TAG_INFER = 22,
MSPROF_GE_DATA_TAG_TASK = 23,
MSPROF_GE_DATA_TAG_TENSOR = 24,
MSPROF_GE_DATA_TAG_STEP = 25,
MSPROF_GE_DATA_TAG_ID_MAP = 26,
MSPROF_GE_DATA_TAG_HOST_SCH = 27,
MSPROF_RUNTIME_DATA_TAG_API = 40,
MSPROF_RUNTIME_DATA_TAG_TRACK = 41,
MSPROF_AICPU_DATA_TAG = 60,
MSPROF_AICPU_MODEL_TAG = 61,
MSPROF_HCCL_DATA_TAG = 80,
MSPROF_DP_DATA_TAG = 100,
MSPROF_MSPROFTX_DATA_TAG = 120,
MSPROF_DATA_TAG_MAX = 65536,
};
enum MsprofMindsporeNodeTag {
GET_NEXT_DEQUEUE_WAIT = 1,
};
* @brief struct of mixed data
*/
#define MSPROF_MIX_DATA_RESERVE_BYTES 7
#define MSPROF_MIX_DATA_STRING_LEN 120
enum MsprofMixDataType {
MSPROF_MIX_DATA_HASH_ID = 0,
MSPROF_MIX_DATA_STRING,
};
struct MsprofMixData {
uint8_t type;
uint8_t rsv[MSPROF_MIX_DATA_RESERVE_BYTES];
union {
uint64_t hashId;
char dataStr[MSPROF_MIX_DATA_STRING_LEN];
} data;
};
* @brief profiling MsprofStart config
*/
#define MAX_DUMP_PATH_LEN 1024
#define MAX_SAMPLE_CONFIG_LEN 4096
struct MsprofConfig {
uint64_t profSwitch;
uint64_t profSwitchHi;
uint32_t devNums;
uint32_t devIdList[MSPROF_MAX_DEV_NUM + 1];
uint32_t modelId;
uint32_t type;
uint32_t cacheFlag;
uint32_t storageLimit;
uint32_t metrics;
uintptr_t fd;
char dumpPath[MAX_DUMP_PATH_LEN];
char sampleConfig[MAX_SAMPLE_CONFIG_LEN];
};
* @brief struct of data reported by acl
*/
#define MSPROF_ACL_DATA_RESERVE_BYTES 32
#define MSPROF_ACL_API_NAME_LEN 64
enum MsprofAclApiType {
MSPROF_ACL_API_TYPE_OP = 1,
MSPROF_ACL_API_TYPE_MODEL,
MSPROF_ACL_API_TYPE_RUNTIME,
MSPROF_ACL_API_TYPE_OTHERS,
};
struct MsprofAclProfData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_ACL_DATA_TAG;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t apiType;
uint64_t beginTime;
uint64_t endTime;
uint32_t processId;
uint32_t threadId;
char apiName[MSPROF_ACL_API_NAME_LEN];
uint8_t reserve[MSPROF_ACL_DATA_RESERVE_BYTES];
};
* @brief struct of data reported by GE
*/
#define MSPROF_GE_MODELLOAD_DATA_RESERVE_BYTES 104
struct MsprofGeProfModelLoadData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_MODEL_LOAD;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t modelId;
struct MsprofMixData modelName;
uint64_t startTime;
uint64_t endTime;
uint8_t reserve[MSPROF_GE_MODELLOAD_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_FUSION_DATA_RESERVE_BYTES 8
#define MSPROF_GE_FUSION_OP_NUM 8
struct MsprofGeProfFusionData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_FUSION;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t modelId;
struct MsprofMixData fusionName;
uint64_t inputMemSize;
uint64_t outputMemSize;
uint64_t weightMemSize;
uint64_t workspaceMemSize;
uint64_t totalMemSize;
uint64_t fusionOpNum;
uint64_t fusionOp[MSPROF_GE_FUSION_OP_NUM];
uint8_t reserve[MSPROF_GE_FUSION_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_INFER_DATA_RESERVE_BYTES 64
struct MsprofGeProfInferData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_INFER;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t modelId;
struct MsprofMixData modelName;
uint32_t requestId;
uint32_t threadId;
uint64_t inputDataStartTime;
uint64_t inputDataEndTime;
uint64_t inferStartTime;
uint64_t inferEndTime;
uint64_t outputDataStartTime;
uint64_t outputDataEndTime;
uint8_t reserve[MSPROF_GE_INFER_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_TASK_DATA_RESERVE_BYTES 12
#define MSPROF_GE_OP_TYPE_LEN 56
enum MsprofGeShapeType {
MSPROF_GE_SHAPE_TYPE_STATIC = 0,
MSPROF_GE_SHAPE_TYPE_DYNAMIC,
};
struct MsprofGeOpType {
uint8_t type;
uint8_t rsv[MSPROF_MIX_DATA_RESERVE_BYTES];
union {
uint64_t hashId;
char dataStr[MSPROF_GE_OP_TYPE_LEN];
} data;
};
struct MsprofGeProfTaskData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_TASK;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t taskType;
struct MsprofMixData opName;
struct MsprofGeOpType opType;
uint64_t curIterNum;
uint64_t timeStamp;
uint32_t shapeType;
uint32_t blockDims;
uint32_t modelId;
uint32_t streamId;
uint32_t taskId;
uint32_t threadId;
uint32_t contextId;
uint8_t reserve[MSPROF_GE_TASK_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_TENSOR_DATA_RESERVE_BYTES 8
struct MsprofGeTensorData {
uint32_t tensorType;
uint32_t format;
uint32_t dataType;
uint32_t shape[MSPROF_GE_TENSOR_DATA_SHAPE_LEN];
};
struct MsprofGeProfTensorData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_TENSOR;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t modelId;
uint64_t curIterNum;
uint32_t streamId;
uint32_t taskId;
uint32_t tensorNum;
struct MsprofGeTensorData tensorData[MSPROF_GE_TENSOR_DATA_NUM];
uint8_t reserve[MSPROF_GE_TENSOR_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_STEP_DATA_RESERVE_BYTES 27
enum MsprofGeStepTag {
MSPROF_GE_STEP_TAG_BEGIN = 0,
MSPROF_GE_STEP_TAG_END,
};
struct MsprofGeProfStepData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_STEP;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t modelId;
uint32_t streamId;
uint32_t taskId;
uint64_t timeStamp;
uint64_t curIterNum;
uint32_t threadId;
uint8_t tag;
uint8_t reserve[MSPROF_GE_STEP_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_ID_MAP_DATA_RESERVE_BYTES 6
struct MsprofGeProfIdMapData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_ID_MAP;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t graphId;
uint32_t modelId;
uint32_t sessionId;
uint64_t timeStamp;
uint16_t mode;
uint8_t reserve[MSPROF_GE_ID_MAP_DATA_RESERVE_BYTES];
};
#define MSPROF_GE_HOST_SCH_DATA_RESERVE_BYTES 24
struct MsprofGeProfHostSchData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_GE_DATA_TAG_HOST_SCH;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t threadId;
uint64_t element;
uint64_t event;
uint64_t startTime;
uint64_t endTime;
uint8_t reserve[MSPROF_GE_HOST_SCH_DATA_RESERVE_BYTES];
};
* @brief struct of data reported by RunTime
*/
#define MSPROF_AICPU_DATA_RESERVE_BYTES 9
struct MsprofAicpuProfData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_AICPU_DATA_TAG;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint16_t streamId;
uint16_t taskId;
uint64_t runStartTime;
uint64_t runStartTick;
uint64_t computeStartTime;
uint64_t memcpyStartTime;
uint64_t memcpyEndTime;
uint64_t runEndTime;
uint64_t runEndTick;
uint32_t threadId;
uint32_t deviceId;
uint64_t submitTick;
uint64_t scheduleTick;
uint64_t tickBeforeRun;
uint64_t tickAfterRun;
uint32_t kernelType;
uint32_t dispatchTime;
uint32_t totalTime;
uint16_t fftsThreadId;
uint8_t version;
uint8_t reserve[MSPROF_AICPU_DATA_RESERVE_BYTES];
};
struct MsprofAicpuModelProfData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_AICPU_MODEL_TAG;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t rsv;
uint64_t timeStamp;
uint64_t indexId;
uint32_t modelId;
uint16_t tagId;
uint16_t rsv1;
uint64_t eventId;
uint8_t reserve[24];
};
* @brief struct of data reported by DP
*/
#define MSPROF_DP_DATA_RESERVE_BYTES 16
#define MSPROF_DP_DATA_ACTION_LEN 16
#define MSPROF_DP_DATA_SOURCE_LEN 64
struct MsprofDpProfData {
#ifdef __cplusplus
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM;
uint16_t dataTag = MSPROF_DP_DATA_TAG;
#else
uint16_t magicNumber;
uint16_t dataTag;
#endif
uint32_t rsv;
uint64_t timeStamp;
char action[MSPROF_DP_DATA_ACTION_LEN];
char source[MSPROF_DP_DATA_SOURCE_LEN];
uint64_t index;
uint64_t size;
uint8_t reserve[MSPROF_DP_DATA_RESERVE_BYTES];
};
struct MsprofAicpuNodeAdditionalData {
uint16_t streamId;
uint16_t taskId;
uint64_t runStartTime;
uint64_t runStartTick;
uint64_t computeStartTime;
uint64_t memcpyStartTime;
uint64_t memcpyEndTime;
uint64_t runEndTime;
uint64_t runEndTick;
uint32_t threadId;
uint32_t deviceId;
uint64_t submitTick;
uint64_t scheduleTick;
uint64_t tickBeforeRun;
uint64_t tickAfterRun;
uint32_t kernelType;
uint32_t dispatchTime;
uint32_t totalTime;
uint16_t fftsThreadId;
uint8_t version;
uint8_t reserve[MSPROF_AICPU_DATA_RESERVE_BYTES];
};
struct MsprofAicpuModelAdditionalData {
uint64_t indexId;
uint32_t modelId;
uint16_t tagId;
uint16_t rsv1;
uint64_t eventId;
uint8_t reserve[24];
};
struct MsprofAicpuDpAdditionalData {
char action[MSPROF_DP_DATA_ACTION_LEN];
char source[MSPROF_DP_DATA_SOURCE_LEN];
uint64_t index;
uint64_t size;
uint8_t reserve[MSPROF_DP_DATA_RESERVE_BYTES];
};
struct MsprofAicpuMiAdditionalData {
uint32_t nodeTag;
uint32_t reserve;
uint64_t queueSize;
uint64_t runStartTime;
uint64_t runEndTime;
};
struct AicpuKfcProfCommTurn {
uint64_t serverStartTime;
uint64_t waitMsgStartTime;
uint64_t kfcAlgExeStartTime;
uint64_t sendTaskStartTime;
uint64_t sendSqeFinishTime;
uint64_t rtsqExeEndTime;
uint64_t serverEndTime;
uint64_t dataLen;
uint32_t deviceId;
uint16_t streamId;
uint16_t taskId;
uint8_t version;
uint8_t commTurn;
uint8_t currentTurn;
uint8_t reserve[5];
};
struct AicpuKfcProfComputeTurn {
uint64_t waitComputeStartTime;
uint64_t computeStartTime;
uint64_t computeExeEndTime;
uint64_t dataLen;
uint32_t deviceId;
uint16_t streamId;
uint16_t taskId;
uint8_t version;
uint8_t computeTurn;
uint8_t currentTurn;
uint8_t reserve[5];
};
struct MsporfAicpuFlipTask {
uint16_t streamId;
uint16_t taskId;
uint32_t flipNum;
uint32_t reserve[2];
};
struct MsprofAicpuHcclMainStreamTask {
uint16_t aicpuStreamId;
uint16_t aicpuTaskId;
uint16_t streamId;
uint16_t taskId;
uint16_t type;
uint16_t reserve[3];
};
* @brief struct of data reported by HCCL
*/
#pragma pack(4)
struct MsprofHcclProfNotify {
uint32_t taskID;
uint64_t notifyID;
uint32_t stage;
uint32_t remoteRank;
uint32_t transportType;
uint32_t role;
double durationEstimated;
};
struct MsprofHcclProfReduce {
uint32_t taskID;
uint64_t src;
uint64_t dst;
uint64_t size;
uint32_t op;
uint32_t dataType;
uint32_t linkType;
uint32_t remoteRank;
uint32_t transportType;
uint32_t role;
double durationEstimated;
};
struct MsprofHcclProfRDMA {
uint32_t taskID;
uint64_t src;
uint64_t dst;
uint64_t size;
uint64_t notifyID;
uint32_t linkType;
uint32_t remoteRank;
uint32_t transportType;
uint32_t role;
uint32_t type;
double durationEstimated;
};
struct MsprofHcclProfMemcpy {
uint32_t taskID;
uint64_t src;
uint64_t dst;
uint64_t size;
uint64_t notifyID;
uint32_t linkType;
uint32_t remoteRank;
uint32_t transportType;
uint32_t role;
double durationEstimated;
};
struct MsprofHcclProfStageStep {
uint32_t rank;
uint32_t rankSize;
};
struct MsprofHcclProfFlag {
uint64_t cclTag;
uint64_t groupName;
uint32_t localRank;
uint32_t workFlowMode;
};
#define MSPROF_HCCL_INVALID_UINT 0xFFFFFFFFU
struct MsprofHcclInfo {
uint64_t itemId;
uint64_t cclTag;
uint64_t groupName;
uint32_t localRank;
uint32_t remoteRank;
uint32_t rankSize;
uint32_t workFlowMode;
uint32_t planeID;
uint32_t ctxId;
uint64_t notifyID;
uint32_t stage;
uint32_t role;
double durationEstimated;
uint64_t srcAddr;
uint64_t dstAddr;
uint64_t dataSize;
uint32_t opType;
uint32_t dataType;
uint32_t linkType;
uint32_t transportType;
uint32_t rdmaType;
uint32_t reserve2;
#ifdef __cplusplus
MsprofHcclInfo() : role(MSPROF_HCCL_INVALID_UINT), opType(MSPROF_HCCL_INVALID_UINT),
dataType(MSPROF_HCCL_INVALID_UINT), linkType(MSPROF_HCCL_INVALID_UINT),
transportType(MSPROF_HCCL_INVALID_UINT), rdmaType(MSPROF_HCCL_INVALID_UINT)
{
}
#endif
};
struct MsprofAicpuMC2HcclInfo {
uint64_t itemId;
uint64_t cclTag;
uint64_t groupName;
uint32_t localRank;
uint32_t remoteRank;
uint32_t rankSize;
uint32_t workFlowMode;
uint32_t planeID;
uint32_t ctxId;
uint64_t notifyID;
uint32_t stage;
uint32_t role;
double durationEstimated;
uint64_t srcAddr;
uint64_t dstAddr;
uint64_t dataSize;
uint32_t opType;
uint32_t dataType;
uint32_t linkType;
uint32_t transportType;
uint32_t rdmaType;
uint32_t taskId;
uint16_t streamId;
uint16_t reserve[3];
};
struct ProfilingDeviceCommResInfo {
uint64_t groupName;
uint32_t rankSize;
uint32_t rankId;
uint32_t usrRankId;
uint32_t aicpuKfcStreamId;
uint32_t commStreamSize;
uint32_t commStreamIds[8];
uint32_t reserve;
};
#define MSPROF_MULTI_THREAD_MAX_NUM 25
struct MsprofMultiThread {
uint32_t threadNum;
uint32_t threadId[MSPROF_MULTI_THREAD_MAX_NUM];
};
#pragma pack()
#pragma pack(1)
struct MsprofAicpuHCCLOPInfo {
uint8_t relay : 1;
uint8_t retry : 1;
uint8_t dataType;
uint64_t algType;
uint64_t count;
uint64_t groupName;
uint32_t ranksize;
uint16_t streamId;
uint32_t taskId;
};
struct MsprofAicpuHcclTaskInfo{
uint64_t itemId;
uint64_t cclTag;
uint64_t groupName;
uint32_t localRank;
uint32_t remoteRank;
uint32_t rankSize;
uint32_t stage;
uint64_t notifyID;
uint64_t timeStamp;
double durationEstimated;
uint64_t srcAddr;
uint64_t dstAddr;
uint64_t dataSize;
uint32_t taskId;
uint32_t reserve;
uint16_t streamId;
uint16_t planeID;
uint8_t opType;
uint8_t dataType;
uint8_t linkType;
uint8_t transportType;
uint8_t rdmaType;
uint8_t role;
uint8_t workFlowMode;
uint8_t reserves[9];
};
struct ProfFusionOpInfo {
uint64_t opName;
uint32_t fusionOpNum;
uint64_t inputMemsize;
uint64_t outputMemsize;
uint64_t weightMemSize;
uint64_t workspaceMemSize;
uint64_t totalMemSize;
uint64_t fusionOpId[MSPROF_GE_FUSION_OP_NUM];
};
struct MsprofGraphIdInfo {
uint64_t modelName;
uint32_t graphId;
uint32_t modelId;
};
struct MsprofMemoryInfo {
uint64_t addr;
int64_t size;
uint64_t nodeId;
uint64_t totalAllocateMemory;
uint64_t totalReserveMemory;
uint32_t deviceId;
uint32_t deviceType;
};
* @name MsprofStampInfo
* @brief struct of data reported by msproftx
*/
#define PAYLOAD_VALUE_LEN 2
#define MAX_MESSAGE_LEN 156
struct MsprofStampInfo {
uint16_t magicNumber;
uint16_t dataTag;
uint32_t processId;
uint32_t threadId;
uint32_t category;
uint32_t eventType;
int32_t payloadType;
union PayloadValue {
uint64_t ullValue;
int64_t llValue;
double dValue;
uint32_t uiValue[PAYLOAD_VALUE_LEN];
int32_t iValue[PAYLOAD_VALUE_LEN];
float fValue[PAYLOAD_VALUE_LEN];
} payload;
uint64_t startTime;
uint64_t endTime;
uint64_t markId;
uint64_t domain;
int32_t messageType;
char message[MAX_MESSAGE_LEN];
};
#define MSPROF_TX_VALUE_MAX_LEN 224
struct MsprofTxInfo {
uint16_t infoType;
uint16_t res0;
uint32_t res1;
union {
struct MsprofStampInfo stampInfo;
uint8_t data[MSPROF_TX_VALUE_MAX_LEN];
} value;
};
struct MsprofStaticOpMem {
int64_t size;
uint64_t opName;
uint64_t lifeStart;
uint64_t lifeEnd;
uint64_t totalAllocateMemory;
uint64_t dynOpName;
uint32_t graphId;
};
#define MSPROF_PHYSIC_STREAM_ID_MAX_NUM 56
struct MsprofLogicStreamInfo {
uint32_t logicStreamId;
uint32_t physicStreamNum;
uint32_t physicStreamId[MSPROF_PHYSIC_STREAM_ID_MAX_NUM];
};
struct MsprofExeomLoadInfo {
uint32_t modelId;
uint32_t reserve;
uint64_t modelName;
};
#pragma pack()
#define MSPROF_ENGINE_MAX_TAG_LEN (63)
* @name ReporterData
* @brief struct of data to report
*/
struct ReporterData {
char tag[MSPROF_ENGINE_MAX_TAG_LEN + 1];
int32_t deviceId;
size_t dataLen;
uint8_t *data;
};
* @name MsprofHashData
* @brief struct of data to hash
*/
struct MsprofHashData {
int32_t deviceId;
size_t dataLen;
uint8_t *data;
uint64_t hashId;
};
enum MsprofConfigParamType {
DEV_CHANNEL_RESOURCE = 0,
HELPER_HOST_SERVER
};
* @name MsprofConfigParam
* @brief struct of set config
*/
struct MsprofConfigParam {
uint32_t deviceId;
uint32_t type;
uint32_t value;
};
* @name MsprofReporterModuleId
* @brief module id of data to report
*/
enum MsprofReporterModuleId {
MSPROF_MODULE_DATA_PREPROCESS = 0,
MSPROF_MODULE_HCCL,
MSPROF_MODULE_ACL,
MSPROF_MODULE_FRAMEWORK,
MSPROF_MODULE_RUNTIME,
MSPROF_MODULE_MSPROF
};
* @name MsprofReporterCallbackType
* @brief reporter callback request type
*/
enum MsprofReporterCallbackType {
MSPROF_REPORTER_REPORT = 0,
MSPROF_REPORTER_INIT,
MSPROF_REPORTER_UNINIT,
MSPROF_REPORTER_DATA_MAX_LEN,
MSPROF_REPORTER_HASH
};
enum MsprofConfigType {
MSPROF_CONFIG_HELPER_HOST = 0
};
* @brief Prof Chip ID
*/
enum Prof_Chip_ID {
PROF_CHIP_ID0 = 0
};
* @brief the struct of profiling set setp info
*/
typedef struct ProfStepInfoCmd {
uint64_t index_id;
uint16_t tag_id;
void *stream;
} ProfStepInfoCmd_t;
* @brief the struct of raw data, using in acp, acp will be discarded in later versions.
*/
enum RawDataType {
API_DATA_TYPE = 0,
EVENT_DATA_TYPE = 1,
RUNTIMETRACK_DATA_TYPE = 3,
PMU_DATA_TYPE = 4,
DEFAULT_DATA_TYPE = 5
};
#define RAW_DATA_MAXSIZE (256)
typedef struct {
bool isLastChunk;
size_t offset;
int32_t chunkModule;
int32_t deviceId;
enum RawDataType type;
size_t chunkSize;
char chunk[RAW_DATA_MAXSIZE];
} MsprofRawData;
typedef int32_t(*MsprofRawDataCallback)(MsprofRawData* rawData);
#ifdef __cplusplus
}
#endif
#endif