aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-11-25 15:07:04 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-25 19:59:45 -0500
commitfb52607afcd0629776f1dc9e657647ceae81dd50 (patch)
tree7bf43b41ff8510d3098c089913cce56a9049f0fd /kernel/trace/ftrace.c
parent509dceef6470442d8c7b8a43ec34125205840b3c (diff)
tracing/function-return-tracer: change the name into function-graph-tracer
Impact: cleanup This patch changes the name of the "return function tracer" into function-graph-tracer which is a more suitable name for a tracing which makes one able to retrieve the ordered call stack during the code flow. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 53042f118f23..9e19976af727 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -395,11 +395,11 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
395 unsigned long ip, fl; 395 unsigned long ip, fl;
396 unsigned long ftrace_addr; 396 unsigned long ftrace_addr;
397 397
398#ifdef CONFIG_FUNCTION_RET_TRACER 398#ifdef CONFIG_FUNCTION_GRAPH_TRACER
399 if (ftrace_tracing_type == FTRACE_TYPE_ENTER) 399 if (ftrace_tracing_type == FTRACE_TYPE_ENTER)
400 ftrace_addr = (unsigned long)ftrace_caller; 400 ftrace_addr = (unsigned long)ftrace_caller;
401 else 401 else
402 ftrace_addr = (unsigned long)ftrace_return_caller; 402 ftrace_addr = (unsigned long)ftrace_graph_caller;
403#else 403#else
404 ftrace_addr = (unsigned long)ftrace_caller; 404 ftrace_addr = (unsigned long)ftrace_caller;
405#endif 405#endif
@@ -1496,13 +1496,13 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
1496 return ret; 1496 return ret;
1497} 1497}
1498 1498
1499#ifdef CONFIG_FUNCTION_RET_TRACER 1499#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1500 1500
1501static atomic_t ftrace_retfunc_active; 1501static atomic_t ftrace_retfunc_active;
1502 1502
1503/* The callback that hooks the return of a function */ 1503/* The callback that hooks the return of a function */
1504trace_function_return_t ftrace_function_return = 1504trace_function_graph_t ftrace_graph_function =
1505 (trace_function_return_t)ftrace_stub; 1505 (trace_function_graph_t)ftrace_stub;
1506 1506
1507 1507
1508/* Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks. */ 1508/* Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks. */
@@ -1549,7 +1549,7 @@ free:
1549} 1549}
1550 1550
1551/* Allocate a return stack for each task */ 1551/* Allocate a return stack for each task */
1552static int start_return_tracing(void) 1552static int start_graph_tracing(void)
1553{ 1553{
1554 struct ftrace_ret_stack **ret_stack_list; 1554 struct ftrace_ret_stack **ret_stack_list;
1555 int ret; 1555 int ret;
@@ -1569,7 +1569,7 @@ static int start_return_tracing(void)
1569 return ret; 1569 return ret;
1570} 1570}
1571 1571
1572int register_ftrace_return(trace_function_return_t func) 1572int register_ftrace_graph(trace_function_graph_t func)
1573{ 1573{
1574 int ret = 0; 1574 int ret = 0;
1575 1575
@@ -1584,13 +1584,13 @@ int register_ftrace_return(trace_function_return_t func)
1584 goto out; 1584 goto out;
1585 } 1585 }
1586 atomic_inc(&ftrace_retfunc_active); 1586 atomic_inc(&ftrace_retfunc_active);
1587 ret = start_return_tracing(); 1587 ret = start_graph_tracing();
1588 if (ret) { 1588 if (ret) {
1589 atomic_dec(&ftrace_retfunc_active); 1589 atomic_dec(&ftrace_retfunc_active);
1590 goto out; 1590 goto out;
1591 } 1591 }
1592 ftrace_tracing_type = FTRACE_TYPE_RETURN; 1592 ftrace_tracing_type = FTRACE_TYPE_RETURN;
1593 ftrace_function_return = func; 1593 ftrace_graph_function = func;
1594 ftrace_startup(); 1594 ftrace_startup();
1595 1595
1596out: 1596out:
@@ -1598,12 +1598,12 @@ out:
1598 return ret; 1598 return ret;
1599} 1599}
1600 1600
1601void unregister_ftrace_return(void) 1601void unregister_ftrace_graph(void)
1602{ 1602{
1603 mutex_lock(&ftrace_sysctl_lock); 1603 mutex_lock(&ftrace_sysctl_lock);
1604 1604
1605 atomic_dec(&ftrace_retfunc_active); 1605 atomic_dec(&ftrace_retfunc_active);
1606 ftrace_function_return = (trace_function_return_t)ftrace_stub; 1606 ftrace_graph_function = (trace_function_graph_t)ftrace_stub;
1607 ftrace_shutdown(); 1607 ftrace_shutdown();
1608 /* Restore normal tracing type */ 1608 /* Restore normal tracing type */
1609 ftrace_tracing_type = FTRACE_TYPE_ENTER; 1609 ftrace_tracing_type = FTRACE_TYPE_ENTER;
@@ -1612,7 +1612,7 @@ void unregister_ftrace_return(void)
1612} 1612}
1613 1613
1614/* Allocate a return stack for newly created task */ 1614/* Allocate a return stack for newly created task */
1615void ftrace_retfunc_init_task(struct task_struct *t) 1615void ftrace_graph_init_task(struct task_struct *t)
1616{ 1616{
1617 if (atomic_read(&ftrace_retfunc_active)) { 1617 if (atomic_read(&ftrace_retfunc_active)) {
1618 t->ret_stack = kmalloc(FTRACE_RETFUNC_DEPTH 1618 t->ret_stack = kmalloc(FTRACE_RETFUNC_DEPTH
@@ -1626,7 +1626,7 @@ void ftrace_retfunc_init_task(struct task_struct *t)
1626 t->ret_stack = NULL; 1626 t->ret_stack = NULL;
1627} 1627}
1628 1628
1629void ftrace_retfunc_exit_task(struct task_struct *t) 1629void ftrace_graph_exit_task(struct task_struct *t)
1630{ 1630{
1631 struct ftrace_ret_stack *ret_stack = t->ret_stack; 1631 struct ftrace_ret_stack *ret_stack = t->ret_stack;
1632 1632