File: README

package info (click to toggle)
ltt-control 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,860 kB
  • sloc: cpp: 192,012; sh: 28,777; ansic: 10,960; python: 7,108; makefile: 3,520; java: 109; xml: 46
file content (78 lines) | stat: -rw-r--r-- 2,652 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
LTTng core dump snapshot handler
Christian Babeux, June 2013

This is a custom core dump program that will be called when a core dump
occurs. The program will save the core data in CORE_PATH and also, if a
root session daemon is running, will record a snapshot of tracing data
using the lttng command line utility.

The core dump snapshot handler can be installed by using the provided
install.sh script or by adding the appropriate program pipe line to
/proc/sys/kernel/core_pattern. Refer to core(5) for more information
about the Linux kernel core dump handling and custom handler mechanism.

Installation:

# ./install.sh
Backup current core_pattern in core_pattern.bkp.
Successfully installed core_pattern.

How to use:

You can use the provided test.sh script to test that the core dump snapshot
handler is working properly:

# ./test.sh
Setup coredump-handler...
Session coredump-handler created.
Default snapshot output set to: /tmp/lttng/snapshot
Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output
kernel event sched_switch created in channel channel0
Tracing started for session coredump-handler
Sleeping...
Crashing...
Segmentation fault (core dumped)
Sleeping...
Waiting for data availability
Tracing stopped for session coredump-handler
Session coredump-handler destroyed
Core dump will be available in /tmp/lttng/core.
Snapshot will be available in /tmp/lttng/snapshot.

# tree /tmp/lttng
/tmp/lttng
├── core
│   └── core.29085
└── snapshot
    └── snapshot-1-20130719-175041-0
        └── kernel
            ├── channel0_0
            ├── channel0_1
            ├── channel0_2
            ├── channel0_3
            └── metadata

Chaining with other core dump handler:

Some Linux distributions already use their own core dump handler
(such as systemd 'systemd-coredump' utility). It is possible to chain these
core dump utility with the core dump snapshot handler. In order to achieve
this, the core dump snapshot handler must be first in the chain (e.g.
installed in /proc/sys/kernel/core_pattern) and the other core dump
handler must be called from within the core dump snapshot handler script.

Example (chaining with systemd systemd-coredump):

# cat /proc/sys/kernel/core_pattern
|/path/to/lttng/handler.sh %p %u %g %s %t %h %e %E %c

In LTTng handler.sh script:

[...]
# Save core dump from stdin.
#$MKDIR_BIN -p "${CORE_PATH}"
#$CAT_BIN - > "${CORE_PATH}/${CORE_PREFIX}.$p"

# Optional, chain core dump handler with original systemd script.
$CAT_BIN - | /usr/lib/systemd/systemd-coredump $p $u $g $s $t $e
[...]