diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-12-08 05:50:24 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-12-08 05:50:24 -0500 |
| commit | 2a2662bf88e693d477ef08351d03934f7bc0b51c (patch) | |
| tree | cef243df159cc12ada7e97998a253df7c0abb2a2 /tools/perf/util/parse-events.c | |
| parent | b2776bf7149bddd1f4161f14f79520f17fc1d71d (diff) | |
| parent | 36748b9518a2437beffe861b47dff6d12b736b3f (diff) | |
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker:
" - Extend breakpoint tools and core to support address range through perf
event with initial backend support for AMD extended breakpoints.
Syntax is:
perf record -e mem:addr/len:type
For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512)
perf record -e mem:0x1000/512:w
- Clean up a bit breakpoint code validation
It has been acked by Jiri and Oleg. "
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/parse-events.c')
| -rw-r--r-- | tools/perf/util/parse-events.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index c659a3ca1283..efa1ff4cca63 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
| @@ -526,7 +526,7 @@ do { \ | |||
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | int parse_events_add_breakpoint(struct list_head *list, int *idx, | 528 | int parse_events_add_breakpoint(struct list_head *list, int *idx, |
| 529 | void *ptr, char *type) | 529 | void *ptr, char *type, u64 len) |
| 530 | { | 530 | { |
| 531 | struct perf_event_attr attr; | 531 | struct perf_event_attr attr; |
| 532 | 532 | ||
| @@ -536,14 +536,15 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx, | |||
| 536 | if (parse_breakpoint_type(type, &attr)) | 536 | if (parse_breakpoint_type(type, &attr)) |
| 537 | return -EINVAL; | 537 | return -EINVAL; |
| 538 | 538 | ||
| 539 | /* | 539 | /* Provide some defaults if len is not specified */ |
| 540 | * We should find a nice way to override the access length | 540 | if (!len) { |
| 541 | * Provide some defaults for now | 541 | if (attr.bp_type == HW_BREAKPOINT_X) |
| 542 | */ | 542 | len = sizeof(long); |
| 543 | if (attr.bp_type == HW_BREAKPOINT_X) | 543 | else |
| 544 | attr.bp_len = sizeof(long); | 544 | len = HW_BREAKPOINT_LEN_4; |
| 545 | else | 545 | } |
| 546 | attr.bp_len = HW_BREAKPOINT_LEN_4; | 546 | |
| 547 | attr.bp_len = len; | ||
| 547 | 548 | ||
| 548 | attr.type = PERF_TYPE_BREAKPOINT; | 549 | attr.type = PERF_TYPE_BREAKPOINT; |
| 549 | attr.sample_period = 1; | 550 | attr.sample_period = 1; |
| @@ -1364,7 +1365,7 @@ void print_events(const char *event_glob, bool name_only) | |||
| 1364 | printf("\n"); | 1365 | printf("\n"); |
| 1365 | 1366 | ||
| 1366 | printf(" %-50s [%s]\n", | 1367 | printf(" %-50s [%s]\n", |
| 1367 | "mem:<addr>[:access]", | 1368 | "mem:<addr>[/len][:access]", |
| 1368 | event_type_descriptors[PERF_TYPE_BREAKPOINT]); | 1369 | event_type_descriptors[PERF_TYPE_BREAKPOINT]); |
| 1369 | printf("\n"); | 1370 | printf("\n"); |
| 1370 | } | 1371 | } |
