perf: Make bp_len type to u64 generic across the arch
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Sat, 30 Jan 2010 04:55:18 +0000 (10:25 +0530)
committerFrederic Weisbecker <fweisbec@gmail.com>
Thu, 4 Feb 2010 00:07:12 +0000 (01:07 +0100)
Change 'bp_len' type to __u64 to make it work across archs as
the s390 architecture watch point length can be upto 2^64.

reference:
http://lkml.org/lkml/2010/1/25/212

This is an ABI change that is not backward compatible with
the previous hardware breakpoint info layout integrated in this
development cycle, a rebuilt of perf tools is necessary for
versions based on 2.6.33-rc1 - 2.6.33-rc6 to work with a
kernel based on this patch.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin <schwidefsky@de.ibm.com>
LKML-Reference: <20100130045518.GA20776@in.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
include/linux/hw_breakpoint.h
include/linux/perf_event.h
kernel/hw_breakpoint.c
kernel/perf_event.c

index 070ba0621738d698523914f981eb2be15d092c95..5977b724f7c6884ee19ee6d657f91eaf84f9bde0 100644 (file)
@@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp)
        return bp->attr.bp_type;
 }
 
-static inline int hw_breakpoint_len(struct perf_event *bp)
+static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
 {
        return bp->attr.bp_len;
 }
index 8fa71874113f326106bc79ea699910f75b6c3d9e..a177698d95e26a492fef20aa90c6e43cb7111386 100644 (file)
@@ -211,11 +211,9 @@ struct perf_event_attr {
                __u32           wakeup_watermark; /* bytes before wakeup   */
        };
 
-       __u32                   __reserved_2;
-
-       __u64                   bp_addr;
        __u32                   bp_type;
-       __u32                   bp_len;
+       __u64                   bp_addr;
+       __u64                   bp_len;
 };
 
 /*
index 8a5c7d55ac9fab9bdbd97bb7701d92ed2b3fa310..967e66143e117096262c65fa646a1570e5f035d3 100644 (file)
@@ -360,8 +360,8 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
 int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
 {
        u64 old_addr = bp->attr.bp_addr;
+       u64 old_len = bp->attr.bp_len;
        int old_type = bp->attr.bp_type;
-       int old_len = bp->attr.bp_len;
        int err = 0;
 
        perf_event_disable(bp);
index d27746bd3a06097af5635539b690fe272b78cf2c..2b19297742cb5761141e509732c0efdab63a4f9a 100644 (file)
@@ -4580,7 +4580,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
        if (attr->type >= PERF_TYPE_MAX)
                return -EINVAL;
 
-       if (attr->__reserved_1 || attr->__reserved_2)
+       if (attr->__reserved_1)
                return -EINVAL;
 
        if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))