匿名
未登录
登录
百问网嵌入式Linux wiki
搜索
查看“Core dump”的源代码
来自百问网嵌入式Linux wiki
名字空间
页面
讨论
更多
更多
页面选项
Read
查看源代码
历史
←
Core dump
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
==Article purpose== This article provides the initial information set needed to start the '''core dump''' Linux<sup>®</sup> service. == Introduction == {{:Trace_and_debug_tools_assignment_table_template}} <onlyinclude> | [[Core dump|systemd core dump]] | [[:Category:Debugging tools|Debugging tools]] | style="text-align:left;" | '''systemd core dump''': generates core dump files on Linux<br> | {{Y}} || {{N}} || {{Y}} || {{N}} || {{N}} || {{N}} |- </onlyinclude> |} '''core dump''' records the states of the working program memory before an abnormal termination. The dump record assists in diagnosing and debugging program errors. '''Systemd''' provides, via a configuration file, a way to generate and store core dump for Linux system. == Installing the trace and debug tool on your target board== === Using STM32MPU Embedded Software Distribution === ==== Distribution Package ==== ST via OpenSTLinux layer provides a recipe named '''systemd-conf''', which provides a core dump configuration for systemd. The '''core dump''' configuration is available only via OpenSTLinux distribution. If this configuration is activated via another distribution, an add-on must be made in the systemd-conf recipe. recipes-core/systemd/systemd-conf.bbappend: <pre> do_install_append() { install -d ${D}${sysconfdir}/systemd/coredump.conf.d/ echo "[Coredump]" > ${D}${sysconfdir}/systemd/coredump.conf.d/coredump-custom.conf echo "Storage=external" >> ${D}${sysconfdir}/systemd/coredump.conf.d/coredump-custom.conf } </pre> == Getting started == === Verify setup === * Verify configuration are present {{Board$}} ls /etc/systemd/coredump.conf.d/ coredump-custom.conf * Verify if '''core dump''' is registered by Linux {{Board$}} cat /proc/sys/kernel/core_pattern |/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e === Crash append=== If an application/program has crashed and generated a core dump while running, the core dump result is stored in '''''/var/lib/systemd/coredump'''''. (See the [[Core_dump#How to test core dump|How to test core dump]] service below ). ==How to test core dump== * Launch a program Launch a program (for example: "weston-flower") {{Board$}} weston-flower & * Get the pid of this program with the ps command {{Board$}} ps ax | grep <program> * kill the program with specific '''ILL''' (4) signal (ILL: Illegal instruction) {{Board$}} kill -4 <pid of program> Force to generate core dump (for example) {{Board$}} kill -4 `pidof weston-flower` * check ''/var/lib/systemd/coredump/'', the core dump associated to this abnormal termination: {{Board$}} find /var/lib/systemd/coredump/ /var/lib/systemd/coredump/ /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz The core dump generated has a size of around 300 Kbytes {{Board$}} du -sh /var/lib/systemd/coredump/* 295K /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz == To go further == To make core analysis please refer to [[GDB#Core_dump_analysis_using_GDB]] ==Documentation and web articles== <references /> {| |+ "External links" |- ! scope=col | Document link ! scope=col | Document Type ! scope=col | Description |- | [https://www.freedesktop.org/software/systemd/man/coredump.conf.html systemd man page for core dump configuration] | Standard | systemd man page |} {{ ArticleBasedOnModel | Trace and debug tools article model}} {{ PublicationRequestId | 10302 | 16Jan'19 }} [[Category:Linux debugging tools]]
该页面使用的模板:
Trace and debug tools assignment table template
(
查看源代码
)
模板:ArticleBasedOnModel
(
查看源代码
)
模板:Board$
(
查看源代码
)
模板:N
(
查看源代码
)
模板:PublicationRequestId
(
查看源代码
)
模板:STLightGrey
(
查看源代码
)
模板:Y
(
查看源代码
)
返回至
Core dump
。
导航
导航
WIKI首页
官方店铺
资料下载
交流社区
所有页面
所有产品
MPU-Linux开发板
MCU-单片机开发板
Linux开发系列视频
单片机开发系列视频
所有模块配件
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志