[Ce-android-mainline] ram console

Shuah Khan shuahkhan at gmail.com
Thu Jan 19 00:30:52 UTC 2012


I have been investigating ramconsole and some of the ways it can be
supported on mainline. My focus has been to look for existing features
that could be used to support ramconsole as opposed to requesting ramconsole
to be included in the mainline.

ram console registers a console to save printk messages to a designated
area in RAM to be retrieved for diagnostics. Previous boot kernel messages
can be retrieved from /proc/last_kmsg file. The main usage appears to be for
panic debugs.

One alternative is to use pstore infrastructure to support ram console
equivalent functionality. pstore uses kmsg_dump callback interface to get
the last messages that are in the log buffer after a previous Read and Clear
(SYSLOG_ACTION_READ_CLEAR). It appears SYSLOG_ACTION_READ_CLEAR is a rare
operation used only by selinux_syslog(). So there is a good probability that
the entire log since boot is preserved unless it rolls over. But there are
no
gaurantees, hence this route will not save what ram console would save.

Another limitaion is that the log could keep moving after kmsg_dump
callbacks
are invoked. Hence pstore dump will not be as complete a ram console would
be.

However pstore is extensible with more than one back-end and is in mainline.

ramoops driver also saves panic messages in pre-determined RAM location. It
currently uses kmsg_dump callback to retrieve messages. There is a patch
that
has been sent to lkml a month ago that does the updates to ramoops to use
pstore. However, it is not approved yet. One tact to take is to work towards
getting that patch mainlined.

Reference: https://lkml.org/lkml/2011/12/3/24

By enabling CONFIG_RAMOOPS when CONFIG_ANDROID_RAM_CONSOLE is specified,
the
ram console feature can be supported without changes to Android userspace
and
platform code. Maybe SYSLOG_ACTION_READ_CLEAR could be disabled when
CONFIG_ANDROID_RAM_CONSOLE is enabled to ensuer entire log is saved.

Couple of open issues I am looking into are the dependency pstore has on
IOMEM and how that would play into using ramoops instead of ramconsole.

Please give me feedback.

Thanks,
-- Shuah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/ce-android-mainline/attachments/20120118/d485173b/attachment.html>


More information about the Ce-android-mainline mailing list