aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-07-16 02:21:08 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-07-17 01:45:51 -0400
commit6f2f3cf00ee32f75ba007a46bab88a54d68a5deb (patch)
tree89aaab40d502c84e135b7e9e72b20bb7d498bc8c /kernel
parent79173bf556417a737e9d2e096e0788452ec30a61 (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')
-rw-r--r--kernel/trace/ftrace.c17
-rw-r--r--kernel/trace/trace_functions.c4
2 files changed, 4 insertions, 17 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)
2508static int g_show(struct seq_file *m, void *v) 2500static 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}
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 7402144bff21..b53dc994dfb6 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -288,11 +288,9 @@ static int
288ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, 288ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
289 struct ftrace_probe_ops *ops, void *data) 289 struct ftrace_probe_ops *ops, void *data)
290{ 290{
291 char str[KSYM_SYMBOL_LEN];
292 long count = (long)data; 291 long count = (long)data;
293 292
294 kallsyms_lookup(ip, NULL, NULL, NULL, str); 293 seq_printf(m, "%pf:", (void *)ip);
295 seq_printf(m, "%s:", str);
296 294
297 if (ops == &traceon_probe_ops) 295 if (ops == &traceon_probe_ops)
298 seq_printf(m, "traceon"); 296 seq_printf(m, "traceon");