From 6377f98e9e18e0f6ea09305c31fc6a162e6aa4f4 Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Fri, 2 Sep 2022 11:37:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20trace=E6=A8=A1=E5=9D=97=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=BF=AE=E5=A4=8D=20close:=20#I5PD6D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: arvinzzz Change-Id: I727ddaa78c5ca7b6626347659f584f54191efabe --- components/shell/src/base/shcmd.c | 11 +++++++++++ components/trace/BUILD.gn | 8 ++++++++ components/trace/los_trace.c | 6 ------ components/trace/los_trace_pri.h | 5 +++++ components/trace/trace_offline.c | 2 ++ 5 files changed, 26 insertions(+), 6 deletions(-) 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 23241e87..4269a8c9 100644 --- a/components/trace/los_trace.c +++ b/components/trace/los_trace.c @@ -417,12 +417,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 71c408bd..34855995 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" #ifdef __cplusplus #if __cplusplus