mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 23:47:06 +00:00
regs_query_register_offset() is a helper function which converts register name like "%rax" to offset of a register in 'struct pt_regs', which is required by BPF prologue generator. PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET indicates an architecture supports converting name of a register to its offset in 'struct pt_regs'. HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced as the corresponding CFLAGS of PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET. Signed-off-by: Wang Nan <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Brendan Gregg <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kaixu Xia <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: He Kuang <[email protected]> [ Extracted from eBPF patches ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
17 lines
407 B
C
17 lines
407 B
C
#ifndef _PERF_DWARF_REGS_H_
|
|
#define _PERF_DWARF_REGS_H_
|
|
|
|
#ifdef HAVE_DWARF_SUPPORT
|
|
const char *get_arch_regstr(unsigned int n);
|
|
#endif
|
|
|
|
#ifdef HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
|
|
/*
|
|
* Arch should support fetching the offset of a register in pt_regs
|
|
* by its name. See kernel's regs_query_register_offset in
|
|
* arch/xxx/kernel/ptrace.c.
|
|
*/
|
|
int regs_query_register_offset(const char *name);
|
|
#endif
|
|
#endif
|