All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: make the breakpoint events sample period default to 1
@ 2012-07-14 11:40 Jovi Zhang
  2012-07-25 19:29 ` [tip:perf/core] perf tools: Make " tip-bot for Jovi Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Jovi Zhang @ 2012-07-14 11:40 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Arnaldo Carvalho de Melo, LKML

>From cb06e8f21d3875f4ffef46a7627dca88b2c74836 Mon Sep 17 00:00:00 2001
From: Jovi Zhang <bookjovi@gmail.com>
Date: Sun, 15 Jul 2012 03:03:10 +0800
Subject: [PATCH] perf: make the breakpoint events sample period default to 1

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@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf tools: Make the breakpoint events sample period default to 1
  2012-07-14 11:40 [PATCH] perf: make the breakpoint events sample period default to 1 Jovi Zhang
@ 2012-07-25 19:29 ` tip-bot for Jovi Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Jovi Zhang @ 2012-07-25 19:29 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, tglx, bookjovi

Commit-ID:  4a841d650ea435c69e60675537f158a620697290
Gitweb:     http://git.kernel.org/tip/4a841d650ea435c69e60675537f158a620697290
Author:     Jovi Zhang <bookjovi@gmail.com>
AuthorDate: Sun, 15 Jul 2012 03:03:10 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 25 Jul 2012 11:37:46 -0300

perf tools: Make the breakpoint events sample period default to 1

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@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/CACV3sbLF8taiCq_VYW-sgRJyupeMzg58C7ZXfMe3xZUiH_Mx6w@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index a729945..74a5af4 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -490,6 +490,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;
 
 	return add_event(list, idx, &attr, NULL);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-25 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 11:40 [PATCH] perf: make the breakpoint events sample period default to 1 Jovi Zhang
2012-07-25 19:29 ` [tip:perf/core] perf tools: Make " tip-bot for Jovi Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.