From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH 26/32] Documentation/ramoops.txt: convert it to ReST format
Date: Mon, 17 Oct 2016 14:56:03 -0200 [thread overview]
Message-ID: <730bfefacc32bc82c547f76e3b8dade153c06b1c.1476717925.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1476717925.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1476717925.git.mchehab@s-opensource.com>
- Fix document title;
- use quote blocks where needed;
- use monotonic fonts for config options and file names;
- adjust whitespaces and blank lines;
- add it to the user's book.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
Documentation/ramoops.txt | 86 +++++++++++++++++++++++-------------------
Documentation/user/index.rst | 1 +
Documentation/user/ramoops.rst | 1 +
3 files changed, 49 insertions(+), 39 deletions(-)
create mode 120000 Documentation/user/ramoops.rst
diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
index 26b9f31cf65a..7eaf1e71c083 100644
--- a/Documentation/ramoops.txt
+++ b/Documentation/ramoops.txt
@@ -5,34 +5,37 @@ Sergiu Iordache <sergiu@chromium.org>
Updated: 17 November 2011
-0. Introduction
+Introduction
+------------
Ramoops is an oops/panic logger that writes its logs to RAM before the system
crashes. It works by logging oopses and panics in a circular buffer. Ramoops
needs a system with persistent RAM so that the content of that area can
survive after a restart.
-1. Ramoops concepts
+Ramoops concepts
+----------------
Ramoops uses a predefined memory area to store the dump. The start and size
and type of the memory area are set using three variables:
- * "mem_address" for the start
- * "mem_size" for the size. The memory size will be rounded down to a
- power of two.
- * "mem_type" to specifiy if the memory type (default is pgprot_writecombine).
-Typically the default value of mem_type=0 should be used as that sets the pstore
-mapping to pgprot_writecombine. Setting mem_type=1 attempts to use
-pgprot_noncached, which only works on some platforms. This is because pstore
+ * ``mem_address`` for the start
+ * ``mem_size`` for the size. The memory size will be rounded down to a
+ power of two.
+ * ``mem_type`` to specifiy if the memory type (default is pgprot_writecombine).
+
+Typically the default value of ``mem_type=0`` should be used as that sets the pstore
+mapping to pgprot_writecombine. Setting ``mem_type=1`` attempts to use
+``pgprot_noncached``, which only works on some platforms. This is because pstore
depends on atomic operations. At least on ARM, pgprot_noncached causes the
memory to be mapped strongly ordered, and atomic operations on strongly ordered
memory are implementation defined, and won't work on many ARMs such as omaps.
-The memory area is divided into "record_size" chunks (also rounded down to
-power of two) and each oops/panic writes a "record_size" chunk of
+The memory area is divided into ``record_size`` chunks (also rounded down to
+power of two) and each oops/panic writes a ``record_size`` chunk of
information.
-Dumping both oopses and panics can be done by setting 1 in the "dump_oops"
+Dumping both oopses and panics can be done by setting 1 in the ``dump_oops``
variable while setting 0 in that variable dumps only the panics.
The module uses a counter to record multiple dumps but the counter gets reset
@@ -43,7 +46,8 @@ This might be useful when a hardware reset was used to bring the machine back
to life (i.e. a watchdog triggered). In such cases, RAM may be somewhat
corrupt, but usually it is restorable.
-2. Setting the parameters
+Setting the parameters
+----------------------
Setting the ramoops parameters can be done in several different manners:
@@ -52,12 +56,13 @@ Setting the ramoops parameters can be done in several different manners:
boot and then use the reserved memory for ramoops. For example, assuming a
machine with > 128 MB of memory, the following kernel command line will tell
the kernel to use only the first 128 MB of memory, and place ECC-protected
- ramoops region at 128 MB boundary:
- "mem=128M ramoops.mem_address=0x8000000 ramoops.ecc=1"
+ ramoops region at 128 MB boundary::
+
+ mem=128M ramoops.mem_address=0x8000000 ramoops.ecc=1
B. Use Device Tree bindings, as described in
- Documentation/device-tree/bindings/reserved-memory/ramoops.txt.
- For example:
+ ``Documentation/device-tree/bindings/reserved-memory/ramoops.txt``.
+ For example::
reserved-memory {
#address-cells = <2>;
@@ -73,60 +78,63 @@ Setting the ramoops parameters can be done in several different manners:
};
C. Use a platform device and set the platform data. The parameters can then
- be set through that platform data. An example of doing that is:
+ be set through that platform data. An example of doing that is::
-#include <linux/pstore_ram.h>
-[...]
+ #include <linux/pstore_ram.h>
+ [...]
-static struct ramoops_platform_data ramoops_data = {
+ static struct ramoops_platform_data ramoops_data = {
.mem_size = <...>,
.mem_address = <...>,
.mem_type = <...>,
.record_size = <...>,
.dump_oops = <...>,
.ecc = <...>,
-};
+ };
-static struct platform_device ramoops_dev = {
+ static struct platform_device ramoops_dev = {
.name = "ramoops",
.dev = {
.platform_data = &ramoops_data,
},
-};
+ };
-[... inside a function ...]
-int ret;
+ [... inside a function ...]
+ int ret;
-ret = platform_device_register(&ramoops_dev);
-if (ret) {
+ ret = platform_device_register(&ramoops_dev);
+ if (ret) {
printk(KERN_ERR "unable to register platform device\n");
return ret;
-}
+ }
You can specify either RAM memory or peripheral devices' memory. However, when
specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
-very early in the architecture code, e.g.:
+very early in the architecture code, e.g.::
-#include <linux/memblock.h>
+ #include <linux/memblock.h>
-memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);
+ memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);
-3. Dump format
+Dump format
+-----------
-The data dump begins with a header, currently defined as "====" followed by a
+The data dump begins with a header, currently defined as ``====`` followed by a
timestamp and a new line. The dump then continues with the actual data.
-4. Reading the data
+Reading the data
+----------------
The dump data can be read from the pstore filesystem. The format for these
-files is "dmesg-ramoops-N", where N is the record number in memory. To delete
+files is ``dmesg-ramoops-N``, where N is the record number in memory. To delete
a stored record from RAM, simply unlink the respective pstore file.
-5. Persistent function tracing
+Persistent function tracing
+---------------------------
Persistent function tracing might be useful for debugging software or hardware
-related hangs. The functions call chain log is stored in a "ftrace-ramoops"
-file. Here is an example of usage:
+related hangs. The functions call chain log is stored in a ``ftrace-ramoops``
+file. Here is an example of usage::
# mount -t debugfs debugfs /sys/kernel/debug/
# echo 1 > /sys/kernel/debug/pstore/record_ftrace
diff --git a/Documentation/user/index.rst b/Documentation/user/index.rst
index c2304e135b40..f5dec1436263 100644
--- a/Documentation/user/index.rst
+++ b/Documentation/user/index.rst
@@ -11,6 +11,7 @@ Contents:
REPORTING-BUGS
BUG-HUNTING
oops-tracing
+ ramoops
initrd
init
dynamic-debug-howto
diff --git a/Documentation/user/ramoops.rst b/Documentation/user/ramoops.rst
new file mode 120000
index 000000000000..0750fa1ce290
--- /dev/null
+++ b/Documentation/user/ramoops.rst
@@ -0,0 +1 @@
+../ramoops.txt
\ No newline at end of file
--
2.7.4
next prev parent reply other threads:[~2016-10-17 17:04 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 16:55 [PATCH 00/32] Create an User's manual and improve development-process book Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 01/32] Documentation/applying-patches.txt: fix a bad external link Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 02/32] REPORTING-BUGS: convert to ReST markup Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 03/32] README: convert it " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 04/32] Documentation/kernel-parameters.txt: convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 05/32] docs-rst: add documents to development-process Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 06/32] docs-rst: create an user's manual book Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 07/32] Documentation/adding-syscalls.txt: convert it to ReST markup Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 08/32] Documentation/bad_memory.txt: " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 09/32] Documentation/basic_profiling.rst: convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 10/32] Documentation/binfmt_misc.txt: convert it " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 11/32] Documentation/serial-console.txt: " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 12/32] Documentation/braille-console: " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 13/32] Documentation/BUG-HUNTING: convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 14/32] Documentation/CodeOfConflict: add it to the development-process book Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 15/32] Documentation/devices.rst: convert it to ReST markup Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 16/32] Documentation/dynamic-debug-howto.txt: " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 17/32] Documentation/initrd.txt: convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 18/32] Documentation/init.txt: " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 19/32] Documentation/magic-number.txt: convert it " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 20/32] Documentation/md.txt: Convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 21/32] Documentation/module-signing.txt: convert " Mauro Carvalho Chehab
2016-10-17 16:55 ` [PATCH 22/32] Documentation/mono.txt: " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 23/32] Documentation/java.txt: " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 24/32] Documentation/oops-tracing.txt: " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 25/32] Documentation/parport.txt: " Mauro Carvalho Chehab
2016-10-17 16:56 ` Mauro Carvalho Chehab [this message]
2016-10-17 16:56 ` [PATCH 27/32] Documentation/sysfs-rules.txt: convert it " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 28/32] Documentation/sysrq.txt: convert " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 29/32] Documentation/unicode.txt: convert it " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 30/32] Documentation/VGA-softcursor.txt: convert " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 31/32] Documentation/volatile-considered-harmful.txt: " Mauro Carvalho Chehab
2016-10-17 16:56 ` [PATCH 32/32] Documentation/parport.txt: fix table to show on LaTeX Mauro Carvalho Chehab
2016-10-17 22:43 ` [PATCH 00/32] Create an User's manual and improve development-process book Jonathan Corbet
2016-10-18 4:30 ` Markus Heiser
2016-10-18 13:37 ` Renaming Documentation/ [was [PATCH 00/32] Create an User's manual and improve development-process book] Jonathan Corbet
2016-10-18 14:16 ` Theodore Ts'o
2016-10-18 8:37 ` [PATCH 00/32] Create an User's manual and improve development-process book Mauro Carvalho Chehab
2016-10-18 10:01 ` Jani Nikula
2016-10-18 10:20 ` Mauro Carvalho Chehab
2016-10-18 10:35 ` Jani Nikula
2016-10-18 10:42 ` Mauro Carvalho Chehab
2016-10-18 23:25 ` Jonathan Corbet
2016-10-19 9:27 ` Mauro Carvalho Chehab
2016-10-19 10:08 ` Markus Heiser
2016-10-19 10:44 ` [PATCH] Documentation/sphinx: rename kernel-doc.py to kerneldoc.py Jani Nikula
2016-10-19 10:57 ` Markus Heiser
2016-10-21 20:27 ` Jonathan Corbet
2016-10-27 20:17 ` [PATCH 00/32] Create an User's manual and improve development-process book Andrew Morton
2016-10-27 20:36 ` Jonathan Corbet
2016-10-27 22:40 ` Mauro Carvalho Chehab
2016-11-08 13:57 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=730bfefacc32bc82c547f76e3b8dade153c06b1c.1476717925.git.mchehab@s-opensource.com \
--to=mchehab@s-opensource.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®