提交 36748b95 编写于 作者: J Jacob Shin 提交者: Frederic Weisbecker

perf/x86: Remove get_hbp_len and replace with bp_len

Clean up the logic for determining the breakpoint length
Signed-off-by: NJacob Shin <jacob.w.shin@gmail.com>
Signed-off-by: NSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Reviewed-by: NOleg Nesterov <oleg@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: xiakaixu <xiakaixu@huawei.com>
Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
上级 ec32398c
...@@ -167,29 +167,6 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) ...@@ -167,29 +167,6 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
set_dr_addr_mask(0, i); set_dr_addr_mask(0, i);
} }
static int get_hbp_len(u8 hbp_len)
{
unsigned int len_in_bytes = 0;
switch (hbp_len) {
case X86_BREAKPOINT_LEN_1:
len_in_bytes = 1;
break;
case X86_BREAKPOINT_LEN_2:
len_in_bytes = 2;
break;
case X86_BREAKPOINT_LEN_4:
len_in_bytes = 4;
break;
#ifdef CONFIG_X86_64
case X86_BREAKPOINT_LEN_8:
len_in_bytes = 8;
break;
#endif
}
return len_in_bytes;
}
/* /*
* Check for virtual address in kernel space. * Check for virtual address in kernel space.
*/ */
...@@ -200,7 +177,7 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp) ...@@ -200,7 +177,7 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp)
struct arch_hw_breakpoint *info = counter_arch_bp(bp); struct arch_hw_breakpoint *info = counter_arch_bp(bp);
va = info->address; va = info->address;
len = get_hbp_len(info->len); len = bp->attr.bp_len;
return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册