• Ian Rogers's avatar
    perf parse-events: Add default_breakpoint_len helper · 70b27c75
    Ian Rogers authored
    The default breakpoint length is "sizeof(long)" however this is
    incorrect on platforms like Aarch64 where sizeof(long) is 8 but the
    breakpoint length is 4. Add a helper function that can be used to
    determine the correct breakpoint length, in this change it just
    returns the existing default sizeof(long) value.
    
    Use the helper in the bp_account test so that, when modifying the
    event from a watchpoint to a breakpoint, the breakpoint length is
    appropriate for the architecture and not just sizeof(long).
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
    Cc: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
    Cc: Colin Ian King <colin.i.king@gmail.com>
    Cc: Dominique Martinet <asmadeus@codewreck.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Clark <james.clark@linaro.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: John Garry <john.g.garry@oracle.com>
    Cc: Junhao He <hejunhao3@huawei.com>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Yang Jihong <yangjihong@bytedance.com>
    Link: https://lore.kernel.org/r/20240904050606.752788-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    70b27c75
bp_account.c 4.92 KB