[PATCH] perf: make the breakpoint events sample period default to 1
From: Jovi Zhang
Date: Sat Jul 14 2012 - 15:03:10 EST
There have one problem about hw_breakpoint perf event, as watched,
the events reported to userspace is not correctly, sometime one
trigger bp_event report several events, sometime bp_event cannot
go through to user.
The root cause is attr->freq is 1 passed to kernel defaultly in
bp events, this make kernel calculate event period not as expect,
make sample period to 1 will change attr->freq to 0, to fix this problem.
This patch is similar with commit f92128 about tracepoint events:
perf: Make the trace events sample period default to 1
Signed-off-by: Jovi Zhang <bookjovi@xxxxxxxxx>
---
tools/perf/util/parse-events.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 05dbc8b..631aec6 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -592,6 +592,7 @@ int parse_events_add_breakpoint(struct list_head
**list, int *idx,
attr.bp_len = HW_BREAKPOINT_LEN_4;
attr.type = PERF_TYPE_BREAKPOINT;
+ attr.sample_period = 1;
snprintf(name, MAX_NAME_LEN, "mem:%p:%s", ptr, type ? type : "rw");
return add_event(list, idx, &attr, name);
--
1.7.9.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/