aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pstore_ram.h
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-17 12:11:12 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-17 16:48:09 -0700
commitcbe7cbf5a666ad9dfe2e0c276066131af73769ab (patch)
treea354f2ed2f0a45f336b0172c46d0bb7c718eee0f /include/linux/pstore_ram.h
parentpstore: Headers should include all stuff they use (diff)
downloadlinux-dev-cbe7cbf5a666ad9dfe2e0c276066131af73769ab.tar.xz
linux-dev-cbe7cbf5a666ad9dfe2e0c276066131af73769ab.zip
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome since we convert addresses to symbols. For kernels with minimal changes, the mappings would probably match, but it's not guaranteed at all. (But still we could convert the addresses by hand, since we do print raw addresses.) If we use modules, the symbols could be loaded at different addresses from the previously booted kernel, and so this would also fail, but there's nothing we can do about it. Also, the binary data format that pstore/ram is using in its ringbuffer may change between the kernels, so here we too must ensure that we're running the same kernel. So, there are two questions really: 1. How to compute the unique kernel tag; 2. Where to store it. In this patch we're using LINUX_VERSION_CODE, just as hibernation (suspend-to-disk) does. This way we are protecting from the kernel version mismatch, making sure that we're running the same kernel version and patch level. We could use CRC of a symbol table (as suggested by Tony Luck), but for now let's not be that strict. And as for storing, we are using a small trick here. Instead of allocating a dedicated buffer for the tag (i.e. another prz), or hacking ram_core routines to "reserve" some control data in the buffer, we are just encoding the tag into the buffer signature (and XOR'ing it with the actual signature value, so that buffers not needing a tag can just pass zero, which will result into the plain old PRZ signature). Suggested-by: Steven Rostedt <rostedt@goodmis.org> Suggested-by: Tony Luck <tony.luck@intel.com> Suggested-by: Colin Cross <ccross@android.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/pstore_ram.h')
-rw-r--r--include/linux/pstore_ram.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index ba2b211aaa81..098d2a838296 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -47,7 +47,7 @@ struct persistent_ram_zone {
};
struct persistent_ram_zone * __devinit persistent_ram_new(phys_addr_t start,
- size_t size,
+ size_t size, u32 sig,
int ecc_size);
void persistent_ram_free(struct persistent_ram_zone *prz);
void persistent_ram_zap(struct persistent_ram_zone *prz);