Commit 317f9f64 authored by Zhen Lei's avatar Zhen Lei Committed by Zheng Zengkai
Browse files

perf tools: set the default length of HW_BREAKPOINT_X as 4 for non X86_64



hulk inclusion
category: bugfix
bugzilla: 47254
CVE: NA

-------------------------------------------------------------------------

Some products may run both 32bit(ILP32) and 64bit APPs on arm64, such as
SD5122. And RTOS will only provides 64bit perf tool. At present, if the
user did not obviously specify the the length of HW_BREAKPOINT_X, perf
will use sizeof(long) as default. For 64bit perf tool, this value is 8.
But the ILP32 syscall only accepts the length 2(Thumb) and 4.

In fact, the original default length is 4 before below patch, because the
length of some instructions is larger than 4 on X86_64.

Use macro HAVE_ARCH_X86_64_SUPPORT to make sure that the default length
is sizeof(long) on X86_64, and HW_BREAKPOINT_LEN_4 for others.

Fixes: aa59a485 ("perf: Don't use 4 bytes as a default instruction breakpoint length")
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: default avatarLi Bin <huawei.libin@huawei.com>
Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
Reviewed-by: default avatarCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 8d79e3ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment