1. 21 Jan, 2009 1 commit
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: fix a regression while suspend to disk · 00f57f54
      Frederic Weisbecker authored
      Impact: fix a crash while kernel image restore
      
      When the function graph tracer is running and while suspend to disk, some racy
      and dangerous things happen against this tracer.
      
      The current task will save its registers including the stack pointer which
      contains the return address hooked by the tracer. But the current task will
      continue to enter other functions after that to save the memory, and then
      it will store other return addresses, and finally loose the old depth which
      matches the return address saved in the old stack (during the registers saving).
      
      So on image restore, the code will return to wrong addresses.
      And there are other things: on restore, the task will have it's "current"
      pointer overwritten during registers restoring....switching from one task to
      another... That would be insane to try to trace function graphs at these
      stages.
      
      This patch makes the function graph tracer listening on power events, making
      it's tracing disabled for the current task (the one that performs the
      hibernation work) while suspend/resume to disk, making the tracing safe
      during hibernation.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      00f57f54
  2. 20 Jan, 2009 1 commit
    • Steven Rostedt's avatar
      ring-buffer: fix alignment problem · 082605de
      Steven Rostedt authored
      Impact: fix to allow some archs to use the ring buffer
      
      Commits in the ring buffer are checked by pointer arithmetic.
      If the calculation is incorrect, then the commits will never take
      place and the buffer will simply fill up and report an error.
      
      Each page in the ring buffer has a small header:
      
      struct buffer_data_page {
      	u64		time_stamp;
      	local_t		commit;
      	unsigned char	data[];
      };
      
      Unfortuntely, some of the calculations used sizeof(struct buffer_data_page)
      to know the size of the header. But this is incorrect on some archs,
      where sizeof(struct buffer_data_page) does not equal
      offsetof(struct buffer_data_page, data), and on those archs, the commits
      are never processed.
      
      This patch replaces the sizeof with offsetof.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      082605de
  3. 16 Jan, 2009 38 commits