diff --git a/components/shell/src/base/shcmd.c b/components/shell/src/base/shcmd.c index 40f107c4..f2d7e821 100644 --- a/components/shell/src/base/shcmd.c +++ b/components/shell/src/base/shcmd.c @@ -43,6 +43,10 @@ #include "los_debugtools.h" #endif +#if (LOSCFG_KERNEL_TRACE == 1) +#include "los_trace_pri.h" +#endif + #define SHELL_INIT_MAGIC_FLAG 0xABABABAB STATIC CmdModInfo cmdInfo; @@ -75,6 +79,13 @@ CmdItem g_shellcmdAll[] = { {CMD_TYPE_EX, "st", 1, (CmdCallBackFunc)OsShellCmdSchedTrace}, #endif {CMD_TYPE_EX, "help", 0, (CmdCallBackFunc)OsShellCmdHelp}, +#if (LOSCFG_KERNEL_TRACE == 1) + {CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart}, + {CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop}, + {CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask}, + {CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset}, + {CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump}, +#endif }; CmdModInfo *OsCmdInfoGet(VOID) diff --git a/components/trace/BUILD.gn b/components/trace/BUILD.gn index e101935f..23729ede 100644 --- a/components/trace/BUILD.gn +++ b/components/trace/BUILD.gn @@ -64,3 +64,11 @@ kernel_module(module_name) { include_dirs += [ "pipeline/serial" ] } } + +config("public") { + include_dirs = [ + ".", + "cnv", + "pipeline", + ] +} diff --git a/components/trace/los_trace.c b/components/trace/los_trace.c index 4abc3900..a69779dd 100644 --- a/components/trace/los_trace.c +++ b/components/trace/los_trace.c @@ -411,12 +411,6 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv) LOS_TraceRecordDump(toClient); return LOS_OK; } - -SHELLCMD_ENTRY(tracestart_shellcmd, CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart); -SHELLCMD_ENTRY(tracestop_shellcmd, CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop); -SHELLCMD_ENTRY(tracesetmask_shellcmd, CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask); -SHELLCMD_ENTRY(tracereset_shellcmd, CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset); -SHELLCMD_ENTRY(tracedump_shellcmd, CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump); #endif #endif /* LOSCFG_KERNEL_TRACE == 1 */ diff --git a/components/trace/los_trace_pri.h b/components/trace/los_trace_pri.h index 8c5a8cab..ebc96a61 100644 --- a/components/trace/los_trace_pri.h +++ b/components/trace/los_trace_pri.h @@ -152,6 +152,11 @@ extern VOID OsTraceRecordDump(BOOL toClient); #define OsTraceNotifyStop() #endif +#if (LOSCFG_SHELL == 1) +extern UINT32 OsShellCmdTraceSetMask(INT32 argc, const CHAR **argv); +extern UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv); +#endif + #ifdef __cplusplus #if __cplusplus } diff --git a/components/trace/trace_offline.c b/components/trace/trace_offline.c index 75602e92..f60e41cf 100644 --- a/components/trace/trace_offline.c +++ b/components/trace/trace_offline.c @@ -31,6 +31,8 @@ #include "los_trace_pri.h" #include "trace_pipeline.h" +#include "los_memory.h" +#include "securec.h" #if (LOSCFG_RECORDER_MODE_OFFLINE == 1) #define BITS_NUM_FOR_TASK_ID 16