[Ce-android-mainline] ram console
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
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
gaurantees, hence this route will not save what ram console would save.
Another limitaion is that the log could keep moving after kmsg_dump
are invoked. Hence pstore dump will not be as complete a ram console would
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
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.
By enabling CONFIG_RAMOOPS when CONFIG_ANDROID_RAM_CONSOLE is specified,
ram console feature can be supported without changes to Android userspace
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ce-android-mainline