|
|
Subscribe / Log in / New account

hw-breakpoints: Make the API generic + support for perfcounters

From:  Frederic Weisbecker <fweisbec@gmail.com>
To:  Ingo Molnar <mingo@elte.hu>
Subject:  [RFC][PATCH 0/5] hw-breakpoints: Make the API generic + support for perfcounters
Date:  Mon, 20 Jul 2009 13:08:02 -0400
Message-ID:  <1248109687-7808-1-git-send-email-fweisbec@gmail.com>
Cc:  LKML <linux-kernel@vger.kernel.org>, Frederic Weisbecker <fweisbec@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linuxtronix.de>, Mike Galbraith <efault@gmx.de>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Paul Mackerras <paulus@samba.org>, Arnaldo Carvalho de Melo <acme@redhat.com>, Lai Jiangshan <laijs@cn.fujitsu.com>, Anton Blanchard <anton@samba.org>, Li Zefan <lizf@cn.fujitsu.com>, Zhaolei <zhaolei@cn.fujitsu.com>, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>, "K . Prasad" <prasad@linux.vnet.ibm.com>, Alan Stern <stern@rowland.harvard.edu>
Archive‑link:  Article

Hi,

This patchset aims to make the hardware breakpoint API generic and
also to provide the support for hardware breakpoints from perfcounters.

The hardware breakpoint API changes are a first shot of idea.

The support for perf counter has strange effects. It looks like only
a part of the breakpoint events are actually recorded. The triggered callback
receives well the events but if there are only few of them, none is passed
in userspace (or userspace ignores them, dunno). Once I have some time, I'll
take a deeper look inside the perf mmap syscall or whatever could be
the origin.

Thanks.

Example which traces the BKL accesses by stressing reiserfs:

bkl=0x$(cat ../../System.map | grep kernel_flag | cut -d" " -f 1)
./perf record -f -g -e 5:$bkl -- dbench -t 20 20
./perf report -g -s s
 # Samples: 36
 #
 # Overhead  Symbol
 # ........  ......
 #
    83.33%  [k] lock_kernel
                |
                |--51.72%-- __pwrite64
                |
                |--27.59%-- 0x7f9d83a17b15
                |
                |--13.79%-- __open
                |
                 --10.34%-- unlink

    16.67%  [k] unlock_kernel
                |
                |--80.00%-- 0x7f9d83a17b15
                |
                |--20.00%-- unlink
                |
                 --20.00%-- __pwrite64

Frederic Weisbecker (5):
  hw-breakpoints: Make kernel breakpoints API truly generic
  hw-breakpoints: Pull up the target symbol in a generic field
  hw-breakpoints: Make user breakpoints API truly generic
  perfcounter: Grow the event number to 64 bits
  perfcounter: Add support for kernel hardware breakpoints

 arch/x86/include/asm/hw_breakpoint.h    |    9 ++-
 arch/x86/kernel/hw_breakpoint.c         |   91 +++++++++++-----
 arch/x86/kernel/ptrace.c                |   21 ++--
 include/asm-generic/hw_breakpoint.h     |  116 ++++++++-------------
 include/linux/perf_counter.h            |    1 +
 kernel/hw_breakpoint.c                  |  173 ++++++++++++++++++++++++++++---
 kernel/perf_counter.c                   |   41 +++++++-
 kernel/trace/trace.h                    |    5 +-
 kernel/trace/trace_ksym.c               |   67 ++++++------
 kernel/trace/trace_selftest.c           |    2 +-
 samples/hw_breakpoint/data_breakpoint.c |   10 +--
 11 files changed, 368 insertions(+), 168 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds