|
@@ -526,7 +526,7 @@ do { \
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int parse_events_add_breakpoint(struct list_head *list, int *idx,
|
|
int parse_events_add_breakpoint(struct list_head *list, int *idx,
|
|
|
- void *ptr, char *type)
|
|
|
|
|
|
|
+ void *ptr, char *type, u64 len)
|
|
|
{
|
|
{
|
|
|
struct perf_event_attr attr;
|
|
struct perf_event_attr attr;
|
|
|
|
|
|
|
@@ -536,14 +536,15 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx,
|
|
|
if (parse_breakpoint_type(type, &attr))
|
|
if (parse_breakpoint_type(type, &attr))
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- * We should find a nice way to override the access length
|
|
|
|
|
- * Provide some defaults for now
|
|
|
|
|
- */
|
|
|
|
|
- if (attr.bp_type == HW_BREAKPOINT_X)
|
|
|
|
|
- attr.bp_len = sizeof(long);
|
|
|
|
|
- else
|
|
|
|
|
- attr.bp_len = HW_BREAKPOINT_LEN_4;
|
|
|
|
|
|
|
+ /* Provide some defaults if len is not specified */
|
|
|
|
|
+ if (!len) {
|
|
|
|
|
+ if (attr.bp_type == HW_BREAKPOINT_X)
|
|
|
|
|
+ len = sizeof(long);
|
|
|
|
|
+ else
|
|
|
|
|
+ len = HW_BREAKPOINT_LEN_4;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ attr.bp_len = len;
|
|
|
|
|
|
|
|
attr.type = PERF_TYPE_BREAKPOINT;
|
|
attr.type = PERF_TYPE_BREAKPOINT;
|
|
|
attr.sample_period = 1;
|
|
attr.sample_period = 1;
|
|
@@ -1364,7 +1365,7 @@ void print_events(const char *event_glob, bool name_only)
|
|
|
printf("\n");
|
|
printf("\n");
|
|
|
|
|
|
|
|
printf(" %-50s [%s]\n",
|
|
printf(" %-50s [%s]\n",
|
|
|
- "mem:<addr>[:access]",
|
|
|
|
|
|
|
+ "mem:<addr>[/len][:access]",
|
|
|
event_type_descriptors[PERF_TYPE_BREAKPOINT]);
|
|
event_type_descriptors[PERF_TYPE_BREAKPOINT]);
|
|
|
printf("\n");
|
|
printf("\n");
|
|
|
}
|
|
}
|