aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hw_breakpoint.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-06 21:14:17 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2009-12-07 01:04:33 -0500
commited872d09effd54aa8ecb4ceedbc4dbab9592f337 (patch)
tree34be7e06922a496386ad91500fb8e73e87c846a8 /include/linux/hw_breakpoint.h
parentb9b1e1c71a9481c0c34ed5bed42f1bfa730fd39e (diff)
hw-breakpoints: Zeroe the breakpoint attrs on initialization
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>
Diffstat (limited to 'include/linux/hw_breakpoint.h')
-rw-r--r--include/linux/hw_breakpoint.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 4d14a384a01e..42da1ce19ec0 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -22,6 +22,8 @@ enum {
22 22
23static inline void hw_breakpoint_init(struct perf_event_attr *attr) 23static inline void hw_breakpoint_init(struct perf_event_attr *attr)
24{ 24{
25 memset(attr, 0, sizeof(*attr));
26
25 attr->type = PERF_TYPE_BREAKPOINT; 27 attr->type = PERF_TYPE_BREAKPOINT;
26 attr->size = sizeof(*attr); 28 attr->size = sizeof(*attr);
27 /* 29 /*