首页 > 其他分享 >基于CV18xx开启coredump

基于CV18xx开启coredump

时间:2022-10-30 02:22:25浏览次数:51  
标签:kernel insert into coredump 开启 filename CV18xx core

一:切到SDK目录,source and defconfig 对应的board 配置

  eg. 

    source build/cvisetup.sh

    defconfig cv1800b_wdmb_0008a_spinor

二:透过命令 menuconfig_kernel 进入kernel 配置界面,打开如下配置

  •   CONFIG_COREDUMP=y
  •   CONFIG_ELF_CORE=y
  •   CONFIG_PROC_SYSCTL=y

 

 

 三:重新编译kernel,并重新升级kernel文件

  build_kernel

四:升级成功后,在板端 执行

  ulimit -c unlimited  // 对生成的 core 文件的大小不进行限制。

  echo “1” > /proc/sys/kernel/core_uses_pid    // 是 core 文件加上PID号

  echo /mnt/sd/core-%e-%p-%t > /proc/sys/kernel/core_pattern  // 路径从定义,参数含义如下 

    %p – insert pid into filename 添加pid

    %u – insert current uid into filename 添加当前uid

    %g – insert current gid into filename 添加当前gid

    %s – insert signal that caused the coredump into the filename 添加导致产生core的信号

    %t – insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间

    %h – insert hostname where the coredump happened into filename 添加主机名

    %e – insert coreddumping executable name into filename 添加命令名

五:执行完以上命令后,如果应用发生段错误,会在指定路径或默认路径下生成coredump文件,下一步就可以利用gdb分析定位问题了

 

Notes: 如果将coredump文件存储在SD Card上,还需要改动如下地方

source code :  kernel/fs/coredump.c @ do_coredump

 

 

标签:kernel,insert,into,coredump,开启,filename,CV18xx,core
From: https://www.cnblogs.com/xu-long/p/16840384.html

相关文章