1. 19 Jul, 2012 38 commits
  2. 17 Jul, 2012 2 commits
    • Anton Vorontsov's avatar
      pstore/ram: Make tracing log versioned · cbe7cbf5
      Anton Vorontsov authored
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      Suggested-by: default avatarTony Luck <tony.luck@intel.com>
      Suggested-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cbe7cbf5
    • Anton Vorontsov's avatar
      pstore: Headers should include all stuff they use · 67a101f5
      Anton Vorontsov authored
      Headers should really include all the needed prototypes, types, defines
      etc. to be self-contained. This is a long-standing issue, but apparently
      the new tracing code unearthed it (SMP=n is also a prerequisite):
      
      In file included from fs/pstore/internal.h:4:0,
                       from fs/pstore/ftrace.c:21:
      include/linux/pstore.h:43:15: error: field ‘read_mutex’ has incomplete type
      
      While at it, I also added the following:
      
      linux/types.h -> size_t, phys_addr_t, uXX and friends
      linux/spinlock.h -> spinlock_t
      linux/errno.h -> Exxxx
      linux/time.h -> struct timespec (struct passed by value)
      struct module and rs_control forward declaration (passed via pointers).
      Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67a101f5