1. 01 Apr, 2010 3 commits
    • Jason Wessel's avatar
      x86,kgdb: Always initialize the hw breakpoint attribute · ab310b5e
      Jason Wessel authored
      It is required to call hw_breakpoint_init() on an attr before using it
      in any other calls.  This fixes the problem where kgdb will sometimes
      fail to initialize on x86_64.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: 2.6.33 <stable@kernel.org>
      LKML-Reference: <1269975907-27602-1-git-send-email-jason.wessel@windriver.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      ab310b5e
    • Frederic Weisbecker's avatar
      perf: Use hot regs with software sched switch/migrate events · e49a5bd3
      Frederic Weisbecker authored
      Scheduler's task migration events don't work because they always
      pass NULL regs perf_sw_event(). The event hence gets filtered
      in perf_swevent_add().
      
      Scheduler's context switches events use task_pt_regs() to get
      the context when the event occured which is a wrong thing to
      do as this won't give us the place in the kernel where we went
      to sleep but the place where we left userspace. The result is
      even more wrong if we switch from a kernel thread.
      
      Use the hot regs snapshot for both events as they belong to the
      non-interrupt/exception based events family. Unlike page faults
      or so that provide the regs matching the exact origin of the event,
      we need to save the current context.
      
      This makes the task migration event working and fix the context
      switch callchains and origin ip.
      
      Example: perf record -a -e cs
      
      Before:
      
          10.91%      ksoftirqd/0                  0  [k] 0000000000000000
                      |
                      --- (nil)
                          perf_callchain
                          perf_prepare_sample
                          __perf_event_overflow
                          perf_swevent_overflow
                          perf_swevent_add
                          perf_swevent_ctx_event
                          do_perf_sw_event
                          __perf_sw_event
                          perf_event_task_sched_out
                          schedule
                          run_ksoftirqd
                          kthread
                          kernel_thread_helper
      
      After:
      
          23.77%  hald-addon-stor  [kernel.kallsyms]  [k] schedule
                  |
                  --- schedule
                     |
                     |--60.00%-- schedule_timeout
                     |          wait_for_common
                     |          wait_for_completion
                     |          blk_execute_rq
                     |          scsi_execute
                     |          scsi_execute_req
                     |          sr_test_unit_ready
                     |          |
                     |          |--66.67%-- sr_media_change
                     |          |          media_changed
                     |          |          cdrom_media_changed
                     |          |          sr_block_media_changed
                     |          |          check_disk_change
                     |          |          cdrom_open
      
      v2: Always build perf_arch_fetch_caller_regs() now that software
      events need that too. They don't need it from modules, unlike trace
      events, so we keep the EXPORT_SYMBOL in trace_event_perf.c
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: David Miller <davem@davemloft.net>
      e49a5bd3
    • Frederic Weisbecker's avatar
      perf: Correctly align perf event tracing buffer · eb1e7961
      Frederic Weisbecker authored
      The trace event buffer used by perf to record raw sample events
      is typed as an array of char and may then not be aligned to 8
      by alloc_percpu().
      
      But we need it to be aligned to 8 in sparc64 because we cast
      this buffer into a random structure type built by the TRACE_EVENT()
      macro to store the traces. So if a random 64 bits field is accessed
      inside, it may be not under an expected good alignment.
      
      Use an array of long instead to force the appropriate alignment, and
      perform a compile time check to ensure the size in byte of the buffer
      is a multiple of sizeof(long) so that its actual size doesn't get
      shrinked under us.
      
      This fixes unaligned accesses reported while using perf lock
      in sparc 64.
      Suggested-by: default avatarDavid Miller <davem@davemloft.net>
      Suggested-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: David Miller <davem@davemloft.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      eb1e7961
  2. 26 Mar, 2010 13 commits
  3. 25 Mar, 2010 20 commits
  4. 24 Mar, 2010 4 commits