mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
tracing/function: Cleanup for function tracer
We can directly use %pf input format instead of kallsyms_lookup() and %s input format Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
parent
79173bf556
commit
6f2f3cf00e
2 changed files with 4 additions and 17 deletions
|
@ -1403,18 +1403,13 @@ static int t_hash_show(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
struct ftrace_func_probe *rec;
|
struct ftrace_func_probe *rec;
|
||||||
struct hlist_node *hnd = v;
|
struct hlist_node *hnd = v;
|
||||||
char str[KSYM_SYMBOL_LEN];
|
|
||||||
|
|
||||||
rec = hlist_entry(hnd, struct ftrace_func_probe, node);
|
rec = hlist_entry(hnd, struct ftrace_func_probe, node);
|
||||||
|
|
||||||
if (rec->ops->print)
|
if (rec->ops->print)
|
||||||
return rec->ops->print(m, rec->ip, rec->ops, rec->data);
|
return rec->ops->print(m, rec->ip, rec->ops, rec->data);
|
||||||
|
|
||||||
kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
|
seq_printf(m, "%pf:%pf", (void *)rec->ip, (void *)rec->ops->func);
|
||||||
seq_printf(m, "%s:", str);
|
|
||||||
|
|
||||||
kallsyms_lookup((unsigned long)rec->ops->func, NULL, NULL, NULL, str);
|
|
||||||
seq_printf(m, "%s", str);
|
|
||||||
|
|
||||||
if (rec->data)
|
if (rec->data)
|
||||||
seq_printf(m, ":%p", rec->data);
|
seq_printf(m, ":%p", rec->data);
|
||||||
|
@ -1512,7 +1507,6 @@ static int t_show(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
struct ftrace_iterator *iter = m->private;
|
struct ftrace_iterator *iter = m->private;
|
||||||
struct dyn_ftrace *rec = v;
|
struct dyn_ftrace *rec = v;
|
||||||
char str[KSYM_SYMBOL_LEN];
|
|
||||||
|
|
||||||
if (iter->flags & FTRACE_ITER_HASH)
|
if (iter->flags & FTRACE_ITER_HASH)
|
||||||
return t_hash_show(m, v);
|
return t_hash_show(m, v);
|
||||||
|
@ -1525,9 +1519,7 @@ static int t_show(struct seq_file *m, void *v)
|
||||||
if (!rec)
|
if (!rec)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
|
seq_printf(m, "%pf\n", (void *)rec->ip);
|
||||||
|
|
||||||
seq_printf(m, "%s\n", str);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2508,7 +2500,6 @@ static void g_stop(struct seq_file *m, void *p)
|
||||||
static int g_show(struct seq_file *m, void *v)
|
static int g_show(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
unsigned long *ptr = v;
|
unsigned long *ptr = v;
|
||||||
char str[KSYM_SYMBOL_LEN];
|
|
||||||
|
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2518,9 +2509,7 @@ static int g_show(struct seq_file *m, void *v)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
kallsyms_lookup(*ptr, NULL, NULL, NULL, str);
|
seq_printf(m, "%pf\n", v);
|
||||||
|
|
||||||
seq_printf(m, "%s\n", str);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,11 +288,9 @@ static int
|
||||||
ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
|
ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
|
||||||
struct ftrace_probe_ops *ops, void *data)
|
struct ftrace_probe_ops *ops, void *data)
|
||||||
{
|
{
|
||||||
char str[KSYM_SYMBOL_LEN];
|
|
||||||
long count = (long)data;
|
long count = (long)data;
|
||||||
|
|
||||||
kallsyms_lookup(ip, NULL, NULL, NULL, str);
|
seq_printf(m, "%pf:", (void *)ip);
|
||||||
seq_printf(m, "%s:", str);
|
|
||||||
|
|
||||||
if (ops == &traceon_probe_ops)
|
if (ops == &traceon_probe_ops)
|
||||||
seq_printf(m, "traceon");
|
seq_printf(m, "traceon");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue