/* ---------------------------------------------------------------------------- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: LiteOS Trace Pipeline Implementation HeadFile * Author: Huawei LiteOS Team * Create: 2020-03-16 * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written * permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * --------------------------------------------------------------------------- */ #ifndef _TRACE_PIPELINE_H #define _TRACE_PIPELINE_H #include "los_typedef.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ /*用于实现追踪流水线的功能*/ typedef struct { UINT32 (*init)(VOID); //用于初始化// VOID (*dataSend)(UINT16 len, UINT8 *data); //用于发送数据// UINT32 (*dataRecv)(UINT8 *data, UINT32 size, UINT32 timeout); //用于接收数据// UINT32 (*wait)(VOID); //用于等待操作// } TracePipelineOps; /* used as tlv's tag */ enum TraceMsgType { //用于表示追踪消息的类型// //类型如下// NOTIFY, //通知// HEAD, //头部// OBJ, //对象// EVENT, //事件// TRACE_MSG_MAX, //最大值// }; enum TraceNotifySubType { //用于表示通知消息的子类型// CMD = 0x1, PARAMS, }; enum TraceHeadSubType { //用于表示追踪头部信息的子类型// ENDIAN = 0x1, //字节序// VERSION, //版本// OBJ_SIZE, //对象大小// OBJ_COUNT, //对象计数// CUR_INDEX, //当前索引// MAX_RECODE, CUR_OBJ_INDEX, CLOCK_FREQ, }; enum TraceObjSubType { //用于表示追踪对象的子类型// ADDR = 0x1, //地址// PRIO, //优先级/ NAME, //名称// }; enum TraceEvtSubType { //用于表示追踪事件的子类型// CORE = 0x1, //核心编号// EVENT_CODE, //事件码// CUR_TIME, //当前时间// EVENT_COUNT, //事件计数// CUR_TASK, //当前任务// IDENTITY, //身份信息// EVENT_PARAMS, //事件参数// }; extern VOID OsTracePipelineReg(const TracePipelineOps *ops); //用于注册追踪管道操作// extern UINT32 OsTracePipelineInit(VOID); //用于初始化追踪管道// extern VOID OsTraceDataSend(UINT8 type, UINT16 len, UINT8 *data); //用于发送追踪数据// extern UINT32 OsTraceDataRecv(UINT8 *data, UINT32 size, UINT32 timeout); //用于接收追踪数据// extern UINT32 OsTraceDataWait(VOID); //用于等待追踪数据// #ifdef __cplusplus #if __cplusplus } #endif /* __cplusplus */ #endif /* __cplusplus */ #endif /* _TRACE_PIPELINE_H */