diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-07-16 02:21:08 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-07-17 01:45:51 -0400 |
commit | 6f2f3cf00ee32f75ba007a46bab88a54d68a5deb (patch) | |
tree | 89aaab40d502c84e135b7e9e72b20bb7d498bc8c /kernel/trace/ftrace.c | |
parent | 79173bf556417a737e9d2e096e0788452ec30a61 (diff) |
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>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 217caeca71cd..80a97a51442d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1403,18 +1403,13 @@ static int t_hash_show(struct seq_file *m, void *v) | |||
1403 | { | 1403 | { |
1404 | struct ftrace_func_probe *rec; | 1404 | struct ftrace_func_probe *rec; |
1405 | struct hlist_node *hnd = v; | 1405 | struct hlist_node *hnd = v; |
1406 | char str[KSYM_SYMBOL_LEN]; | ||
1407 | 1406 | ||
1408 | rec = hlist_entry(hnd, struct ftrace_func_probe, node); | 1407 | rec = hlist_entry(hnd, struct ftrace_func_probe, node); |
1409 | 1408 | ||
1410 | if (rec->ops->print) | 1409 | if (rec->ops->print) |
1411 | return rec->ops->print(m, rec->ip, rec->ops, rec->data); | 1410 | return rec->ops->print(m, rec->ip, rec->ops, rec->data); |
1412 | 1411 | ||
1413 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); | 1412 | seq_printf(m, "%pf:%pf", (void *)rec->ip, (void *)rec->ops->func); |
1414 | seq_printf(m, "%s:", str); | ||
1415 | |||
1416 | kallsyms_lookup((unsigned long)rec->ops->func, NULL, NULL, NULL, str); | ||
1417 | seq_printf(m, "%s", str); | ||
1418 | 1413 | ||
1419 | if (rec->data) | 1414 | if (rec->data) |
1420 | seq_printf(m, ":%p", rec->data); | 1415 | seq_printf(m, ":%p", rec->data); |
@@ -1512,7 +1507,6 @@ static int t_show(struct seq_file *m, void *v) | |||
1512 | { | 1507 | { |
1513 | struct ftrace_iterator *iter = m->private; | 1508 | struct ftrace_iterator *iter = m->private; |
1514 | struct dyn_ftrace *rec = v; | 1509 | struct dyn_ftrace *rec = v; |
1515 | char str[KSYM_SYMBOL_LEN]; | ||
1516 | 1510 | ||
1517 | if (iter->flags & FTRACE_ITER_HASH) | 1511 | if (iter->flags & FTRACE_ITER_HASH) |
1518 | return t_hash_show(m, v); | 1512 | return t_hash_show(m, v); |
@@ -1525,9 +1519,7 @@ static int t_show(struct seq_file *m, void *v) | |||
1525 | if (!rec) | 1519 | if (!rec) |
1526 | return 0; | 1520 | return 0; |
1527 | 1521 | ||
1528 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); | 1522 | seq_printf(m, "%pf\n", (void *)rec->ip); |
1529 | |||
1530 | seq_printf(m, "%s\n", str); | ||
1531 | 1523 | ||
1532 | return 0; | 1524 | return 0; |
1533 | } | 1525 | } |
@@ -2508,7 +2500,6 @@ static void g_stop(struct seq_file *m, void *p) | |||
2508 | static int g_show(struct seq_file *m, void *v) | 2500 | static int g_show(struct seq_file *m, void *v) |
2509 | { | 2501 | { |
2510 | unsigned long *ptr = v; | 2502 | unsigned long *ptr = v; |
2511 | char str[KSYM_SYMBOL_LEN]; | ||
2512 | 2503 | ||
2513 | if (!ptr) | 2504 | if (!ptr) |
2514 | return 0; | 2505 | return 0; |
@@ -2518,9 +2509,7 @@ static int g_show(struct seq_file *m, void *v) | |||
2518 | return 0; | 2509 | return 0; |
2519 | } | 2510 | } |
2520 | 2511 | ||
2521 | kallsyms_lookup(*ptr, NULL, NULL, NULL, str); | 2512 | seq_printf(m, "%pf\n", v); |
2522 | |||
2523 | seq_printf(m, "%s\n", str); | ||
2524 | 2513 | ||
2525 | return 0; | 2514 | return 0; |
2526 | } | 2515 | } |