mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
perf-probe: Add user memory access attribute support
Add user memory access attribute for kprobe event arguments. If a given 'local variable' is in user-space, User can specify memory access method by '@user' suffix. This is not only for string but also for data structure. If we access a field of data structure in user memory from kernel on some arch, it will fail. e.g. perf probe -a "sched_setscheduler param->sched_priority" This will fail to access the "param->sched_priority" because the param is __user pointer. Instead, we can now specify @user suffix for such argument. perf probe -a "sched_setscheduler param->sched_priority@user" Note that kernel memory access with "@user" must always fail on any arch. Link: http://lkml.kernel.org/r/155789874562.26965.10836126971405890891.stgit@devnote2 Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
bdf2b8cbf0
commit
1e032f7cfa
6 changed files with 35 additions and 8 deletions
|
@ -1015,6 +1015,7 @@ enum ftrace_readme {
|
|||
FTRACE_README_PROBE_TYPE_X = 0,
|
||||
FTRACE_README_KRETPROBE_OFFSET,
|
||||
FTRACE_README_UPROBE_REF_CTR,
|
||||
FTRACE_README_USER_ACCESS,
|
||||
FTRACE_README_END,
|
||||
};
|
||||
|
||||
|
@ -1027,6 +1028,7 @@ static struct {
|
|||
DEFINE_TYPE(FTRACE_README_PROBE_TYPE_X, "*type: * x8/16/32/64,*"),
|
||||
DEFINE_TYPE(FTRACE_README_KRETPROBE_OFFSET, "*place (kretprobe): *"),
|
||||
DEFINE_TYPE(FTRACE_README_UPROBE_REF_CTR, "*ref_ctr_offset*"),
|
||||
DEFINE_TYPE(FTRACE_README_USER_ACCESS, "*[u]<offset>*"),
|
||||
};
|
||||
|
||||
static bool scan_ftrace_readme(enum ftrace_readme type)
|
||||
|
@ -1087,3 +1089,8 @@ bool uprobe_ref_ctr_is_supported(void)
|
|||
{
|
||||
return scan_ftrace_readme(FTRACE_README_UPROBE_REF_CTR);
|
||||
}
|
||||
|
||||
bool user_access_is_supported(void)
|
||||
{
|
||||
return scan_ftrace_readme(FTRACE_README_USER_ACCESS);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue