linux下设置coredump文件的开关和路径
发布日期:2021-11-09 22:51:03 浏览次数:30 分类:技术文章

本文共 803 字,大约阅读时间需要 2 分钟。

转载自: 仅做学习笔记

1.core文件生成开关 

ulimit -c unlimited 不限制生成core文件大小 
ulimit -c 0 关闭core文件生成开关 
ulimit -c 1024 限定生成core文件的大小为1024

2.core文件的命名规则 

/proc/sys/kernel/core_uses_pid 1 表示使用procid命名,0表示不使用 
/proc/sys/kernel/core_pattern 可以设置格式化的 core 文件保存位置或文件名 
echo “/opt/corefile/core-%e-%p-%t” > /proc/sys/kernel/core_pattern 
将会控制所产生的 core 文件会存放到 /corefile 目录下,产生的文件名为 core- 命令名 -pid- 时间戳 
以下是参数列表 : 
%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 coredumping executable name into filename 添加命令名

转载地址:https://blog.csdn.net/dcq15545338580/article/details/81475612 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Eclipse颜色设置
下一篇:gdb学习笔记

发表评论

最新留言

很好
[***.229.124.182]2024年04月06日 19时27分13秒