WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_trace_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
3 * Description: LiteOS Trace Module Private HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2019-08-30
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29#ifndef _LOS_TRACE_PRI_H
30#define _LOS_TRACE_PRI_H
31
32#include "los_trace.h"
33#include "los_task_pri.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
39#ifdef LOSCFG_TRACE_CONTROL_AGENT
40#define TRACE_CMD_END_CHAR 0xD
41#endif
42
43#define TRACE_ERROR PRINT_ERR
44#define TRACE_MODE_OFFLINE 0
45#define TRACE_MODE_ONLINE 1
46
47/* just task and hwi were traced */
48#define TRACE_DEFAULT_MASK ((UINT32)TRACE_HWI_FLAG | (UINT32)TRACE_TASK_FLAG)
49#define TRACE_CTL_MAGIC_NUM 0xDEADBEEF
50#define TRACE_BIGLITTLE_WORD 0x12345678
51#define TRACE_VERSION(MODE) (0xFFFFFFFF & (MODE))
52#define TRACE_MASK_COMBINE(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
53
54#define TRACE_GET_MODE_FLAG(type) ((type) & 0xFFFFFFF0)
55
57#define TRACE_LOCK(state) LOS_SpinLockSave(&g_traceSpin, &(state))
58#define TRACE_UNLOCK(state) LOS_SpinUnlockRestore(&g_traceSpin, (state))
59
60typedef VOID (*TRACE_DUMP_HOOK)(BOOL toClient);
62extern VOID *g_osTraceBuf;
63
71
85
90typedef struct {
91 UINT32 cmd; /* trace start or stop cmd */
92 UINT32 param; /* magic numb stand for notify msg */
94
99typedef struct {
100 struct WriteCtrl {
101 UINT16 curIndex; /* The current record index */
102 UINT16 maxRecordCount; /* The max num of track items */
103 UINT16 curObjIndex; /* The current obj index */
104 UINT16 maxObjCount; /* The max num of obj index */
105 ObjData *objBuf; /* Pointer to obj info data */
106 TraceEventFrame *frameBuf; /* Pointer to the track items */
107 } ctrl;
110
112extern VOID OsTraceSetObj(ObjData *obj, const LosTaskCB *tcb);
114extern UINT32 OsTraceBufInit(VOID *buf, UINT32 size);
115extern VOID OsTraceObjAdd(UINT32 eventType, UINT32 taskId);
118
119#ifdef LOSCFG_RECORDER_MODE_ONLINE
120extern VOID OsTraceSendHead(VOID);
121extern VOID OsTraceSendObjTable(VOID);
122extern VOID OsTraceSendNotify(UINT32 type, UINT32 value);
123
124#define OsTraceNotifyStart() do { \
125 OsTraceSendNotify(SYS_START, TRACE_CTL_MAGIC_NUM); \
126 OsTraceSendHead(); \
127 OsTraceSendObjTable(); \
128 } while (0)
129
130#define OsTraceNotifyStop() do { \
131 OsTraceSendNotify(SYS_STOP, TRACE_CTL_MAGIC_NUM); \
132 } while (0)
133
134#define OsTraceReset()
135#define OsTraceRecordDump(toClient)
136#else
138extern VOID OsTraceRecordDump(BOOL toClient);
139#define OsTraceNotifyStart()
140#define OsTraceNotifyStop()
141#endif
142
143#ifdef __cplusplus
144}
145#endif /* __cplusplus */
146
147#endif /* _LOS_TRACE_PRI_H */
VOID(* TRACE_DUMP_HOOK)(BOOL toClient)
Definition los_trace_pri.h:60
VOID OsTraceReset(VOID)
VOID * g_osTraceBuf
TraceCmd
Definition los_trace_pri.h:64
@ TRACE_CMD_STOP
Definition los_trace_pri.h:66
@ TRACE_CMD_SET_EVENT_MASK
Definition los_trace_pri.h:67
@ TRACE_CMD_START
Definition los_trace_pri.h:65
@ TRACE_CMD_MAX_CODE
Definition los_trace_pri.h:69
@ TRACE_CMD_RECODE_DUMP
Definition los_trace_pri.h:68
TRACE_DUMP_HOOK g_traceDumpHook
OfflineHead * OsTraceRecordGet(VOID)
UINT32 OsTraceBufInit(VOID *buf, UINT32 size)
VOID OsTraceRecordDump(BOOL toClient)
UINT32 OsTraceGetMaskTid(UINT32 taskId)
VOID OsTraceObjAdd(UINT32 eventType, UINT32 taskId)
VOID OsTraceWriteOrSendEvent(const TraceEventFrame *frame)
SPIN_LOCK_S g_traceSpin
BOOL OsTraceIsEnable(VOID)
VOID OsTraceSetObj(ObjData *obj, const LosTaskCB *tcb)
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned char UINT8
Definition los_typedef.h:50
unsigned int UINT32
Definition los_typedef.h:52
size_t BOOL
Definition los_typedef.h:83
osal_u8 type
Definition oal_net.h:0
Definition los_trace.h:264
Definition los_trace.h:274
Definition los_spinlock.h:78
Definition los_trace_pri.h:76
UINT8 cmd
Definition los_trace_pri.h:77
UINT8 param4
Definition los_trace_pri.h:81
UINT8 param5
Definition los_trace_pri.h:82
UINT8 param3
Definition los_trace_pri.h:80
UINT8 param2
Definition los_trace_pri.h:79
UINT8 end
Definition los_trace_pri.h:83
UINT8 param1
Definition los_trace_pri.h:78
Definition los_trace.h:236
Definition los_trace_pri.h:90
UINT32 cmd
Definition los_trace_pri.h:91
UINT32 param
Definition los_trace_pri.h:92
Definition los_trace_pri.h:100
UINT16 maxObjCount
Definition los_trace_pri.h:104
UINT16 curIndex
Definition los_trace_pri.h:101
UINT16 maxRecordCount
Definition los_trace_pri.h:102
UINT16 curObjIndex
Definition los_trace_pri.h:103
ObjData * objBuf
Definition los_trace_pri.h:105
TraceEventFrame * frameBuf
Definition los_trace_pri.h:106
Definition los_trace_pri.h:99
OfflineHead * head
Definition los_trace_pri.h:108
Definition los_task_base.h:131