1.【需求描述】
L0~L1 支持Trace,提供两种工作模式:在线模式、离线缓存模式, 用于按时间线追踪系统事件,如任务切换、中断、ipc等。
2.【方案描述】
L0:
(1).在内核模块预置静态代码桩
(2).触发桩后,收集系统上下文信息
(3).离线模式则写入内存,用户可通过dump导出;
(4).在线模式通过pipeline对接IDE进行可视化解析和展示;
L1:
新增trace字符设备,位于"/dev/trace",通过对设备节点的read\write\ioctl,实现用户态trace;
BREAKING CHANGE:
1.新增一系列trace的对外API,位于los_trace.h中.
LOS_TRACE_EASY简易插桩
LOS_TRACE标准插桩
LOS_TraceInit配置Trace缓冲区的地址和大小
LOS_TraceStart开启事件记录
LOS_TraceStop停止事件记录
LOS_TraceRecordDump输出Trace缓冲区数据
LOS_TraceRecordGet获取Trace缓冲区的首地址
LOS_TraceReset清除Trace缓冲区中的事件
LOS_TraceEventMaskSet设置事件掩码,仅记录某些模块的事件
LOS_TraceHwiFilterHookReg注册过滤特定中断号事件的钩子函数
Close #I46WA0
Signed-off-by: LiteOS2021 <dinglu@huawei.com>
Change-Id: I6a8e64794c4852f2c2980993a06180e09ec6ee0d
224 lines
5.1 KiB
Plaintext
224 lines
5.1 KiB
Plaintext
menu "Kernel"
|
|
config KERNEL_SMP
|
|
bool "Enable Kernel SMP"
|
|
default n
|
|
help
|
|
This option will enable smp support of LiteOS.
|
|
|
|
config KERNEL_SMP_CORE_NUM
|
|
int "Muti-processing Core Numbers"
|
|
default 2
|
|
depends on KERNEL_SMP
|
|
help
|
|
This represents the number of muti-processing cores.
|
|
|
|
config KERNEL_SMP_LOCKDEP
|
|
bool "Enable Spinlock Lockdep Check"
|
|
default n
|
|
depends on KERNEL_SMP
|
|
help
|
|
This option will enable spinlock lockdep check.
|
|
|
|
config KERNEL_SMP_TASK_SYNC
|
|
bool "Enable Synchronized Task Operations"
|
|
default n
|
|
depends on KERNEL_SMP
|
|
help
|
|
This option will enable task synchronized operate task across cores.
|
|
|
|
config KERNEL_SCHED_STATISTICS
|
|
bool "Enable Scheduler statistics"
|
|
default n
|
|
depends on KERNEL_SMP
|
|
help
|
|
This option will enable schedulder statistics.
|
|
|
|
config KERNEL_MMU
|
|
bool "Enable MMU"
|
|
default y
|
|
help
|
|
This option will enable mmu.
|
|
|
|
config KERNEL_VM
|
|
bool "Enable VM"
|
|
default y
|
|
depends on KERNEL_MMU
|
|
help
|
|
This option will enable vmm, pmm, page fault, etc.
|
|
|
|
config KERNEL_SYSCALL
|
|
bool "Enable Syscall"
|
|
default y
|
|
depends on KERNEL_VM
|
|
help
|
|
This option will enable syscall.
|
|
|
|
config KERNEL_EXTKERNEL
|
|
bool "Enable Extend Kernel"
|
|
default y
|
|
help
|
|
This option will enable extend Kernel of LiteOS. Extend kernel include
|
|
cppsupport, cpup, and dynload. You can select one or some
|
|
of them.
|
|
|
|
config KERNEL_CPPSUPPORT
|
|
bool "C++ Support"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL
|
|
help
|
|
If you wish to build LiteOS with support for C++.
|
|
|
|
config KERNEL_CPUP
|
|
bool "Enable Cpup"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL
|
|
help
|
|
If you wish to build LiteOS with support for cpup.
|
|
|
|
config CPUP_INCLUDE_IRQ
|
|
bool "Enable Cpup include irq"
|
|
default y
|
|
depends on KERNEL_CPUP
|
|
help
|
|
If you wish to include irq usage for cpup.
|
|
|
|
config KERNEL_DYNLOAD
|
|
bool "Enable Dynamic Load Feature"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL && KERNEL_VM && KERNEL_SYSCALL
|
|
help
|
|
If you wish to build LiteOS with support for dynamic load.
|
|
|
|
config KERNEL_PM
|
|
bool "Enable Power Management"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL
|
|
help
|
|
If you wish to build LiteOS with support for power management.
|
|
|
|
config ASLR
|
|
bool "Enable Address Space Layout Randomization"
|
|
default n
|
|
depends on KERNEL_DYNLOAD && HW_RANDOM_ENABLE
|
|
help
|
|
If you wish to enable ASLR for user aspace.
|
|
|
|
config KERNEL_VDSO
|
|
bool "Enable VDSO Feature"
|
|
default n
|
|
depends on KERNEL_EXTKERNEL && KERNEL_VM && KERNEL_SYSCALL
|
|
help
|
|
If you wish to speed up some system calls.
|
|
|
|
config KERNEL_HOOK
|
|
bool "Enable Hook Feature"
|
|
default n
|
|
depends on KERNEL_EXTKERNEL && DEBUG_VERSION
|
|
|
|
config KERNEL_TRACE
|
|
bool "Enable Trace Feature"
|
|
default n
|
|
depends on KERNEL_HOOK
|
|
|
|
config TRACE_MSG_EXTEND
|
|
bool "Enable Record more extended content"
|
|
default n
|
|
depends on KERNEL_TRACE
|
|
|
|
config TRACE_FRAME_CORE_MSG
|
|
bool "Record cpuid, hardware interrupt status, task lock status"
|
|
default n
|
|
depends on TRACE_MSG_EXTEND
|
|
|
|
config TRACE_FRAME_EVENT_COUNT
|
|
bool "Record event count, which indicate the sequence of happend events"
|
|
default n
|
|
depends on TRACE_MSG_EXTEND
|
|
|
|
config TRACE_FRAME_MAX_PARAMS
|
|
int "Record max params"
|
|
default 3
|
|
depends on KERNEL_TRACE
|
|
help
|
|
Make sure the max value is bigger than the number defined by each #MODULE#_#TYPE#_PARMAS in los_trace.h, e.g. TASK_SWITCH_PARAMS
|
|
|
|
choice
|
|
prompt "Trace work mode"
|
|
default RECORDER_MODE_OFFLINE
|
|
depends on KERNEL_TRACE
|
|
|
|
config RECORDER_MODE_ONLINE
|
|
bool "Online mode"
|
|
select TRACE_CLIENT_INTERACT
|
|
|
|
config RECORDER_MODE_OFFLINE
|
|
bool "Offline mode"
|
|
|
|
endchoice
|
|
|
|
config TRACE_BUFFER_SIZE
|
|
int "Trace record buffer size"
|
|
default 10000
|
|
|
|
config TRACE_CLIENT_INTERACT
|
|
bool "Enable Trace Client Visualization and Control"
|
|
default n
|
|
depends on KERNEL_TRACE
|
|
|
|
choice
|
|
prompt "Trace Pipeline for Data Transmission"
|
|
depends on TRACE_CLIENT_INTERACT
|
|
|
|
config TRACE_PIPELINE_SERIAL
|
|
bool "Via Serial"
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Trace Control"
|
|
default TRACE_CONTROL_VIA_SHELL
|
|
depends on TRACE_CLIENT_INTERACT
|
|
help
|
|
If you wish to control Trace's start/stop etc.,dynamically by Trace Client.
|
|
|
|
config TRACE_CONTROL_VIA_SHELL
|
|
bool "Via Shell"
|
|
select LOSCFG_SHELL
|
|
|
|
config TRACE_CONTROL_AGENT
|
|
bool "Via Trace Agent Task"
|
|
|
|
config TRACE_NO_CONTROL
|
|
bool "No Control"
|
|
|
|
endchoice
|
|
|
|
config KERNEL_SHM
|
|
bool "Enable Shared Memory"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL && KERNEL_VM && KERNEL_SYSCALL
|
|
help
|
|
Answer Y to enable LiteOS support shared memory.
|
|
|
|
config KERNEL_LITEIPC
|
|
bool "Enable liteipc"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL && KERNEL_VM
|
|
help
|
|
Answer Y to enable LiteOS support liteipc.
|
|
|
|
config KERNEL_PIPE
|
|
bool "Enable pipes"
|
|
default y
|
|
depends on KERNEL_EXTKERNEL
|
|
help
|
|
Answer Y to enable LiteOS support pipes.
|
|
|
|
config BASE_CORE_HILOG
|
|
bool "Enable Hilog"
|
|
default y
|
|
help
|
|
If you wish to include hilog.
|
|
|
|
endmenu
|