mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 12:54:27 +00:00
Every architecture can provide a register list for sampling. If an architecture doesn't support register sampling, it won't define the data structure 'sample_reg_masks'. Consequently, any code using this structure must be protected by the macro 'HAVE_PERF_REGS_SUPPORT'. This patch defines a weak function, arch__sample_reg_masks(), which will be replaced by an architecture-defined function for returning the architecture's register list. With this refactoring, the function always exists, the condition checking for 'HAVE_PERF_REGS_SUPPORT' is not needed anymore, so remove it. Signed-off-by: Leo Yan <[email protected]> Reviewed-by: Ian Rogers <[email protected]> Cc: James Clark <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Albert Ou <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Guo Ren <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mike Leach <[email protected]> Cc: Kan Liang <[email protected]> Cc: Ming Wang <[email protected]> Cc: John Garry <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
19 lines
441 B
C
19 lines
441 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <inttypes.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "debug.h"
|
|
#include "symbol.h"
|
|
#include "callchain.h"
|
|
#include "perf_regs.h"
|
|
#include "record.h"
|
|
#include "util/perf_regs.h"
|
|
|
|
void arch__add_leaf_frame_record_opts(struct record_opts *opts)
|
|
{
|
|
const struct sample_reg *sample_reg_masks = arch__sample_reg_masks();
|
|
|
|
opts->sample_user_regs |= sample_reg_masks[PERF_REG_ARM64_LR].mask;
|
|
}
|