perf tools: Add support for breakpoint events in perf tools
authorFrederic Weisbecker <fweisbec@gmail.com>
Mon, 23 Nov 2009 14:42:35 +0000 (15:42 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 23 Nov 2009 17:18:31 +0000 (18:18 +0100)
commit1b290d670ffa883b7e062177463a8efd00eaa2c1
treed6449227ae19be6fb9046ac5d12cc3ae9d252972
parentf5ffe02e5046003ae7e2ce70d3d1c2a73331268b
perf tools: Add support for breakpoint events in perf tools

Add the breakpoint events support with this new sysnopsis:

  mem:addr[:access]

Where addr is a raw addr value in the kernel and access can be
either [r][w][x]

Example to profile tasklist_lock:

$ grep tasklist_lock /proc/kallsyms
ffffffff8189c000 D tasklist_lock

$ perf record -e mem:0xffffffff8189c000:rw -a -f -c 1
$ perf report

# Samples: 62
#
# Overhead          Command  Shared Object  Symbol
# ........  ...............  .............  ......
#
    29.03%          swapper  [kernel]       [k] _raw_read_trylock
    29.03%          swapper  [kernel]       [k] _raw_read_unlock
    19.35%             init  [kernel]       [k] _raw_read_trylock
    19.35%             init  [kernel]       [k] _raw_read_unlock
     1.61%         events/0  [kernel]       [k] _raw_read_trylock
     1.61%         events/0  [kernel]       [k] _raw_read_unlock

Coming soon:

 - Support for symbols in the event definition.

 - Default period to 1 for breakpoint events because these are
   not high frequency events. The same thing is needed for trace
   events.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1258987355-8751-4-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
tools/perf/Documentation/perf-record.txt
tools/perf/util/parse-events.c