diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 5f7c8642d58b..cbf8b09f63a5 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -53,9 +53,6 @@ static int ftrace_pid_trace = -1; | |||
53 | /* Quick disabling of function tracer. */ | 53 | /* Quick disabling of function tracer. */ |
54 | int function_trace_stop; | 54 | int function_trace_stop; |
55 | 55 | ||
56 | /* By default, current tracing type is normal tracing. */ | ||
57 | enum ftrace_tracing_type_t ftrace_tracing_type = FTRACE_TYPE_ENTER; | ||
58 | |||
59 | /* | 56 | /* |
60 | * ftrace_disabled is set when an anomaly is discovered. | 57 | * ftrace_disabled is set when an anomaly is discovered. |
61 | * ftrace_disabled is much stronger than ftrace_enabled. | 58 | * ftrace_disabled is much stronger than ftrace_enabled. |
@@ -1576,15 +1573,9 @@ int register_ftrace_function(struct ftrace_ops *ops) | |||
1576 | 1573 | ||
1577 | mutex_lock(&ftrace_sysctl_lock); | 1574 | mutex_lock(&ftrace_sysctl_lock); |
1578 | 1575 | ||
1579 | if (ftrace_tracing_type == FTRACE_TYPE_RETURN) { | ||
1580 | ret = -EBUSY; | ||
1581 | goto out; | ||
1582 | } | ||
1583 | |||
1584 | ret = __register_ftrace_function(ops); | 1576 | ret = __register_ftrace_function(ops); |
1585 | ftrace_startup(0); | 1577 | ftrace_startup(0); |
1586 | 1578 | ||
1587 | out: | ||
1588 | mutex_unlock(&ftrace_sysctl_lock); | 1579 | mutex_unlock(&ftrace_sysctl_lock); |
1589 | return ret; | 1580 | return ret; |
1590 | } | 1581 | } |
@@ -1731,23 +1722,16 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc, | |||
1731 | 1722 | ||
1732 | mutex_lock(&ftrace_sysctl_lock); | 1723 | mutex_lock(&ftrace_sysctl_lock); |
1733 | 1724 | ||
1734 | /* | ||
1735 | * Don't launch return tracing if normal function | ||
1736 | * tracing is already running. | ||
1737 | */ | ||
1738 | if (ftrace_trace_function != ftrace_stub) { | ||
1739 | ret = -EBUSY; | ||
1740 | goto out; | ||
1741 | } | ||
1742 | atomic_inc(&ftrace_graph_active); | 1725 | atomic_inc(&ftrace_graph_active); |
1743 | ret = start_graph_tracing(); | 1726 | ret = start_graph_tracing(); |
1744 | if (ret) { | 1727 | if (ret) { |
1745 | atomic_dec(&ftrace_graph_active); | 1728 | atomic_dec(&ftrace_graph_active); |
1746 | goto out; | 1729 | goto out; |
1747 | } | 1730 | } |
1748 | ftrace_tracing_type = FTRACE_TYPE_RETURN; | 1731 | |
1749 | ftrace_graph_return = retfunc; | 1732 | ftrace_graph_return = retfunc; |
1750 | ftrace_graph_entry = entryfunc; | 1733 | ftrace_graph_entry = entryfunc; |
1734 | |||
1751 | ftrace_startup(FTRACE_START_FUNC_RET); | 1735 | ftrace_startup(FTRACE_START_FUNC_RET); |
1752 | 1736 | ||
1753 | out: | 1737 | out: |
@@ -1763,8 +1747,6 @@ void unregister_ftrace_graph(void) | |||
1763 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; | 1747 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; |
1764 | ftrace_graph_entry = (trace_func_graph_ent_t)ftrace_stub; | 1748 | ftrace_graph_entry = (trace_func_graph_ent_t)ftrace_stub; |
1765 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); | 1749 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); |
1766 | /* Restore normal tracing type */ | ||
1767 | ftrace_tracing_type = FTRACE_TYPE_ENTER; | ||
1768 | 1750 | ||
1769 | mutex_unlock(&ftrace_sysctl_lock); | 1751 | mutex_unlock(&ftrace_sysctl_lock); |
1770 | } | 1752 | } |