[PATCH 31/69] perf trace: Associate the "msr" tracepoint arg name with x86_MSR__scnprintf()
From: Arnaldo Carvalho de Melo
Date: Fri Oct 11 2019 - 16:09:17 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
So that we can go from:
# perf trace -e msr:write_msr --max-stack=16 sleep 1
0.000 sleep/6740 msr:write_msr(msr: 3221225728, val: 139636317451648)
do_trace_write_msr ([kernel.kallsyms])
do_trace_write_msr ([kernel.kallsyms])
do_arch_prctl_64 ([kernel.kallsyms])
__x64_sys_arch_prctl ([kernel.kallsyms])
do_syscall_64 ([kernel.kallsyms])
entry_SYSCALL_64 ([kernel.kallsyms])
init_tls (/usr/lib64/ld-2.29.so)
dl_main (/usr/lib64/ld-2.29.so)
_dl_sysdep_start (/usr/lib64/ld-2.29.so)
_dl_start (/usr/lib64/ld-2.29.so)
#
To:
# perf trace -e msr:write_msr --max-stack=16 sleep 1
0.000 sleep/8519 msr:write_msr(msr: FS_BASE, val: 139878031705472)
do_trace_write_msr ([kernel.kallsyms])
do_trace_write_msr ([kernel.kallsyms])
do_arch_prctl_64 ([kernel.kallsyms])
__x64_sys_arch_prctl ([kernel.kallsyms])
do_syscall_64 ([kernel.kallsyms])
entry_SYSCALL_64 ([kernel.kallsyms])
init_tls (/usr/lib64/ld-2.29.so)
dl_main (/usr/lib64/ld-2.29.so)
_dl_sysdep_start (/usr/lib64/ld-2.29.so)
_dl_start (/usr/lib64/ld-2.29.so)
#
This, in reverse, will allow for symbolic system call/tracepoint
filtering.
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Brendan Gregg <brendan.d.gregg@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Luis ClÃudio GonÃalves <lclaudio@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: https://lkml.kernel.org/n/tip-q1q4unmqja5ex7dy0kb5cjaa@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-trace.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d52972ca6123..e9f132aa5a09 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1480,6 +1480,7 @@ static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args)
}
static struct syscall_arg_fmt syscall_arg_fmts__by_name[] = {
+ { .name = "msr", .scnprintf = SCA_X86_MSR, }
};
static int syscall_arg_fmt__cmp(const void *name, const void *fmtp)
--
2.21.0