Commit 87ac6fa2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'perf-fixes-for-linus' of...

Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hw breakpoints: Fix pid namespace bug
  x86: Fix instruction breakpoint encoding
  oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540)
  kprobes: Fix Kconfig dependency
parents 19746cad 068e35ee
...@@ -32,8 +32,9 @@ config HAVE_OPROFILE ...@@ -32,8 +32,9 @@ config HAVE_OPROFILE
config KPROBES config KPROBES
bool "Kprobes" bool "Kprobes"
depends on KALLSYMS && MODULES depends on MODULES
depends on HAVE_KPROBES depends on HAVE_KPROBES
select KALLSYMS
help help
Kprobes allows you to trap at almost any kernel address and Kprobes allows you to trap at almost any kernel address and
execute a callback function. register_kprobe() establishes execute a callback function. register_kprobe() establishes
...@@ -45,7 +46,6 @@ config OPTPROBES ...@@ -45,7 +46,6 @@ config OPTPROBES
def_bool y def_bool y
depends on KPROBES && HAVE_OPTPROBES depends on KPROBES && HAVE_OPTPROBES
depends on !PREEMPT depends on !PREEMPT
select KALLSYMS_ALL
config HAVE_EFFICIENT_UNALIGNED_ACCESS config HAVE_EFFICIENT_UNALIGNED_ACCESS
bool bool
......
...@@ -20,7 +20,7 @@ struct arch_hw_breakpoint { ...@@ -20,7 +20,7 @@ struct arch_hw_breakpoint {
#include <linux/list.h> #include <linux/list.h>
/* Available HW breakpoint length encodings */ /* Available HW breakpoint length encodings */
#define X86_BREAKPOINT_LEN_X 0x00 #define X86_BREAKPOINT_LEN_X 0x40
#define X86_BREAKPOINT_LEN_1 0x40 #define X86_BREAKPOINT_LEN_1 0x40
#define X86_BREAKPOINT_LEN_2 0x44 #define X86_BREAKPOINT_LEN_2 0x44
#define X86_BREAKPOINT_LEN_4 0x4c #define X86_BREAKPOINT_LEN_4 0x4c
......
...@@ -206,11 +206,27 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp) ...@@ -206,11 +206,27 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp)
int arch_bp_generic_fields(int x86_len, int x86_type, int arch_bp_generic_fields(int x86_len, int x86_type,
int *gen_len, int *gen_type) int *gen_len, int *gen_type)
{ {
/* Len */ /* Type */
switch (x86_len) { switch (x86_type) {
case X86_BREAKPOINT_LEN_X: case X86_BREAKPOINT_EXECUTE:
if (x86_len != X86_BREAKPOINT_LEN_X)
return -EINVAL;
*gen_type = HW_BREAKPOINT_X;
*gen_len = sizeof(long); *gen_len = sizeof(long);
return 0;
case X86_BREAKPOINT_WRITE:
*gen_type = HW_BREAKPOINT_W;
break;
case X86_BREAKPOINT_RW:
*gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
break; break;
default:
return -EINVAL;
}
/* Len */
switch (x86_len) {
case X86_BREAKPOINT_LEN_1: case X86_BREAKPOINT_LEN_1:
*gen_len = HW_BREAKPOINT_LEN_1; *gen_len = HW_BREAKPOINT_LEN_1;
break; break;
...@@ -229,21 +245,6 @@ int arch_bp_generic_fields(int x86_len, int x86_type, ...@@ -229,21 +245,6 @@ int arch_bp_generic_fields(int x86_len, int x86_type,
return -EINVAL; return -EINVAL;
} }
/* Type */
switch (x86_type) {
case X86_BREAKPOINT_EXECUTE:
*gen_type = HW_BREAKPOINT_X;
break;
case X86_BREAKPOINT_WRITE:
*gen_type = HW_BREAKPOINT_W;
break;
case X86_BREAKPOINT_RW:
*gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
break;
default:
return -EINVAL;
}
return 0; return 0;
} }
...@@ -316,9 +317,6 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) ...@@ -316,9 +317,6 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
ret = -EINVAL; ret = -EINVAL;
switch (info->len) { switch (info->len) {
case X86_BREAKPOINT_LEN_X:
align = sizeof(long) -1;
break;
case X86_BREAKPOINT_LEN_1: case X86_BREAKPOINT_LEN_1:
align = 0; align = 0;
break; break;
......
...@@ -671,7 +671,9 @@ static int __init ppro_init(char **cpu_type) ...@@ -671,7 +671,9 @@ static int __init ppro_init(char **cpu_type)
case 14: case 14:
*cpu_type = "i386/core"; *cpu_type = "i386/core";
break; break;
case 15: case 23: case 0x0f:
case 0x16:
case 0x17:
*cpu_type = "i386/core_2"; *cpu_type = "i386/core_2";
break; break;
case 0x1a: case 0x1a:
......
...@@ -433,7 +433,8 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, ...@@ -433,7 +433,8 @@ register_user_hw_breakpoint(struct perf_event_attr *attr,
perf_overflow_handler_t triggered, perf_overflow_handler_t triggered,
struct task_struct *tsk) struct task_struct *tsk)
{ {
return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); return perf_event_create_kernel_counter(attr, -1, task_pid_vnr(tsk),
triggered);
} }
EXPORT_SYMBOL_GPL(register_user_hw_breakpoint); EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment