Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040AbZGTRIQ (ORCPT ); Mon, 20 Jul 2009 13:08:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752738AbZGTRIP (ORCPT ); Mon, 20 Jul 2009 13:08:15 -0400 Received: from mail-px0-f193.google.com ([209.85.216.193]:53625 "EHLO mail-px0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbZGTRIO (ORCPT ); Mon, 20 Jul 2009 13:08:14 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=FhCQPOJ0FpYo/ZyJyzF6OG7x25GMOhi7ZgHgA1wMNO1KZLS/H3bJZbG36Iaf1SK+Hj RkhGvj8knv63sw2LQ/RWPe8mNIKBH/4n0Ag+TjScfRwkPI8RFq4v8WP2HX20L1hh7QNz GmzfYfpPgNFgu9DRzECbu8NZpcBDhLmO/AdXM= From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Frederic Weisbecker , Steven Rostedt , Thomas Gleixner , Mike Galbraith , Peter Zijlstra , Paul Mackerras , Arnaldo Carvalho de Melo , Lai Jiangshan , Anton Blanchard , Li Zefan , Zhaolei , KOSAKI Motohiro , Mathieu Desnoyers , "K . Prasad" , Alan Stern 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> X-Mailer: git-send-email 1.6.2.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2570 Lines: 69 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/