Registered User mNo edit summary |
Registered User No edit summary |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ApplicableFor | |||
|MPUs list=STM32MP13x, STM32MP15x | |MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
|MPUs checklist=STM32MP13x,STM32MP15x | |MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
}}</noinclude> | }} | ||
<noinclude></noinclude> | |||
==Article purpose== | ==Article purpose== | ||
This article provides the initial information set needed to start the '''core dump''' Linux<sup>®</sup> service. | This article provides the initial information set needed to start the '''core dump''' Linux<sup>®</sup> service. | ||
| Line 41: | Line 42: | ||
* Verify configuration are present | * Verify configuration are present | ||
{{Board$}} ls /etc/systemd/coredump.conf.d/ | {{Board$}}ls /etc/systemd/coredump.conf.d/ | ||
coredump-custom.conf | coredump-custom.conf | ||
* Verify if '''core dump''' is registered by Linux | * Verify if '''core dump''' is registered by Linux | ||
{{Board$}} cat /proc/sys/kernel/core_pattern | {{Board$}}cat /proc/sys/kernel/core_pattern | ||
|/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e | |/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e | ||
| Line 56: | Line 57: | ||
* Launch a program | * Launch a program | ||
Launch a program (for example: "weston-flower") | Launch a program (for example: "weston-flower") | ||
{{Board$}} weston-flower & | {{Board$}}weston-flower & | ||
* Get the pid of this program with the ps command | * Get the pid of this program with the ps command | ||
{{Board$}} ps ax | grep <program> | {{Board$}}ps ax | grep <program> | ||
* kill the program with specific '''ILL''' (4) signal (ILL: Illegal instruction) | * kill the program with specific '''ILL''' (4) signal (ILL: Illegal instruction) | ||
{{Board$}} kill -4 <pid of program> | {{Board$}}kill -4 <pid of program> | ||
Force to generate core dump (for example) | Force to generate core dump (for example) | ||
{{Board$}} kill -4 `pidof weston-flower` | {{Board$}}kill -4 `pidof weston-flower` | ||
* check ''/var/lib/systemd/coredump/'', the core dump associated to this abnormal termination: | * check ''/var/lib/systemd/coredump/'', the core dump associated to this abnormal termination: | ||
{{Board$}} find /var/lib/systemd/coredump/ | {{Board$}}find /var/lib/systemd/coredump/ | ||
/var/lib/systemd/coredump/ | /var/lib/systemd/coredump/ | ||
/var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz | /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz | ||
| Line 73: | Line 74: | ||
The core dump generated has a size of around 300 Kbytes | The core dump generated has a size of around 300 Kbytes | ||
{{Board$}} du -sh /var/lib/systemd/coredump/* | {{Board$}}du -sh /var/lib/systemd/coredump/* | ||
295K /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz | 295K /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz | ||
| Line 94: | Line 95: | ||
|} | |} | ||
<noinclude> | |||
{{ ArticleBasedOnModel | Trace and debug tools article model}} | {{ ArticleBasedOnModel | Trace and debug tools article model}} | ||
{{ PublicationRequestId | 10302 | 16Jan'19 }} | {{ PublicationRequestId | 10302 | 16Jan'19 }} | ||
[[Category:Linux debugging tools]] | [[Category:Linux debugging tools]] | ||
</noinclude> | |||
Latest revision as of 15:48, 4 November 2024
1. Article purpose[edit | edit source]
This article provides the initial information set needed to start the core dump Linux® service.
2. Introduction[edit | edit source]
The following table provides a brief description of the tool, as well as its availability depending on the software packages:
: this tool is either present (ready to use or to be activated), or can be integrated and activated on the software package.
: this tool is not present and cannot be integrated, or it is present but cannot be activated on the software package.
| Tool | STM32MPU Embedded Software distribution | STM32MPU Embedded Software distribution for Android™ | ||||||
|---|---|---|---|---|---|---|---|---|
| Name | Category | Purpose | Starter Package | Developer Package | Distribution Package | Starter Package | Developer Package | Distribution Package |
| systemd core dump | Debugging tools | systemd core dump: generates core dump files on Linux |
||||||
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.
3. Installing the trace and debug tool on your target board[edit | edit source]
3.1. Using STM32MPU Embedded Software Distribution[edit | edit source]
3.1.1. Distribution Package[edit | edit source]
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:
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
}
4. Getting started[edit | edit source]
4.1. Verify setup[edit | edit source]
- Verify configuration are present
ls /etc/systemd/coredump.conf.d/ coredump-custom.conf
- Verify if core dump is registered by Linux
cat /proc/sys/kernel/core_pattern |/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
4.2. Crash append[edit | edit source]
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 How to test core dump service below ).
5. How to test core dump[edit | edit source]
- Launch a program
Launch a program (for example: "weston-flower")
weston-flower &
- Get the pid of this program with the ps command
ps ax | grep <program>
- kill the program with specific ILL (4) signal (ILL: Illegal instruction)
kill -4 <pid of program>
Force to generate core dump (for example)
kill -4 `pidof weston-flower`
- check /var/lib/systemd/coredump/, the core dump associated to this abnormal termination:
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
du -sh /var/lib/systemd/coredump/* 295K /var/lib/systemd/coredump/core.weston-flower.0.47f9def8d0f44af5919d0e4cd5ee04ae.554.1543488316000000.xz
6. To go further[edit | edit source]
To make core analysis please refer to GDB#Core_dump_analysis_using_GDB
7. Documentation and web articles[edit | edit source]
| Document link | Document Type | Description |
|---|---|---|
| systemd man page for core dump configuration | Standard | systemd man page |