aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorSergiu Iordache <sergiu@chromium.org>2011-08-13 15:34:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-13 21:34:03 -0400
commit4126dacb5b2ca85b187a27b93805254567526dc8 (patch)
tree74e37710c4e44b4348569032bc8968a93b715eb3 /Documentation
parent6989b5bb2f0302d824bfc5a9272e17eef22353cc (diff)
Documentation: add Ramoops usage description
Add a documentation file describing the usage of Ramoops Signed-off-by: Sergiu Iordache <sergiu@chromium.org> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/00-INDEX2
-rw-r--r--Documentation/ramoops.txt76
2 files changed, 78 insertions, 0 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 1f89424c36a6..65bbd2622396 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -272,6 +272,8 @@ printk-formats.txt
272 - how to get printk format specifiers right 272 - how to get printk format specifiers right
273prio_tree.txt 273prio_tree.txt
274 - info on radix-priority-search-tree use for indexing vmas. 274 - info on radix-priority-search-tree use for indexing vmas.
275ramoops.txt
276 - documentation of the ramoops oops/panic logging module.
275rbtree.txt 277rbtree.txt
276 - info on what red-black trees are and what they are for. 278 - info on what red-black trees are and what they are for.
277robust-futex-ABI.txt 279robust-futex-ABI.txt
diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
new file mode 100644
index 000000000000..8fb1ba7fe7bf
--- /dev/null
+++ b/Documentation/ramoops.txt
@@ -0,0 +1,76 @@
1Ramoops oops/panic logger
2=========================
3
4Sergiu Iordache <sergiu@chromium.org>
5
6Updated: 8 August 2011
7
80. Introduction
9
10Ramoops is an oops/panic logger that writes its logs to RAM before the system
11crashes. It works by logging oopses and panics in a circular buffer. Ramoops
12needs a system with persistent RAM so that the content of that area can
13survive after a restart.
14
151. Ramoops concepts
16
17Ramoops uses a predefined memory area to store the dump. The start and size of
18the memory area are set using two variables:
19 * "mem_address" for the start
20 * "mem_size" for the size. The memory size will be rounded down to a
21 power of two.
22
23The memory area is divided into "record_size" chunks (also rounded down to
24power of two) and each oops/panic writes a "record_size" chunk of
25information.
26
27Dumping both oopses and panics can be done by setting 1 in the "dump_oops"
28variable while setting 0 in that variable dumps only the panics.
29
30The module uses a counter to record multiple dumps but the counter gets reset
31on restart (i.e. new dumps after the restart will overwrite old ones).
32
332. Setting the parameters
34
35Setting the ramoops parameters can be done in 2 different manners:
36 1. Use the module parameters (which have the names of the variables described
37 as before).
38 2. Use a platform device and set the platform data. The parameters can then
39 be set through that platform data. An example of doing that is:
40
41#include <linux/ramoops.h>
42[...]
43
44static struct ramoops_platform_data ramoops_data = {
45 .mem_size = <...>,
46 .mem_address = <...>,
47 .record_size = <...>,
48 .dump_oops = <...>,
49};
50
51static struct platform_device ramoops_dev = {
52 .name = "ramoops",
53 .dev = {
54 .platform_data = &ramoops_data,
55 },
56};
57
58[... inside a function ...]
59int ret;
60
61ret = platform_device_register(&ramoops_dev);
62if (ret) {
63 printk(KERN_ERR "unable to register platform device\n");
64 return ret;
65}
66
673. Dump format
68
69The data dump begins with a header, currently defined as "====" followed by a
70timestamp and a new line. The dump then continues with the actual data.
71
724. Reading the data
73
74The dump data can be read from memory (through /dev/mem or other means).
75Getting the module parameters, which are needed in order to parse the data, can
76be done through /sys/module/ramoops/parameters/* .