projects
/
platform
/
kernel
/
linux-arm64.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9b1e1c
)
hw-breakpoints: Zeroe the breakpoint attrs on initialization
author
Frederic Weisbecker
<fweisbec@gmail.com>
Mon, 7 Dec 2009 02:14:17 +0000
(
03:14
+0100)
committer
Frederic Weisbecker
<fweisbec@gmail.com>
Mon, 7 Dec 2009 06:04:33 +0000
(07:04 +0100)
The perf attrs used to set up breakpoint parameters are often allocated
in the stack and not zeroed out before calling hw_breakpoint_init().
Handle it from this helper to avoid random attributes set by the stack.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
include/linux/hw_breakpoint.h
patch
|
blob
|
history
diff --git
a/include/linux/hw_breakpoint.h
b/include/linux/hw_breakpoint.h
index
4d14a38
..
42da1ce
100644
(file)
--- a/
include/linux/hw_breakpoint.h
+++ b/
include/linux/hw_breakpoint.h
@@
-22,6
+22,8
@@
enum {
static inline void hw_breakpoint_init(struct perf_event_attr *attr)
{
+ memset(attr, 0, sizeof(*attr));
+
attr->type = PERF_TYPE_BREAKPOINT;
attr->size = sizeof(*attr);
/*